为什么即使请求成功,我仍会使用Paypal搜索发票API收到身份验证失败错误?

问题描述

我使用Paypal搜索发票API成功发出了请求,该API会按预期返回发票详细信息。

我还想访问该发票上的明细(项目)。我相信这样做的方法是在请求的fields参数中指定“ items”,这将返回一个我可以访问以使用此数据的csv。

但是,尽管请求成功,但是给发票的URL(我想是csv所在的URL)具有以下错误

{"name":"AUTHENTICATION_FAILURE","message":"Authentication Failed due to invalid authentication credentials or a missing Authorization header.","links":[{"href":"https://developer.paypal.com/docs/apI/Overview/#error","rel":"information_link"}]}

这是为什么?这是我的请求的详细输出

* Found bundle for host api.paypal.com: 0x7f830c4705b0 [can pipeline]
* Could pipeline,but not asked to!
* Re-using existing connection! (#97) with host api.paypal.com
* Connected to api.paypal.com (66.211.168.123) port 443 (#97)
> POST /v2/invoicing/search-invoices HTTP/1.1
Host: api.paypal.com
User-Agent: RStudio Desktop (1.2.5033); R (3.6.3 x86_64-apple-darwin15.6.0 x86_64 darwin15.6.0)
Accept: */*
Accept-Encoding: deflate,gzip
Content-Type: application/json
Authorization: Bearer U8FDHIFDSAAMH7SADSAJKDAS1c0lYT6HTMIdurbR6eAm2wN9Inc2fvx4-eQ7J6GlLHTrwNuQ_ASDJKASDASDI2n9hUEe4RTXxHcwQ4FJKamW3aU-Gw
Content-Length: 162

* upload completely sent off: 162 out of 162 bytes
< HTTP/1.1 200 OK
< Content-Type: application/json
< Content-Length: 1099
< Connection: keep-alive
< Date: Thu,29 Oct 2020 10:05:22 GMT
< Application_id: APP-2003423JKSDF
< Cache-Control: max-age=0,no-cache,no-store,must-revalidate
< Caller_acct_num: JDSF8923432
< Paypal-Debug-Id: 52be0907c553d
< Strict-Transport-Security: max-age=31536000; includeSubDomains
< 
* Connection #97 to host api.paypal.com left intact

解决方法

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

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

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