Receiving Invalid client errors while trying to generate Access Token
Hi, I've been trying to generate an access token for my application.
I only need the publicly available information so I have been trying to use the "client_credentials" OAuth grant type but I keep getting errors and I can't figure out why.
For example if I run:
I get back the following response:
I have also tried using some of the node client libraries that exist, such as "ebay-api" and "ebay-oauth-nodejs-client"
These each return
I just don't know what I am supposed to do here.
I am using my production credentials, I have checked and double checked this, I don't know why I cannot access the API.
doosim-0
Posted 3 years ago·Last reply 3 years ago
8 comments
shipscript
·3 years agoIn your code example, the scope is already URL encoded, but is being URL encoded yet again.
doosim-0
OP3 years agoso if I try:
I get
I think is the url encoded version of
And the developer documentation says that I am suypposed to url encode the scope before calling (https://developer.ebay.com/api-docs/static/oauth-client-credentials-grant.html)
Which is why I encoded it.
But trying it with the unencoded version does not work.
doosim-0
OP3 years agoIf I try using the example request from the dev docs: https://developer.ebay.com/api-docs/static/oauth-client-credentials-grant.html
I get:
I do not know why it views me as an invalid client
shipscript
·3 years agoAre you putting your own data into this header?
This should be your ClientId (AppID) and ClientSecret (CertID) that are joined by a colon, and then that string must be base64 encoded.
doosim-0
OP3 years agoYes, this is what I have done, I did not want to put it on the forum for security reasons
shipscript
·3 years agoAre you using your production credentials with the production endpoint?
I have posted a functional PHP version of the client-credential-based application-token creation that I use in my applications, with curl in longhand:
https://community.ebay.com/t5/Token-Messaging-Sandbox-related/Sample-PHP-for-generating-and-renewing-a-Shopping-token/td-p/33540297
Perhaps that longhand code will help you troubleshoot. Or, if you are using PHP, just grab the code and run with it.
doosim-0
OP3 years agoI am definitely using my production credentials, it seems like ebay has decided I do not have access to the
scope, but when I check the oauth scopes I am supposed to have access to, it is there