Get Analytics report from java | Community
Skip to main content
Level 7
February 15, 2024
Solved

Get Analytics report from java

  • February 15, 2024
  • 1 reply
  • 896 views

Hello Team,

 

Anyone tried to call the Analytics 2.0 API from java application?

https://github.com/AdobeDocs/analytics-2.0-apis/blob/master/reporting-guide.md

I tried this website. Now, I am able to hit this API from postman by passing all the necessary information.

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

 But, when I tried to hit the API from java, I am getting only 400 response. No, other information.

 

Can someone provide me some information?

Thanks

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by EstebanBustamante

Hi, 


If you were able to make the call from Postman there is no reason why you should not be able to call the API from Java. You just need to make sure to include all the required headers as part of the http request. 

Headers:

'Accept: application/json' 'Authorization: Bearer {ACCESSTOKEN}' 'Content-Type: application/json' 'x-api-key: {APIKEY}' 'x-proxy-global-company-id: {COMPANYID}'

Additionally, according to the documentation https://adobedocs.github.io/analytics-2.0-apis/#/Reports/runReport  if you get a 400 error might be related to: 

 

Hope this helps

1 reply

EstebanBustamante
Community Advisor and Adobe Champion
EstebanBustamanteCommunity Advisor and Adobe ChampionAccepted solution
Community Advisor and Adobe Champion
February 16, 2024

Hi, 


If you were able to make the call from Postman there is no reason why you should not be able to call the API from Java. You just need to make sure to include all the required headers as part of the http request. 

Headers:

'Accept: application/json' 'Authorization: Bearer {ACCESSTOKEN}' 'Content-Type: application/json' 'x-api-key: {APIKEY}' 'x-proxy-global-company-id: {COMPANYID}'

Additionally, according to the documentation https://adobedocs.github.io/analytics-2.0-apis/#/Reports/runReport  if you get a 400 error might be related to: 

 

Hope this helps

Esteban Bustamante
Level 7
February 19, 2024

Hi @estebanbustamante 

 

Thanks for your reply. My bad. input was not proper. There was some syntax issue. Earlier I was not able to get the error. Now, I was getting the error message. Fixed the issue. 

 

- Thanks