Request for Access token of Sandbox via Postman gets 401 Unauthorized

MMM_Rahul
Contributor
Contributor

I am trying to get access token of PayPal Sandbox environment using Postman.

 

URL: https://api-m.sandbox.paypal.com/v1/oauth2/token

POST

Auth: Basic Auth (with Sandbox user credentials)

Body: x-www-form-urlencoded and added key, value = grant_type, client_credentials

 

After clicking send I am getting 401 Unauthorized response although I can login to https://www.sandbox.paypal.com using same credentials that I used in Basic auth.

{
"error": "invalid_client",
"error_description": "Client Authentication failed"
}
 
 

 

Login to Me Too
1 ACCEPTED SOLUTION

Accepted Solutions
Solved

MTS_Jennifer
Moderator
Moderator

Hello,

Thank you for posting to the PayPal Sandbox Community.

 

The issue may be credentials you are using. This is what I use when I'm testing in Sandbox on Postman:

 

Post to Endpoint: https://api.sandbox.paypal.com/v1/oauth2/token

Authorization is Basic Auth

MTS_Jennifer_0-1614527285282.png

You can obtain your Client ID and Client Secret from logging into the developer dashboard at https://developer.paypal.com

Here are the specific instructions for creating a Rest APP and obtaining your Sandbox Client ID and Client Secret:

https://developer.paypal.com/docs/api/overview/#get-credentials

 

User name is your Sandbox Client ID

Password is your Sandbox Client Secret

 

Body:

 x-www-form-urlencoded

Key: grant_type Value: client_credentials

MTS_Jennifer_1-1614527358667.png

Thank you,

Jennifer

PayPal

 

View solution in original post

Login to Me Too
1 REPLY 1
Solved

MTS_Jennifer
Moderator
Moderator

Hello,

Thank you for posting to the PayPal Sandbox Community.

 

The issue may be credentials you are using. This is what I use when I'm testing in Sandbox on Postman:

 

Post to Endpoint: https://api.sandbox.paypal.com/v1/oauth2/token

Authorization is Basic Auth

MTS_Jennifer_0-1614527285282.png

You can obtain your Client ID and Client Secret from logging into the developer dashboard at https://developer.paypal.com

Here are the specific instructions for creating a Rest APP and obtaining your Sandbox Client ID and Client Secret:

https://developer.paypal.com/docs/api/overview/#get-credentials

 

User name is your Sandbox Client ID

Password is your Sandbox Client Secret

 

Body:

 x-www-form-urlencoded

Key: grant_type Value: client_credentials

MTS_Jennifer_1-1614527358667.png

Thank you,

Jennifer

PayPal

 

Login to Me Too

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.