为什么我会收到PayPal API授权错误?

问题描述

首先,我使用以下命令授权:

curl -v https://api.sandBox.paypal.com/v1/oauth2/token \
   -H "Accept: application/json" \
   -H "Accept-Language: en_US" \
   -u "client_id:secret" \
   -d "grant_type=client_credentials"

然后我获得访问令牌。使用访问令牌,我运行以下命令:

curl -v -X GET https://api.sandBox.paypal.com/v1/invoicing/invoices?page=1 \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer MY_TOKEN"

但是我得到了错误

{"name":"AUTHORIZATION_ERROR","message":"Authorization error occurred.","information_link":"https://developer.paypal.com/docs/api/invoicing/#errors","debug_id":"75bc8ac7b89e1"}

任何想法为何?大多数命令给我同样的错误。但是此命令可以正常工作:

curl -v -X POST https://api.sandBox.paypal.com/v2/checkout/orders \
-H "Content-Type: application/json" \
-H "Authorization: Bearer MY-TOKEN" \
-d '{
  "intent": "CAPTURE","purchase_units": [
    {
      "amount": {
        "currency_code": "USD","value": "100.00"
      }
    }
  ]
}'

任何想法,我在这里想念的是什么? 谢谢,谢谢。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)