question

elborodac0 avatar image
0 Likes"
elborodac0 asked ·

unable to use getMerchandisedProducts according to authenitication issue

Hi All, I believe the problem is something related to token issues. If I understood correctly, there are several types of tokens - and I am completely confused, here is my code: > from requests import get, post > > category_id = "11071" # TVs > > url = > f" https://api.ebay.com/buy/marketing/v1_beta/merchandised_product?metric_name=BEST_SELLING&category_id={category_id}&limit=100"; > > > postman_headers = { > "Content-Type": "application/x-www-form-urlencoded", > "Authorization" : "Bearer " + token, } > > response = get(url, headers = > postman_headers) > print(response.content) However, it returns me: > b'{"errors":[{"errorId":1100,"domain":"ACCESS","category":"REQUEST","message":"Access > denied","longMessage":"Insufficient > permissions to fulfill the > request."}]}' Can someone point me what I am supposed to do? Clear instructions will be very helpful. I had also tried to go to "The client credentials grant flow", but eventually it resulted in a dead end. Thanks in advance,
tokensgetmerchandisedproducts
10 |600 characters needed characters left characters exceeded

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

1 Answer

· Write an Answer
davdevelope_0 avatar image
0 Likes"
davdevelope_0 answered ·
@elborodac0, Basically, there are two types of OAuth tokens, App tokens and User tokens. The documentation for getMerchandisedProducts say you need to use a token created with the "client credentials grant", which is the same as a User token. Creating a User token is a multi-step process, and you have to be sure that you include the correct set of scopes when you create your token, otherwise you won't have the correct permissions to make the call. HTH,
· Share
10 |600 characters needed characters left characters exceeded

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.