App Store Connect API

RSS for tag

The App Store Connect API helps you automate tasks usually done on the Apple Developer website and App Store Connect.

App Store Connect API Documentation

Post

Replies

Boosts

Views

Activity

App store connect API returns 401
Hello, following the practices use on: https://developer.apple.com/documentation/appstoreconnectapi/generating_tokens_for_api_requests I used Python, and uses pyjwt and request library in attempt of making requests I created my jwt header and payload like this jwt_header = { "alg": "ES256", "kid": MY_KEY_ID, "typ": "JWT" } jwt_payload = { "iss": MY_ISSUER_NUMBER, "iat": time_now, "exp": time_10_min, "aud": "appstoreconnect-v1" } and jwt can encode successfully without error jwt_token = jwt.encode(jwt_payload, MY_SECRET_KEY, algorithm="ES256", headers= jwt_header) but really when I try to make a get request with get_app_id_endpoint = "https://api.appstoreconnect.apple.com/v1/apps" headers = { 'Authorization': f'Bearer {jwt_token}', 'Content-Type': 'application/json' } response = requests.get(get_app_id_endpoint, headers=headers) it always gets a 401 response. Is there anything that need to be changed here? I have tried sosme of the solutions found online such as take out "alg" field in jwt_header take out "iat" field in jwt_payload cast time_now and time_10_min (UNIX epoch time) to integer take out Content-Type filed in headers but issue remains, what could I possible do here to get over it?
5
2
752
Oct ’23
How to set desired price-points efficiently (API is sub-optimal and slow!)?
Hi, I am setting manual price-points for in-app purchases using API. Currently the procedure is extremly slow because to set the desired price-point like $4.99 I have to find it's ID, so I have to pull all price points for the specified territory to find price-point ID. What makes things even worser price-points can't be shared between in-app purchases, I mean the price-point of $4.99 in USA has different IDs for different in-app purchases. So changing prices for all in-app purchases and 50 countries takes a lot of time because each request is 2+ seconds. Besides from time to time the API returns 500 Internal Server Error :( Did I overlook something?
0
0
276
Nov ’23
[App Store Connect API] Failed to list sandbox testers and clear purchase history by 403 forbidden error
When attempting to list sandbox testers and clear purchase history through the App Store Connect API, the API Server returns a 403 forbidden error. I have set a correct token in the Authorization header, allowing me to list apps, users and bundleIds. Furthermore, I was able to list sandbox testers and clear purchase history successfully until two weeks ago. OK https://api.appstoreconnect.apple.com/v1/apps https://api.appstoreconnect.apple.com/v1/users https://api.appstoreconnect.apple.com/v1/bundleIds NG https://developer.apple.com/documentation/appstoreconnectapi/list_sandbox_testers https://developer.apple.com/documentation/appstoreconnectapi/clear_purchase_history_for_a_sandbox_tester use expired token { "errors": [ { "status": "401", "code": "NOT_AUTHORIZED", "title": "Authentication credentials are missing or invalid.", "detail": "Provide a properly configured and signed bearer token, and make sure that it has not expired. Learn more about Generating Tokens for API Requests https://developer.apple.com/go/?id=api-generating-tokens" } ] } use not expired token { "servlet": "jersey", "message": "Forbidden", "url": "/iris/v2/sandboxTesters", "status": "403" }
1
1
522
Nov ’23
Register device unexpected status
When we use register api to register our device, I got response that status is PROCESSING/INELIGIBLE why? response like: { "type": "devices", "id": "XXXXX", "attributes": { "addedDate": "2022-04-20T22:57:51.000+00:00", "name": "XXXXX", "deviceClass": "IPHONE", "model": "iPhone 13 Pro Max", "udid": "XXXXXXXXXXXXXX", "platform": "IOS", "status": "PROCESSING" }, "links": { "self": "https://api.appstoreconnect.apple.com/v1/devices/***" } }
7
2
3.3k
Apr ’22
Fetch total number of app downloads or installs counts using API.
Hello everyone, My question is how we can fetch our own apple apps download counts using API. I want to create code which will fetch total number of app downloads or installs of my app. Is there any way to to get this data using API or any other official method. Own app download counts data [since app uploaded - today's date]. Thank you.
4
1
12k
Jun ’21
All attempts to upload .ipa via iTMSTransporter failing with error in validateAssets method (1272)
We publish many apps using our CI/CD system that makes use of the App Store Connect API and iTMSTransporter. Since around 9:00am on 19 Oct 2023 (Melbourne/Australia time UTC+10), all our attempts to upload our .ipa files using iTMSTransporter began failing. The specific command line invocation is: /usr/local/itms/bin/iTMSTransporter -m upload -v eXtreme -f "/path/to/Bundle.itmsp" -jwt {jwt-here} The error is occurring in the midst of the upload with the error message: Apple's web service operation return value: [2023-10-20 09:35:09 AEDT] <main> DBG-X: parameter Errors = [An error occurred while trying to call the requested method validateAssets. (1272)] [2023-10-20 09:35:09 AEDT] <main> DBG-X: parameter RestartClient = false [2023-10-20 09:35:09 AEDT] <main> DBG-X: parameter ErrorCode = 1272 [2023-10-20 09:35:09 AEDT] <main> DBG-X: parameter ErrorMessage = An error occurred while trying to call the requested method validateAssets. (1272) [2023-10-20 09:35:09 AEDT] <main> DBG-X: parameter Success = false [2023-10-20 09:35:09 AEDT] <main> ERROR: An error occurred while trying to call the requested method validateAssets. (1272) [2023-10-20 09:35:09 AEDT] <main> DBG-X: The error code is: 1272 Is anyone else experiencing this issue? Is there any kind of work around or something we need to change? Some other notes: The same .ipa files can be successfully uploaded manually using Transporter This is affecting apps built against both XCode 14 and XCode 15 There was an outage shown on Apple's system status for a few hours that overlaps with this period, but Apple claim it was resolved 22 hours ago 🙃
2
0
500
Oct ’23
JWT token is getting rejected with error "Provide a properly configured and signed bearer token, and make sure that it has not expired."
I am trying to make an api call using a JWT token generated using App store connect api key. The token is rejected with the following error: "errors": [ { "status": "401", "code": "NOT_AUTHORIZED", "title": "Authentication credentials are missing or invalid.", "detail": "Provide a properly configured and signed bearer token, and make sure that it has not expired. Learn more about Generating Tokens for API Requests https://developer.apple.com/go/?id=api-generating-tokens" } ] My header and payload are as follow: Header { "alg": "ES256", "kid": "<MY_KEY_ID>", "typ": "JWT" } Payload { "iss": "<MY_ISSUER_ID>", "aud": "appstoreconnect-v1", "iat": 1698333493, "exp": 1698333793 } I am unable to find what is wrong with my token. Can someone help me with this?
1
0
573
Oct ’23
"Request Access to the App Store Connect API" dialog box is broken
I'm trying to set up Keys for the App Store Connect API. The website first makes you acknowledge a 'terms and conditions' type dialog, but the dialog seems to be broken. The submit button spins forever and the browser console shows an error. I've tried on all the browsers, desktop and mobile, and it's the same behavior. Can someone help me get past this dialog box so I can access the Keys section of the site?
15
6
965
Oct ’23
How to Programmatically Use the AirPrint API for Single-Side Printing in iOS 17
Hey, fellow iOS developers! I'm working on an app for iOS 17 and need to implement single-side printing using the AirPrint API. I've done some research, but I'm still facing a few challenges. Can anyone provide guidance or share some sample code to achieve this? I've already imported the UIKit and MobileCoreServices frameworks and have set up the basic AirPrint functionality. Now, I'm looking specifically for instructions and code to enable single-sided printing. URL - https://www.controlf5.in/ Test code `**import UIKit import MobileCoreServices // Set up AirPrint functionality func printDocument() { let printController = UIPrintInteractionController.shared let printInfo = UIPrintInfo(dictionary: nil) printInfo.outputType = .general printController.printInfo = printInfo let formatter = UIMarkupTextPrintFormatter(markupText: "Your printable content goes here") formatter.perPageContentInsets = UIEdgeInsets(top: 36, left: 36, bottom: 36, right: 36) printController.printFormatter = formatter printController.present(animated: true) { (controller, success, error) in if success { print("Printing completed successfully") } else if let error = error { print("Printing failed with error: \(error.localizedDescription)") } } }**`
1
0
679
Oct ’23
Getting 401 when generating JWT token to call App Store Connect API
This is my code: import jwt from 'jsonwebtoken' import path from 'path' import fs from 'fs' // You get privateKey, apiKeyId and issuerId from your Apple App Store Connect account const filePath = path.resolve( __dirname, <PATH_TO_PRIVATE_KEY> ) const privateKey = fs.readFileSync(filePath) // this is the file you can only download once and should treat like a real, very precious key. const apiKeyId = <API_KEY_ID> const issuerId = <ISSUER_ID> let payload = { "iss": issuerId, "aud": "appstoreconnect-v1" } let token = jwt.sign(payload, privateKey, { algorithm: 'ES256', expiresIn: '60m', header: { alg: 'ES256', kid: apiKeyId, typ: 'JWT', } }); console.log('@token: ', token); // Congrats! the token printed can now be tested with the curl command below // curl -v https://api.appstoreconnect.apple.com/v1/apps --Header "Authorization: Bearer <YOUR TOKEN>" I ran this script to test the token and call the GET curl like this, but still got 401 unauthorized. curl -v https://api.appstoreconnect.apple.com/v1/apps --Header "Authorization: Bearer <token>" This is the the error text: text: '{\n' + '\t"errors": [{\n' + '\t\t"status": "401",\n' + '\t\t"code": "NOT_AUTHORIZED",\n' + '\t\t"title": "Authentication credentials are missing or invalid.",\n' + '\t\t"detail": "Provide a properly configured and signed bearer token, and make sure that it has not expired. Learn more about Generating Tokens for API Requests https://developer.apple.com/go/?id=api-generating-tokens"\n' + '\t}]\n' + '}', I used jwt.io to verify that the token has valid expiration date. The decoded token from jwt.io gives me these info: payload: { "iss": <ISSUER_ID>, "iat": 1696812284, "exp": 1696815884, // an hour from the issued at time "aud": "appstoreconnect-v1" } header: { "alg": "ES256", "typ": "JWT", "kid": <API_KEY_ID> } I am not so sure what can cause this 401 Unauthorized error.
3
1
879
Oct ’23
Is there a way to download payments data programmatically from App Store Connect?
I see that it's currently possible to report payments and tax information manually from the App Store Connect user interface, per the 'View Payment Information' section of the App Store Connect help documentation. Is there any way to retrieve this information programmatically, either via the REST API or the Reporter command line tool? The 'Finance' reports that are available through the developer tools show developer proceeds in the original currency of the transaction, not in the developer's currency post-conversion. Without currency conversion and tax information, the 'Finance' reports are not particularly useful for accounting purposes.
17
5
10k
Nov ’18
Getting "List All Customer Reviews for an App" response without text in the body field
Hello! I've been wanting to capture review data from my app in AppStore, and have managed to do so using the List All Customer Reviews for an App endpoint. However, it looks like this endpoint only sends review data from reviews where the user wrote something in the text box. Is there any way i can also retrieve data from reviews where the text box is blank, meaning reviews where someone only left a rating without any text?
1
1
383
Oct ’23
Patching Xcode Cloud Workflows no longer working
Hello. I use the App Store Connect API with my XCode Cloud setup to update a Workflow description. Specifically PATCH https://api.appstoreconnect.apple.com/v1/ciWorkflows/{id}. A few days ago this API call stopped working, the API gives a 409 error and reports "You must provide a value for the attribute 'startConditions' with this request". I can't find anything about this attribute in the documentation if there has been a change. I tried adding it, but the API reports that this attribute doesn't exist. Has anyone else found this or has any suggestions? Thanks, David.
0
0
291
Oct ’23
Appstore Connect API Current Price
Is there an API that returns the current price info? (example snippet below). I am looking to return via API the data is downloadable from the Appstore Connect UI from Download Current Price for an Inapp Product or Subscription. Countries or Regions Currency Code Price Proceeds May Adjust Automatically United States USD 1.99 1.69 N Afghanistan USD 1.99 1.69 Y Albania USD 1.99 1.41 Y
0
0
283
Oct ’23
Implement AppstoreConnect API POST Request subscriptionPromotionalOffers
Hi guys! Unfortunately, the TSI Team is not willing to help me. Maybe someone here is able to help. :) I'm trying to create a subscriptionPromotionalOffer for the AppstoreConnect API in PHP. I'm using the latest app_store_connect_api_2.3_openapi.json and I generated the PHP API with openapi-generator-cli-6.6.0. Request url: https://api.appstoreconnect.apple.com/v1/subscriptionPromotionalOffers I'm sending the following payload: { "data":{ "type":"subscriptionPromotionalOffers", "attributes":{ "name":"TEST_SUBSCRIPTION_NAME", "offerCode":"TEST_SUBSCRIPTION_CODE", "duration":"ONE_YEAR", "offerMode":"PAY_UP_FRONT", "numberOfPeriods":1 }, "relationships":{ "subscription":{ "data":{ "type":"subscriptions", "id":"1575201034" } }, "prices":{ "data":[ { "type":"subscriptionPromotionalOfferPrices", "id":"eyJzIjoiMTU3NTIwMTAzNCIsInQiOiJVU0EiLCJwIjoiMTAyMTIifQ" } ] } } } } I'm getting the following error: `409 Conflict` response: { "errors" : [ { "id" : "79b54fc7-0e8d-4228-99ab-4937551b5303", "status" : "409", "code" : "ENTITY_ERROR.RELATIONSHIP.INVALID", "title" : "The provided entity includes a relationship with an invalid value", "detail" : "Missing a required include subscriptionPricePoint", "source" : { "pointer" : "/data/relationships/prices" } } ] } I think the error is a wrong id for subscriptionPromotionalOfferPrices which I don't understand. I`m saving all ids for all prices for all pricePoints for all subscriptions in my local db and try to use those ids for the subscriptionPromotionalOfferPrices. I also tried to provide the id for each country. If I do this, I get the same error for each id for each country. The provided id eyJzIjoiMTU3NTIwMTAzNCIsInQiOiJVU0EiLCJwIjoiMTAyMTIifQ references to 26.99$ price for the USA subscriptionPricePoint. Can someone provide me a working example for this request? If the id is wrong, can someone tell me: How to query the right ids for each country for each subscription? I already tried https://api.appstoreconnect.apple.com/v1/subscriptionPromotionalOffers/{id}/prices and https://api.appstoreconnect.apple.com/v1/subscriptionPromotionalOffers/{id} to fetch information for an existing Promotional Offer, but I was not able to fetch meaningful data from that endpoints. I'm able to modify all prices for an existing subscription via API, so I'm sure the IDs I use are valid subscriptionPricePoint ids for each country.
2
1
1.1k
Jun ’23
Invalid vendor number specified. Try again.
HI AllI am trying to use the API in Python and am getting the followin gerror:{ "errors" : [ { "id" : "285874b4-16fb-4109-b810-ffa2973be714", "status" : "400", "code" : "PARAMETER_ERROR.INVALID", "title" : "A parameter has an invalid value", "detail" : "Invalid vendor number specified. Try again.", "source" : { "parameter" : "filter[vendorNumber]" } } ] }I am passing the Following payload:payload = {'filter[frequency]':'DAILY', 'filter[reportSubType]': 'SUMMARY', 'filter[reportDate]':'2019-03-01', 'filter[vendorNumber]': '12345678', 'filter[reportType]': 'SALES' }Here is the request call:r = requests.get('https://api.appstoreconnect.apple.com/v1/salesReports', headers={'Authorization': 'Bearer {}'.format(token)}, params=payload)Any suggestions on how do i resolve this error?Thanks
7
1
5.6k
May ’19