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.

Posts under App Store Connect API tag

200 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

App store connect API returns 401 with production url but works with sandbox url
Hi, My app is currently in review (wasn't approved yet). I'm using the Get Transaction History API with a sandbox user transaction ID. I successfully get results when using the sandbox url (https://api.storekit-sandbox.itunes.apple.com/inApps/v1/history/{originalTransactionId}) However, when using the production url (https://api.storekit.itunes.apple.com/inApps/v1/history/{originalTransactionId}) - I'm consistently getting 401 - unauthorized, which according to the doc means something is wrong with my JWT. Should I generate my JWT differently for sandbox vs production? If not, what else could cause this issue? Thanks,
7
1
6.4k
Sep ’23
Can't Upload IAP Item Review Screenshots via the API
I'm uploading IAP Item review screenshots via the App Store Connect API. I create the request, then receive the upload operations. I perform the upload, making sure to populate the headers, and put the data in a buffer in the body of the PUT request. https://developer.apple.com/documentation/appstoreconnectapi/create_an_in-app_purchase_review_screenshot When that upload API call returns, it gives me back an empty buffer. Nothing I do seems to alter the buffer, including intentionally sending incorrect data as a test. Is this intended behavior? What does the empty buffer mean? https://developer.apple.com/documentation/appstoreconnectapi/commit_a_review_screenshot_for_an_in-app_purchase Then, without knowing whether my upload has succeeded, I try to commit the upload. That call always returns an unexpected internal server error. I suspect this is because the upload didn't actually succeed, and that the screenshot is still empty, but I have no way of knowing why. There's no documentation page for the actual upload API call, as far as I know. Here's the error. { status: '500', code: 'UNEXPECTED_ERROR', title: 'An unexpected error occurred.', detail: 'An unexpected error occurred on the server side. If this issuue continues, contact us at https://developer.apple.com/contact/.' } How do you upload IAP screenshots?
1
0
694
Sep ’23
Get all customer Reviews from API
Hello, I'm getting the reviews for my App from this API Endpoint: https://api.appstoreconnect.apple.com/v1/apps/{id}/customerReviews as explained here https://developer.apple.com/documentation/appstoreconnectapi/list_all_customer_reviews_for_an_app The headline of the documentation says: List All Customer Reviews for an App However, the data I get back from the API does not contain all Reviews. By default I get around 50 reviews. If I use the parameter limit I can expand the response to max 200 Reviews. So, my questions: How do I get all reviews as claimed by the documentation?
3
0
2.2k
Sep ’23
Uploading Images Via App Store Connect API Not Working
Hello, I'm trying to upload assets using the app store connect api, I have successfully created a screenshot set, and created a screenshot reservation and got back the following response: "data": { "type": "appScreenshots", "id": "...", "attributes": { "fileSize": 4833, "fileName": "Untitled.png", "sourceFileChecksum": null, "imageAsset": null, "assetToken": "...", "assetType": "SCREENSHOT", "uploadOperations": [ { "method": "PUT", "url": "...", "length": 4833, "offset": 0, "requestHeaders": [ { "name": "Content-Type", "value": "image/png" } ] } ], "assetDeliveryState": { "errors": [], "warnings": null, "state": "AWAITING_UPLOAD" } }, "links": { "self": "..." } }, "links": { "self": "https://api.appstoreconnect.apple.com/v1/appScreenshots" } } The documentation states that I should use the "UploadOperations" to upload the image using the "put" method and using the url provided in the response under "UploadOperations", however I am not sure what to send in the body of the put request. I have tried the following but it is returning an empty response: headers = { "name": "Content-Type", "value": "image/png" } urlUpload = response.json()["data"]["attributes"]["uploadOperations"][0]["url"] response = requests.put(urlUploadTo,image=image, headers=headers) What exactly am I doing wrong here? Is there something I'm missing? The following link is the link to the documentation explaining how to upload assets.
1
0
696
Jun ’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
Sep ’23
API ExtendRenewalDateRequest returns a 200 but does not extend
I have been trying to extend a membership that is about to expire in 3 days. I send a request through the api following the instructions on this page https://developer.apple.com/documentation/appstoreserverapi/extend_a_subscription_renewal_date I get a 200 response with a body saying it was successful but the date is still the same both in the ExtendRenewalDateResponse and if I make a query to get the expiration of the subscription.
3
0
505
Jul ’23
Comparing local and uploaded app screenshots with App Store Connect API
Is there a way to compare a local app screenshot on my Mac with the one currently on App Store Connect without downloading the screenshot itself? The API returns fileSize and sourceFileChecksum properties (https://developer.apple.com/documentation/appstoreconnectapi/read_app_screenshot_information), but the file size of my local image is different (url.resourceValues(forKeys: [.fileSizeKey]).fileSize) and the checksum is also different from the one I provided when completing the app screenshot upload.
0
0
469
Jun ’23
Get all historical prices for a subscription
Hi! I am using App Store Connect, and I am searching for an endpoint that would list the history of all prices an app product / subscription had in the past, as well as in the present. The closest I found is the List All Prices for a Subscription | Apple Developer Documentation endpoint, but it seems to only provide current and future prices. Is there a way to retrieve past prices? Thanks a lot! Raquel
1
0
374
Jul ’23
Getting Error Code while calling API for mobile application 18338191624 , 08338191624
I have this API call in my application. For some reason, the response is coming back nil. If I try the right URL, a JSON will be returned and all the nodes filled out. I am getting these error codes 08338191624 , 8338191624 So I'm trying to get the error inside the if let error = error { but even putting a breaking point in there, the code is never reached. What am I doing wrong ? func getProductById(productId: Int, completion: @escaping (ProductModel) -> ()) { guard let url = URL(string: "https://mysite/api/products/82") else { return } var request = URLRequest(url: url) request.httpMethod = "GET" request.setValue("application/json; charset=UTF-8", forHTTPHeaderField: "Content-Type") URLSession.shared.dataTask(with: request) { (data, request, error) in if let data = data { print("data") } if let error = error { print("error") } guard let data = data else { return } do { let product = try! JSONDecoder().decode(ProductModel.self, from: data) DispatchQueue.main.async { completion(product) } } catch { print(error) } } .resume()
0
0
455
Jul ’23
App Store Connect: Creating certificates for Pass type id's
The docs here: https://developer.apple.com/documentation/appstoreconnectapi/certificatetype Imply that you can create a certificate with a certificateType of PASS_TYPE_ID_WITH_NFC or PASS_TYPE_ID. However, when using the API, I get a 404 or a 403 status code when attempting to use them. Additionally, there is no documented way to associate the certificate to a particular bundle id for the pass type. Has anyone been able to successfully create a certificate for passes? If so what request did you send?
2
0
634
Apr ’24
Access to Server Notifications and Sandbox Server URLs via App Store Connect API
I'm currently trying to automate the process of retrieving app-specific information such as the Server Notifications URL and the Sandbox Server URL via the App Store Connect API. From what I could gather from the official API documentation, there doesn't seem to be a way to fetch these URLs programmatically. Can anyone confirm if these pieces of information are accessible via the API currently or if there are plans to expose this in the future?
0
0
268
Jul ’23
Obtaining the Overall Rating of an App from the API
I'm currently trying to get app ratings using the App Store Connect API. What I want is not the individual ratings for each review but the overall rating for the app. I would like to retrieve the country-specific ratings that can be seen in the AppStoreConnect web console. It seems that the API reference does not have information on the overall rating. Is it possible to obtain this information via the API?
0
0
248
Jul ’23
Invalid Fileds Error
I got a lot of errors(400 PARAMETER_ERROR.INVALID) from a bunches of requests since yesterday, which were work well before. Just like this: The request failed with response code 400 PARAMETER_ERROR.INVALID A parameter has an invalid value. 'diagnosticSignatures' is not a valid field name The request failed with response code 400 PARAMETER_ERROR.INVALID A parameter has an invalid value. 'perfPowerMetrics' is not a valid field name). Are there any API change or validation strategies changes ?
1
1
371
Jul ’23