Problems using web app store connect API

according to

https://developer.apple.com/documentation/appstoreconnectapi/generating_tokens_for_api_requests

Method request will appear

"errors": [{
"status": "403",
"code": "FORBIDDEN",
"title": "Access Unavailable",
"detail": "You currently don't have access to this resource. To resolve this issue, the Account Holder must agree to the latest Program License Agreement in their account on the Apple Developer website. https://developer.apple.com/account"
}]


Sometimes it works


All requests are made according to the specification. Why does this problem arise?


Here are the requested commands and prompts:


error

[root@iZuf6664k2w8x2rxbu4ymgZ ~]# curl -v -H 'Authorization: Bearer eyJhbGciOiJFUzI1NiIsImtpZCI6IkJGN1YzSEFYN1QiLCJ0eXAiOiJKV1QifQ.eyJpc3MiOiIwZDQ0NmVlYS0zODg3LTRiODMtYWExNC0wMWY1NjVjY2Q3MGIiLCJleHAiOjE1ODkyNzYwMDIsImF1ZCI6ImFwcHN0b3JlY29ubmVjdC12MSJ9.WvdpvqLtmv3dYCQPfza19wCALF_X1VWL7KBdh31gavMfto4In0T6g8KSPZ5rPvWYhSg5HZbASBFymcrf9QG36w' "https://api.appstoreconnect.apple.com/v1/apps"
* About to connect() to api.appstoreconnect.apple.com port 443 (#0)
*   Trying 17.56.10.18...
* Connected to api.appstoreconnect.apple.com (17.56.10.18) port 443 (#0)
* Initializing NSS with certpath: sql:/etc/pki/nssdb
*   CAfile: /etc/pki/tls/certs/ca-bundle.crt
  CApath: none
* Server certificate:
* subject: CN=api.appstoreconnect.apple.com,OU=Delivery Site Reliability Engineering,O=Apple Inc.,L=Cupertino,ST=California,C=US,serialNumber=C0806592,incorporationState=California,incorporationCountry=US,businessCategory=Private Organization
* start date: Mar 12 00:00:00 2020 GMT
* expire date: Mar 13 12:00:00 2021 GMT
* common name: api.appstoreconnect.apple.com
* issuer: CN=DigiCert SHA2 Extended Validation Server CA-3,OU=www.digicert.com,O="DigiCert, Inc.",C=US
> GET /v1/apps HTTP/1.1
> User-Agent: curl/7.29.0
> Host: api.appstoreconnect.apple.com
> Accept: */*
> Authorization: Bearer eyJhbGciOiJFUzI1NiIsImtpZCI6IkJGN1YzSEFYN1QiLCJ0eXAiOiJKV1QifQ.eyJpc3MiOiIwZDQ0NmVlYS0zODg3LTRiODMtYWExNC0wMWY1NjVjY2Q3MGIiLCJleHAiOjE1ODkyNzYwMDIsImF1ZCI6ImFwcHN0b3JlY29ubmVjdC12MSJ9.WvdpvqLtmv3dYCQPfza19wCALF_X1VWL7KBdh31gavMfto4In0T6g8KSPZ5rPvWYhSg5HZbASBFymcrf9QG36w
> 
< HTTP/1.1 403 Forbidden
< Server: daiquiri/3.0.0
< Date: Tue, 12 May 2020 09:13:57 GMT
< Content-Type: application/json
< Transfer-Encoding: chunked
< Connection: keep-alive
< Strict-Transport-Security: max-age=31536000; includeSubDomains
< X-Request-ID: 6OSLZEB5AUIFJXLUOXCMYLBBIM
< x-daiquiri-instance: daiquiri:38493002:pv50p00it-hyhk10063901:7987:20F28
< 
{
"errors": [{
"status": "403",
"code": "FORBIDDEN",
"title": "Access Unavailable",
"detail": "You currently don't have access to this resource. To resolve this issue, the Account Holder must agree to the latest Program License Agreement in their account on the Apple Developer website. https://developer.apple.com/account"
}]
}
* Connection #0 to host api.appstoreconnect.apple.com left intact


success

[root@iZuf6664k2w8x2rxbu4ymgZ ~]# curl -v -H 'Authorization: Bearer eyJhbGciOiJFUzI1NiIsImtpZCI6IkJGN1YzSEFYN1QiLCJ0eXAiOiJKV1QifQ.eyJpc3MiOiIwZDQ0NmVlYS0zODg3LTRiODMtYWExNC0wMWY1NjVjY2Q3MGIiLCJleHAiOjE1ODkyNzYwMDIsImF1ZCI6ImFwcHN0b3JlY29ubmVjdC12MSJ9.WvdpvqLtmv3dYCQPfza19wCALF_X1VWL7KBdh31gavMfto4In0T6g8KSPZ5rPvWYhSg5HZbASBFymcrf9QG36w' "https://api.appstoreconnect.apple.com/v1/apps"
* About to connect() to api.appstoreconnect.apple.com port 443 (#0)
*   Trying 17.56.10.18...
* Connected to api.appstoreconnect.apple.com (17.56.10.18) port 443 (#0)
* Initializing NSS with certpath: sql:/etc/pki/nssdb
*   CAfile: /etc/pki/tls/certs/ca-bundle.crt
  CApath: none
* Server certificate:
* subject: CN=api.appstoreconnect.apple.com,OU=Delivery Site Reliability Engineering,O=Apple Inc.,L=Cupertino,ST=California,C=US,serialNumber=C0806592,incorporationState=California,incorporationCountry=US,businessCategory=Private Organization
* start date: Mar 12 00:00:00 2020 GMT
* expire date: Mar 13 12:00:00 2021 GMT
* common name: api.appstoreconnect.apple.com
* issuer: CN=DigiCert SHA2 Extended Validation Server CA-3,OU=www.digicert.com,O="DigiCert, Inc.",C=US
> GET /v1/apps HTTP/1.1
> User-Agent: curl/7.29.0
> Host: api.appstoreconnect.apple.com
> Accept: */*
> Authorization: Bearer eyJhbGciOiJFUzI1NiIsImtpZCI6IkJGN1YzSEFYN1QiLCJ0eXAiOiJKV1QifQ.eyJpc3MiOiIwZDQ0NmVlYS0zODg3LTRiODMtYWExNC0wMWY1NjVjY2Q3MGIiLCJleHAiOjE1ODkyNzYwMDIsImF1ZCI6ImFwcHN0b3JlY29ubmVjdC12MSJ9.WvdpvqLtmv3dYCQPfza19wCALF_X1VWL7KBdh31gavMfto4In0T6g8KSPZ5rPvWYhSg5HZbASBFymcrf9QG36w
> 
< HTTP/1.1 200 OK
< Server: daiquiri/3.0.0
< Date: Tue, 12 May 2020 09:14:02 GMT
< Content-Type: application/json
< Content-Length: 177
< Connection: keep-alive
< b3: de32e16529cba0bdc209c91efb87eb97-85b2792a8cea7565
< x-b3-traceid: de32e16529cba0bdc209c91efb87eb97
< x-b3-spanid: 85b2792a8cea7565
< Cache-Control: no-cache,no-store,must-revalidate
< Pragma: no-cache
< Expires: 0
< Vary: Accept-Encoding, User-Agent
< Strict-Transport-Security: max-age=31536000; includeSubDomains
< X-Request-ID: 3YZOCZJJZOQL3QQJZEPPXB7LS4
< X-Rate-Limit: user-hour-lim:3600;user-hour-rem:3599;
< x-daiquiri-instance: daiquiri:38493002:pv50p00it-hyhk10063901:7987:20F28
< 
{
  "data" : [ ],
  "links" : {
    "self" : "https://api.appstoreconnect.apple.com/v1/apps"
  },
  "meta" : {
    "paging" : {
      "total" : 0,
      "limit" : 50
    }
  }
* Connection #0 to host api.appstoreconnect.apple.com left intact


It's the same signature token, which bothers me a lot.

Replies

I have the same issue. https://developer.apple.com/forums/thread/132819