Why do I get 401 Unauthorised error when calling Get user info API?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I was following this guide to integrate the "Login with PayPal" button on our website: https://developer.paypal.com/docs/log-in-with-paypal/integrate/.
However, I ran into an issue at step 5: "Get customer info." The API returned a 401 Unauthorized status code, even though I used the access token provided by the token service endpoint in step 4.
Does anyone know why this might be happening or how to resolve it?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm encountering the same issue.
I've implemented the OAuth flow in the sandbox environment and successfully obtain an access token, but when I immediately try to call the v1/identity/openidconnect/userinfo endpoint, I receive a 401 Unauthorized error with an empty response body.
Interestingly, I've noticed that this error only occurs when using Business sandbox test accounts. When I test with Personal sandbox accounts, I can retrieve the user information without any problems.
Has anyone observed this behavior specific to Business accounts? If this might be a separate issue, I'd be happy to create a new topic for discussion. Thanks!

Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
- Help with error saying API call is initiated is not allowed to vault the given source. in REST APIs
- Getting an error when calling API endpoint for Create Billing Agreement Token V1 in Sandbox Environment
- paypal.ApplePay().confirmOrder() returns applepay_payment_error. in SDKs
- v2/vault/payment-tokens API 403 Forbidden Error - Insufficient permission issue in REST APIs
- Getting "Invalid Transaction Type" Error When Calling Payflow Gateway API in Payflow