question

borimeto-65 avatar image
0 Likes"
borimeto-65 asked

How can I grant my application access so I can call the analytics api?

I have set up a developer account linked to a sub account which is linked to a seller account, and am trying to call the analytics api, but I can't figure out how to get an access token. Having read the documentation, I'm assuming I have to follow the authorization grant flow (not the client credential grant flow), but the documentation is really confusing and suggests that in order for the seller to authorize the developer account app access, I have to send a request and have it approved in real time. The documentation also hints that this can be done via some mysterious Grant Application Access page, but I have no idea where this is, and there are no links anywhere (https://developer.ebay.com/api-docs/static/oauth-consent-request.html#:~:text=About%20user%20consent&text=After%20gaining%20the%20eBay%20user's,the%20user's%20eBay%20account%20data.). There must be some way to give the developer account app one-time access. Could anyone point me in the right direction?

ebay developersaccesstoken
10 |600

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

jitendra_developersupport avatar image
0 Likes"
jitendra_developersupport answered

Hi @borimeto-65,


Getting a user access token is a two-step process where you follow a consent request with an authorization code grant request, to mint a new User access token. Please see all of the steps below:


- You need to construct an HTML request that will redirect the user to your application's Grant Application Access page for a getting user consent.
Ref: https://developer.ebay.com/api-docs/static/oauth-consent-request.html#request


- After successfully getting a user consent, you will get an authorization code returned by the consent request URL. You can use this authorization code for getting a User access token.
Ref: https://developer.ebay.com/api-docs/static/oauth-auth-code-grant-request.html


An user access token is valid for two hours from the time it was generated. For continued access after the token expires, you must mint a new token using the associated refresh token.
Ref: https://developer.ebay.com/api-docs/static/oauth-refresh-token-request.html

You cannot generate a user access token without getting the user consent.


Best regards,
eBay Developer Support

10 |600

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

aminj.a63 avatar image
0 Likes"
aminj.a63 answered

In order to access private Google Analytics data you must use Oauth2. So you don't want to use the API key, what you want to do is use a service account and then authorize the service account service-side, receive and access token from that authorization flow, and then pass that access token to the Embed API.

10 |600

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.