You will need the requests
and authlib
packages. Just run :
$ pip install requests authlib
Then you need to generate an API Key from the App Store Connect portal (https://developer.apple.com/documentation/appstoreconnectapi/creating_api_keys_for_app_store_connect_api).
In the Python code below, replace the values of KEY_ID
, ISSUER_ID
and PATH_TO_KEY
with your own.
You can change the URL of the request you want to make with the URL
variable.
Finally, if you have some query parameters to pass in, use the params
parameter of requests.get()
(or requests.post()
).
Thank you very much for the sample code, I rewrote this sample with Applaud:
Applaud handles the details of JWT, you don't have to worry about expiration time. You can find the fork here: How to connect to the App Store Connect API using Python3 and Applaud