Avatar

Level 1

Hi all,

we want to call the Analytics API 2.0 from our Java application. Therefor we generate an JWT token and with that JWT token an access token in Java. We used this tutorial:  https://www.adobe.io/authentication/auth-methods.html#!adobeio/adobeio-documentation/master/auth/JWT...  https://www.adobe.io/authentication/auth-methods.html#!adobeio/adobeio-documentation/master/auth/JWT...

Now we try to get a report from Analytics API with this access token but we always get the following error:

{"errorCode":"invalid_token","errorDescription":"User associated with ims token could not be found or company not found.","errorId":"auth-xxxx-xxxx"}

In case we use an access token generated with OAuth (and user credentials), the request to the /reports endpoint works well. We couldn't find a way to generate an OAuth access token programmatically without manually login at Adobe. So we used the JWT Token in Java.

We use the Analytics API 2.0: https://adobedocs.github.io/analytics-2.0-apis/ and want to use the /reports endpoint.

Is there a way to automatically generate an access token to authenticate with api 2.0 and do a reports request?

Thanks a lot

Tobias