cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How can I get Authorization Code for API programmatically?

I have recently joined eBay and signed up a developer account. I want to integrate eBay APIs to my PHP Laravel Website. I need access token to call different APIs and to get an access token first I need to get an authorization code which will be provided in next API call to get an access code. I see there is an option to get authorization code where Application Keys are, by creating a user and giving consent to login to my application, which returns authorization code. But I want to do that programmatically as I am a developer and I want some way like an API where I can get authorization code. I did not find it in documentation. I don't know if I am missing something here. Is there some Postman Collection with these calls?

There are OAuth client libraries for Android, C#, Java, Node.js and Python but none can be found for PHP.

Following is the link of doc I am following:

https://developer.ebay.com/api-docs/static/oauth-authorization-code-grant.html

 

Message 1 of 2
latest reply
1 BEST ANSWER

Accepted Solutions

Re: How can I get Authorization Code for API programmatically?

No, it's not possible to generate the authorization code grant token without obtaining user consent. You must secure the user's consent at least once because generating a user access token is contingent upon it.

For further details, please consult the API documentation here:

https://developer.ebay.com/api-docs/static/oauth-auth-code-grant-request.html

The authorization code grant process yields a refresh_token, which has a lengthy lifespan. You can utilize this token to renew an expired user access token, eliminating the need to repeatedly seek the user's consent for a new token. Simply store the refresh_token for future use.

For a comprehensive understanding, delve into the Refresh Token API documentation:

https://developer.ebay.com/api-docs/static/oauth-refresh-token-request.html

Credits:

https://developer.ebay.com/support/kb-article?KBid=5220

View Best Answer in original post

Message 2 of 2
latest reply
1 REPLY 1

Re: How can I get Authorization Code for API programmatically?

No, it's not possible to generate the authorization code grant token without obtaining user consent. You must secure the user's consent at least once because generating a user access token is contingent upon it.

For further details, please consult the API documentation here:

https://developer.ebay.com/api-docs/static/oauth-auth-code-grant-request.html

The authorization code grant process yields a refresh_token, which has a lengthy lifespan. You can utilize this token to renew an expired user access token, eliminating the need to repeatedly seek the user's consent for a new token. Simply store the refresh_token for future use.

For a comprehensive understanding, delve into the Refresh Token API documentation:

https://developer.ebay.com/api-docs/static/oauth-refresh-token-request.html

Credits:

https://developer.ebay.com/support/kb-article?KBid=5220

Message 2 of 2
latest reply