06-10-2024 02:22 AM
Hii Shivam here,
I am facing issues while making an Api call to commerce/notification/v1/subscription Api.
Issues Occurring is not authorized error code 195011, it seems to be my access token hadn't access to related scopes but I'm able to make an API call to /commerce/notification/v1/destination with the same access token.
kindly help me regarding this issue, Thanks in Advance for the help.
06-28-2024 03:44 AM - edited 06-28-2024 08:54 PM
Hello, @ShivamGMSocrates
The error code 195011 indicates that your access token does not have the necessary scopes to call the /commerce/notification/v1/subscription API1. Even though the same token works for /commerce/notification/v1/destination, different endpoints may require different scopes.
Here are some steps to resolve this issue:
Check Required Scopes: Ensure your access token includes the required scopes for the /subscription endpoint. The necessary scope for this endpoint is https://api.ebay.com/oauth/api_scope/commerce.notification.subscription1.
Generate a New Access Token: If your current token lacks the required scope, generate a new access token with the correct scopes. You can do this using either the authorization code grant flow or the client credentials grant flow, depending on your application’s needs2.
Update Your API Call: Use the new access token with the appropriate scopes in your API call to /commerce/notification/v1/subscription.
Here’s a brief example of how to include the scope when generating an access token:
curl -X POST https://api.ebay.com/identity/v1/oauth2/token \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'grant_type=client_credentials&scope=https://api.ebay.com/oauth/api_scope/commerce.notification.subscription' \
-u 'YOUR_CLIENT_ID:YOUR_CLIENT_SECRET'
Hope this work for you.
Best Regard,
rechard563