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
Solved! Go to Solution.
Topics help categorize Community content and increase your ability to discover relevant content.
Views
Replies
Total Likes
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:
(This will refresh the page)
You will now see a new icon on your tables:
Clicking on this will bring up 2 options, one for the table data, and one for the sparkline... you want the table
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)
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.
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:
(This will refresh the page)
You will now see a new icon on your tables:
Clicking on this will bring up 2 options, one for the table data, and one for the sparkline... you want the table
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)
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.
Thank you so much Jennifer for your help. This worked very nicely and I was able to see the data.
Glad I was able to help
Views
Replies
Total Likes
Views
Likes
Replies