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

can't add scopes to for my oauth token

so i have this code thats works 

```python

encoded_credentials = base64.b64encode(f'{appid_}:{certid_}'.encode()).decode()

data = {
    'grant_type': 'client_credentials',
}

print(data['scope'])

headers = {
    'Content-Type': 'application/x-www-form-urlencoded',
    'Authorization': f'Basic {encoded_credentials}'
}

response = requests.post(url, data=data, headers=headers)
print(response)
# Extract access token from response
token_ = response.json()['access_token']
 

```

 

 

but the problem is, when i try to add more scopes like https://api.ebay.com/oauth/api_scope/sell.marketing.readonly or https://api.ebay.com/oauth/api_scope/sell.inventory.readonly

 

i get the Response: 400 (bad request)

 

so i really don't know how to do that

Message 1 of 2
latest reply
1 REPLY 1

can't add scopes to for my oauth token

@pado4821 

 

https://developer.ebay.com/api-docs/static/oauth-scopes.html

 

eBay has two types of authorizations:

 

  1.  Client credentials—gives your client application a token to request publicly available data from eBay. Client Credentials have limited use on the site, since the publicly available data has a limited scope.
     
  2.  Authorization code—grants access to a specific user's private data via a user-approved token. An Authorization code has a broader array of scopes (varying degrees of limited access) to a user's private data.
     

https://developer.ebay.com/api-docs/static/oauth-scopes.html#Getting

A private user-based scope can not be applied to public Client credentials.

I believe multiple scopes are space delimited:

'scope':'value1 value2 value3'

But make sure that the scope you want to add is valid for the API call.

 

The developer forums are here:

https://community.ebay.com/t5/Developer-Groups/ct-p/developergroup

 

 

ShipScript has been an eBay Community volunteer since 2003, specializing in HTML, CSS, Scripts, Photos, Active Content, Technical Solutions, and online Seller Tools.
Message 2 of 2
latest reply