Expand my Community achievements bar.

Need help in constructing the request body for Reporting API 2.0

Avatar

Level 1

Hi,

 

I was trying to make use of the below API service to get a report from Adobe Warehouse.

https://analytics.adobe.io/api/{companyid}/reports

 The elements I require in this includes some breakdown elemets and some standard elements. PFB the details

Standard Elements : Date Pages Page Type (prop9) Browser Browser Type Mobile Device Type User ID (evar72) Visit Number
Breakdown data based on User : Area (User) Sub area (User) Service Line (User) Sub Service Line (User) Country (User) Rank (User)
Referring Domains Marketing Cloud Visitor ID

Metrics: Page Views

 

I am getting too much confused while I try to create the request body for this API.

My Primary doubt is, if it is possible for this API to return both standard and breakdown data together in a go, or will I have to make multiple calls to get each of the breakdown elements separate?

 

Kindly help me with my queries.

 

Regards,

Anu

2 Replies

Avatar

Community Advisor and Adobe Champion

Here's a little known trick. Workspace uses API 2.0; and they provide a "debugger option".

 

If you build out a report similar to what you need in Workspace, then go to Help > Enable Debugger a new icon will appear on each visualization that looks like a little bug. 

 

When you click on that icon, it will bring up a popup that will show you one or more timestamps (some tables will require multiple API calls). You can then click on each of those timestamps to open up a page which will show you the API calls used in XML, curl and JSON.

 

You can actually copy and use these API calls yourself to retrieve the data.

 

If you can't get exactly what you want in Workspace, this will still be helpful for you to see how the requests are formed, and use them as a base to tweak in order to achieve your desired API request.

 

 

 

Fundamentally, API 2.0 does require multiple calls for breakdown data, this was done to make the API perform better.

 

In the old API 1.4, you could do breakdowns, but as you probably know, you had to send the request into a queue, then you had to keep checking the queue for the report to be done, then you could request the report....

 

In API 2.0, there is no longer the concept of the queue, requests are made and returned directly... so to make sure things run smoothly, they require breakdowns to be run separately.

Avatar

Level 1

I'm not using the Report Endpoint, but perhaps it helps to take a look at the Project endpoint. Since a Project features a superset to Reports this could work for you. This is how we do it:

 

- Create a Project (containing one or more reports) by hand.

- Use the Project endpoint to load the definiton (or whatever you need) to your code 

- Read the returned json + the documentation to find out what you need to replace

- Do the replacement and PUT or POST the project via API