Get Analytics report from java | Adobe Higher Education
Skip to main content
Level 7
February 15, 2024
Répondu

Get Analytics report from java

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

Ce sujet a été fermé aux réponses.
Meilleure réponse par 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 commentaire

EstebanBustamante
Community Advisor and Adobe Champion
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