Expand my Community achievements bar.

Join us January 15th for an AMA with Champion Achaia Walton, who will be talking about her article on Event-Based Reporting and Measuring Content Groups!
SOLVED

Need help with /reports API in CJA

Avatar

Level 1

I am new to Adobe CJA  API and my team wants to fetch the top viewed page with the exact number of views using reports API: https://developer.adobe.com/cja-apis/docs/api/#tag/Reporting-API. My team has already created a Adobe CJA Workspace project for the same. I was able to make connection and get the data from https://cja.adobe.io/reports/topItems for the pageviews but it only provides the page URL without the number of views. I tried /reports API but somehow https://cja.adobe.io/reports doesn't work for me and give me below error:

{
"errorCode": "invalid_json_input",
"errorDescription": "Invalid JSON. At least one field format is not recognized or cannot be parsed. - Error caused by exceptionMessage=HTTP 400 Bad Request - Locale { not suported",
"errorId": "77216d89-c8d8-4649-a077-1de9a978040f"
}

 

Can someone help me here with the value that needs to be given inside the body parameters for fetching the pageviews metric with the views number or explain me how to debug the error? Currently I am giving the exact body parameters provided in the request sample https://developer.adobe.com/cja-apis/docs/api/#tag/Reporting-API

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor and Adobe Champion

This error sounds like you might have set up your API call with an incorrect value in one of the fields...

 

Both AA and CJA workspace are built using the API... and a little known feature is that you can see the actual API calls that are being made for your Workspace reports, by comparing the API call for the workspace (which has a lot more info including table details), you might be able to figure out what part of your API call has issues.

 

 

First, you need to enable the debugger:

Jennifer_Dungan_0-1731687667615.png

 

(This will refresh the page)

 

 

You will now see a new icon on your tables:

Jennifer_Dungan_1-1731687732213.png

 

 

Clicking on this will bring up 2 options, one for the table data, and one for the sparkline... you want the table

Jennifer_Dungan_2-1731687789985.png

 

 

For every run that has happened since the report was loaded, you will have a timestamp... now some complex tables actually have multiple API calls, but in a simple Page Name and Page View table, only one is needed (I have two here, one for the initial run when I added page views, and the second when I changed the dimension to Page Name)

Jennifer_Dungan_3-1731687930941.png

 

 

Choose the timestamp you want to look at, and it will open a new screen with the APIs in XML, Curl and JSON formatting.

 

Since you are using JSON, that would be the best place to compare against.

 

 

If you also want to share your current JSON here (removing specifics for privacy reasons), we can also take a look and see if we can identify the problem.

View solution in original post

3 Replies

Avatar

Correct answer by
Community Advisor and Adobe Champion

This error sounds like you might have set up your API call with an incorrect value in one of the fields...

 

Both AA and CJA workspace are built using the API... and a little known feature is that you can see the actual API calls that are being made for your Workspace reports, by comparing the API call for the workspace (which has a lot more info including table details), you might be able to figure out what part of your API call has issues.

 

 

First, you need to enable the debugger:

Jennifer_Dungan_0-1731687667615.png

 

(This will refresh the page)

 

 

You will now see a new icon on your tables:

Jennifer_Dungan_1-1731687732213.png

 

 

Clicking on this will bring up 2 options, one for the table data, and one for the sparkline... you want the table

Jennifer_Dungan_2-1731687789985.png

 

 

For every run that has happened since the report was loaded, you will have a timestamp... now some complex tables actually have multiple API calls, but in a simple Page Name and Page View table, only one is needed (I have two here, one for the initial run when I added page views, and the second when I changed the dimension to Page Name)

Jennifer_Dungan_3-1731687930941.png

 

 

Choose the timestamp you want to look at, and it will open a new screen with the APIs in XML, Curl and JSON formatting.

 

Since you are using JSON, that would be the best place to compare against.

 

 

If you also want to share your current JSON here (removing specifics for privacy reasons), we can also take a look and see if we can identify the problem.

Avatar

Level 1

Thank you so much Jennifer for your help. This worked very nicely and I was able to see the data.

Avatar

Community Advisor and Adobe Champion

Glad I was able to help