aalan

Uploading Data through data source using Adobe Analytics API 1.4

This is to test that what happen to data sources FTP location when data source data is uploaded through API 1.4 using postman

1.Create the data source through Analytics UI

  • Login to SC 15
  • Click on Admin->Data Sources

2.Create Transaction ID data sources

3.Using Postman send POST request on https://api.omniture.com/admin/1.4/rest/?method=DataSources.UploadData

4.In Pre-request Script

var uuid = function() {};

uuid.v4 = function() {

    return ‘xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx’.replace(/[xy]/g, function(c) { var r = Math.random()*16|0, v = c == ‘x’ ? r : (r&0x3|0x8); return v.toString(16); });

};

var WSSE = function(username, secret) {

    this.username = username;

    this.secret = secret;

};

WSSE.prototype.getHeader = function() {

    var nonce = uuid.v4();

    var created = new Date().toISOString();

    var hashString = nonce + created + this.secret;

    var digest = CryptoJS.SHA256(hashString).toString(CryptoJS.enc.Base64);

    var b64nonce = CryptoJS.enc.Latin1.parse(nonce).toString(CryptoJS.enc.Base64);

    var header = “UsernameToken”;

    header += ” Username=\”” + this.username + “\”,”;

    header += ” PasswordDigest=\”” + digest + “\”,”;

    header += ” Nonce=\”” + b64nonce + “\”,”;

    header += ” Created=\”” + created + “\”,”;

    header += ” Algorithm=\”SHA256\””;

    return { ‘X-WSSE’: header };

};

var wsse = new WSSE(‘shared secret’, ‘password’);

postman.setEnvironmentVariable(“x-wsse”, wsse.getHeader()[‘X-WSSE’])

5.Under body

{

  “columns”: [

     “Date”,

        “Product”,

         “Orders”,

         “transactionID”

  ],

  “dataSourceID”: “2”,

  “jobName”: “Product returned”,

  “reportSuiteID”: “lscsgeekourpc”,

  “rows”: [

    [

      “01/11/2019/06/00/00”,

      “Shirt”,

      “1”,

      “1235”

    ]

  ]

}

6.Under Header set WSSE


Result:

For API 1.4 documentation check : https://github.com/AdobeDocs/analytics-1.4-apis

Note :Grab the data source ID from the URL when you open the data source in UI

Once it appears true as result than in FTP of Data source a SOAP folder is created which have a file of data source, later on, which process.

Processing pauses if the size exceeds 50 MB and does not resume until the total is below 50 MB. To limit delays in generating reports, do not upload more than 90 days of data per day.

Reference : https://marketing.adobe.com/resources/help/en_US/sc/datasources/datasrc_faq.html

Leave a comment

You must login to add a new comment.

[wpqa_login]