Getting Started

Important Web Services v 1.2 and 1.3 API End-of-Life Notice:

Version 1.2 of the Web Services API was officially deprecated on February 20, 2014. It will reach end-of-life on September 15, 2016. At that time, Adobe will remove the ability of the API servers to respond to version 1.2 API requests. Any API requests made to the https://api.omniture.com/admin/1.2 endpoint will return a 410 error. Customers have until the end-of-life date to upgrade from the version 1.2 API to the version 1.4 API to prevent an outage in their API applications. See API Support Policy for more information.

Version 1.3 will be officially deprecated as of September 15, 2016. Customers are encouraged to migrate to the 1.4 API to leverage the improvements described on this page.

To get started, review the changes in 1.4, update your endpoint, and then use the examples to start generating reports.

Report Queue Workflow

  1. Open the API Explorer in Developer Connection.
  2. Send a request using Report API and the method Report.Queue. The Report API will return a report ID.
  3. Change the method to Report.Get using the report ID. There will be one of 2 responses:
    • A "report not ready" response:
      {
      
      	"error":"report_not_ready",
      
      	"error_description":"Report not ready",
      
      	"error_uri":null
      
      }
      
    • Or a return of the whole report.

Here are some best practices:

  • Check for a report every few seconds. Do not check more than once a second.
  • You can queue up multiple reports to be run concurrently.
  • The response from Report.Queue is exactly the same as the request for Report.Get.

Endpoint

API requests should be sent to the 1.4 endpoint:

https://api.omniture.com/admin/1.4/

You might need to replace api.omniture.com with the URL that corresponds to your data center, as listed in the following table. In your production apps, we recommend calling Company.GetEndpoint to periodically refresh the endpoint programmatically, in case the URL changes.

  • api.omniture.com - San Jose
  • api2.omniture.com - Dallas
  • api3.omniture.com - London
  • api4.omniture.com - Singapore
  • api5.omniture.com - Pacific Northwest

Removal of separate methods to generate different report types

If you are migrating from a previous version of the API, report types are now determined by the parameters of the reportDescription according to the following table:

Report Type Parameters
Overtime Report No elements with a dateGranularity specified.
Ranked Report 1 or more elements with no dateGranularity specified.
Trended Report 1 or more elements with a dateGranularity specified.
Pathing Report Element in the pattern parameter.
Fallout Report Element in the checkpoint parameter.
Summary Report No "reportSuiteID" parameter, instead "reportsuite" is specified as the report element and the "selected" parameter contains a list of report suite IDs.
Real-Time Report 'source' parameter present and set to 'realtime'. Note that Real-Time Reports do not have to be queued, they can run immediately using Report.Run.

The type derived is then returned in the result data as: ranked, trended, overtime, pathing, fallout, summary, or realtime.

Using the API in the Browser

The API supports CORS and can be used in most modern browsers in a cross-domain way. This library provides a way to do authentication with WSSE in Javascript. If you decide to use the browser, keep the following in mind:

  • If you have a lot of users using the application, you will need to cache the results on a server. Do not publish a script on your public web site that pulls directly from the API.
  • Some older browsers do not support CORS. Make sure your users are using a newer browser when trying to access the API.

Adobe Analytics Real-Time Dashboard Example

An example of how to create a real-time dashboard can be found on github.

Examples

In the following examples, replace "rsid" with your report suite id, and update the URL to use the correct endpoint.

//Simplest Request
https://api.omniture.com/admin/1.4/rest/?method=Report.Queue
{
    "reportDescription":{
        "reportSuiteID":"rsid"
    }
}

//overtime report
https://api.omniture.com/admin/1.4/rest/?method=Report.Queue
{
    "reportDescription":{
        "reportSuiteID":"rsid",
        "dateGranularity":"hour"
    }
}

//Ranked Report
https://api.omniture.com/admin/1.4/rest/?method=Report.Queue
{
    "reportDescription":{
        "reportSuiteID":"rsid",
        "elements":[
            {"id":"page"}
        ]
    }
}

//Trended Report
https://api.omniture.com/admin/1.4/rest/?method=Report.Queue
{
    "reportDescription":{
        "reportSuiteID":"rsid",
        "dateGranularity":"hour",
        "elements":[
            {"id":"page"}
        ]
    }
}

//Pathing Report -- NextPage Flow
https://api.omniture.com/admin/1.4/rest/?method=Report.Queue
{
    "reportDescription":{
        "reportSuiteID":"rsid",
        "metrics":[
            {"id":"pageviews"}
        ],
        "elements":[
            {"id":"page",
            "top":"10",
            "startingWith":"1",
            "pattern":[
                ["homepage"],
                ["::anything::"],
                ["::anything::"],
                ["::anything::"],
                ["::anything::"]
            ]}
        ]
    }
}

//Pathing Report -- PreviousPage Flow
https://api.omniture.com/admin/1.4/rest/?method=Report.Queue
{
    "reportDescription":{
        "reportSuiteID":"rsid",
        "metrics":[
            {"id":"pageviews"}
        ],
        "elements":[
            {"id":"page",
            "pattern":[
                ["::anything::"],
                ["::anything::"],
                ["::anything::"],
                ["::anything::"],
                ["homepage"],
            ]}
        ]
    }
}
            
//Pathing Report -- Fallout
https://api.omniture.com/admin/1.4/rest/?method=Report.Queue
{
    "reportDescription":{
        "reportSuiteID":"rsid",
        "metrics":[
            {"id":"pageviews"}
        ],
        "elements":[
            {"id":"page",
            "checkpoints":[
                "homepage",
                "/templates/choose-your-powerpoint-fonts-wisely/"
            ]}
        ]
    }
}
 
// Real-Time Report
// Note the inclusion of "source" equals "realtime"
// Make sure you configure Real-Time reports for the report suite
https://api.omniture.com/admin/1.4/rest/?method=Report.Run
{
    "reportDescription": {
        "source": "realtime",
        "reportSuiteID": "rsid",
        "metrics": [
            { "id": "revenue" }
        ]
    }
}

// Real-Time Report with sort options
https://api.omniture.com/admin/1.4/rest/?method=Report.Run
{
    "reportDescription": {
        "source": "realtime",
        "reportSuiteID": "rsid",
        "sortMethod": "mostPopular:.25:0:linear",
        "metrics": [
            { "id": "pageviews" }
        ]
    }
}

// Summary Report
// Note that the "reportSuiteID" parameter is not included
// and the elements list contains "reportsuite"
// Report suites are provided in the "selected" element
https://api.omniture.com/admin/1.4/rest/?method=Report.Queue
{
    "reportDescription":{
        "date":"2014",
        "metrics":[
            {
                "id":"pageviews",
            },
            {
                "id":"revenue",
            },
        ],
        "elements":[
            {
                "id":"reportsuite",
                "selected":[
                    "rsid1",
                    "rsid2"
                ]
            }

        ],
    }
}

//Error Message 
https://api.omniture.com/admin/1.4/rest/?method=Report.Queue
{
    "reportDescription":{
        "reportSuiteID":"rsid",
        "dateGranularity":"hours"
    }
}

//Validate Report Definiton (without Queuing it)
https://api.omniture.com/admin/1.4/rest/?method=Report.Validate
{
    "reportDescription":{
        "reportSuiteID":"rsid",
        "dateGranularity":"hours"
    }
}

//GetMetrics
https://api.omniture.com/admin/1.4/rest/?method=Report.GetMetrics
{
    "reportSuiteID":"rsid",
    "existingElements":["page"]
}

//GetElements
https://api.omniture.com/admin/1.4/rest/?method=Report.GetMetrics
{
    "reportSuiteID":"rsid",
    "existingMetrics":["pageviews"]
}

User Comments (14)

Hi there,

I keep getting a report invalid for real time reports.

{
"error":"report_invalid",
"error_description":"You do not have privileges to run this type of report",
"error_uri":"https:\/\/marketing.adobe.com\/developer"
}

can somebody help me?

The time is set for London time for some reason. Just change your timezone to GMT and try running it. That should work.

Request

https://api.omniture.com/admin/1.4/rest/?method=Report.GetMetrics

X-WSSE: UsernameToken Username="labuser", PasswordDigest="zrZPywDqgA18F4SwB7HbMOo4Zfc=", Nonce="MDNhZGE2YTU2NDczNDA5OTMxNTM5MDEx", Created="2015-05-27T16:14:51Z"

{
"reportSuiteID":"test_rsid_value",
"existingMetrics":["pageviews"]
}

Response
{
"error":"Bad Request",
"error_description":"Invalid login.",
"error_uri":null
}

Hi,
Is the JSON schema available anywhere?
This will be helpful to generate a domain model.

Thanks
Ahmed

When reports are complete and available to be retrieved with Report.Get, how long will they be available? Is there an expiration? For example if I Queue a report and it is available, and then a week later I attempt to Get it, will it still be available? Is there an official "window" of time it is available until it expires?

Hi,

I have two question one is

In ranking report am getting only top 10 url, How can I get all the url that are available in Ranked Report of Ominiature Login, below is the params that we are passing to Get.Queue method

{
"reportDescription": {
"reportSuiteID": "(reportSuiteID)",
"date": "2016-03",
"metrics": [{
"id": "pageViews"
}],
"sortBy": "pageViews",
"elements": [{
"id": "page"
}, {
"id": "evar75"
}]
}
}

Second one is How can I get count of a specific URL that are available in Ranked Report, I tried out with below params but has no success

{
"reportDescription": {
"reportSuiteID": "reportSuiteID",
"date": "2016-02",
"metrics": [{
"id": "pageViews"
}],
"sortBy": "pageViews",
"elements": [{
"id": "page",
"pattern":[
["homepage"]
]
}]
}
}

output :

{
"report":{
"type":"pathing",
"elements":[
{
"id":"page",
"name":"Page"
}
],
"reportSuite":{
"id":"reportSuiteID",
"name":"(reportSuiteName)"
},
"period":"February 2016",
"metrics":[
{
"id":"pageViews",
"name":"Page Views",
"type":"number",
"decimals":0,
"latency":4452,
"current":false
}
],
"data":[
{
"path":[
],
"counts":[
"0"
]
}
],
"totals":[
"0"
],
"version":"1.4.15.11"
},
"waitSeconds":"1.078",
"runSeconds":"2.106"
}

Please help me out with above two points.

Thanks

For question one the element has a top parameter that you can add. This will allow you to specify how many rows to retrieve.

e.g.

"elements": [
    {
        "id": "page",
        "top":100
    }, 
    {
        "id": "evar75"
    }

]

For the second question you can use the selected parameter of an element.

"elements": [
    {
        "id": "page",
        "selected":"name_of_page"
    }, 
    {
        "id": "evar75"
    }

]

You can reference the docs for the element parameter here.
https://marketing.adobe.com/developer/documentation/analytics-reporting-...

the last example should be: i believe
//GetElements https://api.omniture.com/admin/1.4/rest/?method=Report.GetElements

Previously we were using api 1.3 and were able work fine. Now trying to use api 1.4 . But we are getting 400 as response for Report.Queue method while trying to fetch report. Although same was working well in api 1.3. Need immediate help.
I am using below snippet to connect.

public static String callMethod(String method, String data)
throws IOException {

    String ENDPOINT = prop.getProperty("com.westernunion.tool.rest");
    URL url = new URL(ENDPOINT + "?method=" + method);//method has value Report.Queue
    System.out.println(url);
    URLConnection connection = url.openConnection();

    connection.addRequestProperty("X-WSSE", getHeader());
    connection.setDoOutput(true);

    OutputStreamWriter wr = new OutputStreamWriter(
            connection.getOutputStream());
    wr.write(data);
    wr.flush();

    InputStream in = connection.getInputStream();
    BufferedReader res = new BufferedReader(new InputStreamReader(in,
            "UTF-8"));

    StringBuffer sBuffer = new StringBuffer();
    String inputLine;
    while ((inputLine = res.readLine()) != null)
        sBuffer.append(inputLine);

    res.close();

    return sBuffer.toString();
}

private static String getHeader() throws IOException {
    String USERNAME = prop.getProperty("com.westernunion.tool.username");
    String PASSWORD = prop.getProperty("com.westernunion.tool.pwd");

    StringBuffer wsseHeader = new StringBuffer();

    try {
        SecureRandom rand = new SecureRandom();
        Base64 b64 = new Base64();
        SimpleDateFormat dateFormatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
        String created = dateFormatter.format(new Date());
        ByteArrayOutputStream digest = new ByteArrayOutputStream(40);
        byte[] nonce = new byte[20];
        rand.nextBytes(nonce);
        digest.write(nonce);
        digest.write(created.getBytes());
        digest.write(PASSWORD.getBytes());
        wsseHeader.append("UsernameToken Username=\"");
        wsseHeader.append(USERNAME);
        wsseHeader.append("\", PasswordDigest=\"");
        wsseHeader.append(b64.encodeAsString(toSHA1(digest.toByteArray())));
        wsseHeader.append("\", Nonce=\"");
        wsseHeader.append(b64.encodeAsString(nonce));
        wsseHeader.append("\", Created=\"");
        wsseHeader.append(created);
        wsseHeader.append("\"");
    } catch (IOException e) {
        e.printStackTrace();
    }
    return wsseHeader.toString();

}

private static byte[] toSHA1(byte[] convertme) {
    MessageDigest md = null;
    try {
        md = MessageDigest.getInstance("SHA-1");
    } catch (NoSuchAlgorithmException e) {
        e.printStackTrace();
    }
    return md.digest(convertme);
}

Getting error at line "InputStream in = connection.getInputStream();".

Whatever I do, I keep getting this response.

{
"reportID":1234512345
}

Once you get a reportID, you need to take that response and call Report.Get with that response as the body. Make sure to check the status code of the response of the Report.Get. If you get a 400, check the body for

{
  "error": "report_not_ready",
  "error_description": "Report not ready",
  "error_uri": null
}

If you get that response in the body of the response and the status code of 400, then retry the Report.Get with the same reportID until you get the actual report. One last thing, don't send the Report.Get too fast or you will get rate limited. Send it every few seconds or less depending on how big of a report you are requesting and how many other people/apps are using the API.

I am getting the following error in console, when I try to access above example url, http://adobe-marketing-cloud.github.io/analytics-realtime-dashboard-exam...

Failed to load https://api.omniture.com/admin/1.4/rest/?method=Report.Run: Response for preflight is invalid (redirect)

Facing same issue when run locally after cloning the repo on https://github.com/Adobe-Marketing-Cloud/analytics-realtime-dashboard-ex...

Its strange that I found the above issue (Failed to load https://api.omniture.com/admin/1.4/rest/?method=Report.Run: Response for preflight is invalid (redirect)) only in chrome and not on firefox or safari. Any help is appreciated

Hi,
I would like to get all the URL`s that has been visited in some time period like one week, in the SiteCatalyst is no problem but how to do this in API ?

The eVar33 is the parameter with the Full URL.

{
"reportDescription":{
"reportSuiteID":"rsid",
"dateFrom":"2017-08-01",
"dateTo":"2017-08-02",
"metrics":[{"id":"x-evar33"}]
}
}
But this give me an empty report whit no data, I know that I am doing it wrong :(

Can any one help ? :D

Must be logged in to comment. now to comment!