Showing results for 
Search instead for 
Did you mean: 

Paypal bearer token key doesn't work in curl cli


Paypal bearer token key doesn't work in curl cli

I am integrating paypal with website, so testing sandbox accounts.


curl -v \
-H "Accept: application/json" \
-H "Accept-Language: en_US" \
-u "client_id:secret" \
-d "grant_type=client_credentials"


So I got this response.


{"scope":"***/refund openid",

So I tried to get invoice list using this access token like this.


curl -v -X GET \
-H "Content-Type: application/json" \
-H "Authorization: Bearer A21AAEfztNgn--7s73LnfG_YnpfR93XQHrB1vOaUJp0tYfhA3J7y_wb8Zj8fMna9SSimQ1Pdhf9bdacR1CmiYNcZn7RS164nA"

But it didn't work, only returned authorization error.

< HTTP/1.1 401 Unauthorized
< Date: Wed, 09 Jan 2019 05:30:32 GMT
< Server: Apache
< paypal-debug-id: 7aa8ce0862f88
< HTTP_X_PP_AZ_LOCATOR: sandbox.slc
< Paypal-Debug-Id: 7aa8ce0862f88
< Set-Cookie: X-PP-SILOVER=name%3DSANDBOX3.API.1%26silo_version%3D1880%26app%3Dapiplatformproxyserv%26TIME%3D4169545052%26HTTP_X_PP_AZ_LOCATOR%3Dsandbox.slc; Expires=Wed, 09 Jan 2019 06:00:32 GMT;; path=/; Secure; HttpOnly
< Set-Cookie: X-PP-SILOVER=; Expires=Thu, 01 Jan 1970 00:00:01 GMT
< Content-Length: 244
< Connection: close
< Content-Type: application/json
* Closing connection 0
* TLSv1.2 (OUT), TLS alert, Client hello (1):
{"name":"AUTHENTICATION_FAILURE","message":"Authentication failed due to invalid authentication credentials or a missing Authorization header.","links":[{"href":"","rel":"information_link"}

I tried several times, but was same all the time ~
Please let me know the reason of this.
Thank you.