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

Curl 为什么即使请求成功,我仍会使用Paypal搜索发票API收到身份验证失败错误?,curl,paypal,paypal-sandbox,Curl,Paypal,Paypal Sandbox,我使用Paypal Search Invoices API发出了一个成功的请求,该API按预期返回发票详细信息 我还想查看该发票上的明细(项目)。我相信这样做的方法是在请求的fields参数中指定“items”,这将返回一个csv,我可以访问该csv来使用该数据 但是,尽管请求成功,但为发票提供的URL(我假定是csv所在的位置)存在以下错误: {"name":"AUTHENTICATION_FAILURE","message":&qu

我使用Paypal Search Invoices API发出了一个成功的请求,该API按预期返回发票详细信息

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

但是,尽管请求成功,但为发票提供的URL(我假定是csv所在的位置)存在以下错误:

{"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
*找到主机api.paypal.com的捆绑包:0x7f830c4705b0[can管道]
*可以管道,但不要求!
*重新使用现有连接!(#97)与主机api.paypal.com
*连接到api.paypal.com(66.211.168.123)端口443(#97)
>POST/v2/发票开具/搜索发票HTTP/1.1
主持人:api.paypal.com
用户代理:RStudio桌面(1.2.5033);R(3.6.3 x86_64-apple-darwin15.6.0 x86_64-darwin15.6.0)
接受:*/*
接受编码:deflate,gzip
内容类型:application/json
授权:持有人u8fdhifdsaamh7sasajkdas1c0lyt6htmidurbr6eam2wn9inc2fx4-eQ7J6GlLHTrwNuQ_asdjkasdi2n9huee4rtxxhcwq4fjkamw3au-Gw
内容长度:162
*上传完全发送:162字节中的162字节