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

185 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

Reponse in blank by "https://api.storekit-sandbox.itunes.apple.com/inApps/v1/subscriptions" in spite of passing valid transactionId
Hello, A user subscribed by in-app purchase subscription in the app "Target Leaderboard". We have got the transaction Id and base64 encoded receipt data in response. We can generate the JWT by the In-app purchase key file and key Id. But when we try to fetch all subscriptions by "https://api.storekit-sandbox.itunes.apple.com/inApps/v1/subscriptions" by passing the transaction Id, blank response is returned. Why it is happening? Also, when we are try to fetch original transaction Id by "https://sandbox.itunes.apple.com/verifyReceipt" by passing the base64 encoded receipt data and SharedSecret, code 21003 is returned. Why it is happening? Please help.
2
0
103
2d
App Store Analytics API returns segments but not media links
I have been sending requests to the Appstore Connect API for 3 types of reports; download data, discovery data, and install data. The documentation notes that data is available as far back as Jan 1, 2024. I have found this to be true with install data reports. But the other two go back only about 5 weeks. The process of getting these reports involves two HTTP requests, one to get segment instances with the report ID and one to get media links with the segment IDs. I am using the 'granularity' and 'WEEKLY' param but I get the same results with other options. I don't think it's an error with my code because I'm receiving data for earlier dates but not dates before 5 weeks ago. I need some ideas to move forward because I need to backfill the data to at least April, 2024.
0
0
107
6d
How to Upload Achievement Icon Image? (App Store Connect API)
Hi! I'm using the App Store Connect API to automate the setup of Game Center achievements. However, I'm facing an issue when it comes to uploading the achievement icon. I referred to the following link and tried to use the Create an Achievement Image API: https://developer.apple.com/documentation/appstoreconnectapi/create_an_achievement_image This API includes a GameCenterAchievementImageCreateRequest.Data.Attributes object, which has properties like fileName and fileSize. However, there is no property for the file path, only the file name. I also checked the page about uploading assets to App Store Connect: https://developer.apple.com/documentation/appstoreconnectapi/uploading_assets_to_app_store_connect Unfortunately, there is no specific mention of how to upload an achievement image. When I use the GameCenterAchievementImageCreateRequest.Data.Attributes and set fileName to "XXXX" (for example), the request completes successfully, but the achievement page only displays the file name XXXX, and the image is not loaded as expected. Any advice or guidance would be greatly appreciated. Thank you in advance!
1
0
85
6d
Unable to use the Enterprise App Store Connect APIs from xcodebuild
With the recently introduced Enterprise API Program, this should allow us to interact with the developer portal via the API instead of needing an account signed into Xcode. I followed the following steps to generate a key: Logged into App Store Connect. Navigated to Users and Access. Selected Integrations. Generated an API key with the Admin role. Saved the key, the key identifier, and the issuer identifier. Now, when using xcodebuild with the -allowProvisioningUpdates switch, I added -authenticationKeyPath, -authenticationKeyID, and -authenticationKeyIssuerID with the correct values. xcodebuild spits out the following error: xcodebuild: error: Invalid authentication key credential specified (CryptoKit.CryptoKitASN1Error.invalidPEMDocument) What am I doing wrong/what did I miss? The developer portal shows that the key was "used" by updating the last used date.
7
0
228
7h
Account Holder of Apple Developer Enterprise Program Account Unable to Request Access To or See App Store Connect API
We are referring to the following Apple documentation online- specifically the instructions underneath the header "Request access to the App Store Connect API": https://developer.apple.com/help/app-store-connect/get-started/app-store-connect-api/ The first problem is that the Account Holder cannot see the "Integrations" tab in the "Users and Access" view (https://appstoreconnect.apple.com/access/users). However, they are able to reach "Integrations" by direct URL (https://appstoreconnect.apple.com/access/integrations/). Note that they still cannot see an "Integrations" tab in the UI when at this link. At this point, the documentation indicates that the Account Holder should be able to see an "App Store Connect API" option underneath the "Keys" options on the left, but they are only able to see a "Shared Secret" option underneath the "Keys" options on the left. Please assist- this is blocking Production releases for us. Additional info: we use Edge browser on Windows machines to access the web portal- I don't see how this should impact what a website displays though the Developer Account has existed for some years now. At a certain point the Account Owner role was transferred over to the current Account Owner I have confirmed that the Program type is Apple Developer Enterprise Program
1
0
239
Aug ’24
iTunes Lookup API Returning Incorrect Version and JSON Serialization Error
I am encountering issues when retrieving the App Store version of my app using the iTunes Lookup API in Swift 5 on iOS. The API sometimes returns the incorrect version, and occasionally, it produces the following error message:JSON could not be serialised because of error: The data couldn't be read because it isn't in the correct format. (https://itunes.apple.com/lookup) I would appreciate any guidance on resolving these issues. Thank you for your assistance.
0
0
222
Aug ’24
App Ratings missing from Connect API
Hello, We are trying to extract our lifetime app star ratings data from the App Store Connect API but we couldn't find the resource anywhere. We were able to successfully get all app reviews data from this endpoint GET https://api.appstoreconnect.apple.com/v1/apps/{id}/customerReviews based on the official documentation. We validated that we received all reviews, these reviews also include the star ratings. However, the number of star ratings that we see on the App Store console is way less than the one we got from reviews API since star ratings can be submitted without a text review. Any idea where can we get the data of lifetime star ratings using the Connect API ? Thanks !
0
0
173
Jul ’24
App Store Connect API Analytics Reports Data
Hi, I am trying to get the data in App Store Installation and Deletion Standard report but the counts does not equal what I see on the App Analytics dashboard. There are 8 ongoing reports with "APP_USAGE" parameter, and the one I am downloading consists of 1 page only. The page count is 1, so there is no pages I am missing. I am using "DAILY" as granularity. What am I missing here? Thanks a lot.
5
0
630
Jul ’24
401 Unauthorized App Store Connect API
I'm getting the following error: 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 I am using the correct key files and I have assigned the Admin permission. Any help would be greatly appreciated import requests import datetime from authlib.jose import jwt app = Flask(__name__) # App Store Connect API information KEY_ID = 'XXXXXXXXX' ISSUER_ID = 'XXXXX-XXXXX-XXXX-XXXX-XXXXXXXX' KEY_FILE = 'AuthKey_XXXXXXX.p8' APP_ID = '12345678' # App Store Connect application ID def generate_jwt_token(): """ Generate JWT token using authlib.jose """ header = { 'alg': 'ES256', 'kid': KEY_ID, 'typ': 'JWT' } payload = { 'iss': ISSUER_ID, 'aud': 'appstoreconnect-v1', 'exp': int(datetime.datetime.utcnow().timestamp()) + 1200 # token good for 20 min } with open(KEY_FILE, 'r') as key_file: key = key_file.read() token = jwt.encode(header, payload, key) return token.decode('utf-8') # Ensure the token is a string @app.route('/latest-build') def latest_build(): token = generate_jwt_token() headers = { 'Authorization': f'Bearer {token}', 'Content-Type': 'application/json' } response = requests.get( f'https://api.appstoreconnect.apple.com/v1/builds?filter[app]={APP_ID}&limit=1&sort=-uploadedDate', headers=headers ) if response.status_code != 200: return jsonify({ 'error': 'Failed to fetch data from API', 'status_code': response.status_code, 'response': response.json() }) build_data = response.json() try: latest_build_version = build_data['data'][0]['attributes']['version'] return jsonify({'latest_build_version': latest_build_version}) except KeyError as e: return jsonify({ 'error': 'KeyError accessing response data', 'details': str(e), 'response': build_data }) if __name__ == '__main__': app.run(debug=True)
0
0
285
Jul ’24
What is the timezone in Sales Report?
Hey, I'm using the reporter in order to get Sales and Trends report. I don't understand what is the date timezone in the report, in the documentation it says that it is depands on the Territory. Which Territory? The purchase territory? And if it is the purchase territory, does it means that each recoors is in different timezone? Or is it the application territory? Thank you for the answer, Ido
0
0
160
Jul ’24
App Store Connect API: How to create introductory offer for all territories?
I'm trying to use the appstore connect REST API to create an introductory offer for one of our subscriptions. The introductory offer should exist in all territories our app supports. I successfully created an intro offer for all territories, but only by calling POST https://api.appstoreconnect.apple.com/v1/subscriptionIntroductoryOffers (https://developer.apple.com/documentation/appstoreconnectapi/create_an_introductory_offer) 175 times, once for each territory. Is there a more efficient way to do that? The API documentation has no explanatory text, only the types and payloads. I used those to piece together the following approach. I am not sure if this is even the intended way to use the API, so please correct me if I'm wrong. Call GET https://api.appstoreconnect.apple.com/v1/subscriptions/{id}/pricePoints with territory filter USA to get all available price points in USD From the result list, pick the price point whose customer price is closest to the one I wish to set up Call GET https://api.appstoreconnect.apple.com/v1/subscriptionPricePoints/{id}/equalizations to get equivalent price points in all territories Call POST https://api.appstoreconnect.apple.com/v1/subscriptionIntroductoryOffers for each the USA's the and other territories' price points Now my question. The create intro offer endpoint takes as payload an object of type SubscriptionIntroductoryOfferCreateRequest (https://developer.apple.com/documentation/appstoreconnectapi/subscriptionintroductoryoffercreaterequest), which has a field "included", which is a list of price point IDs. In my step 3 above I have a list of price point IDs, and the field name and type suggests to put them here to create an intro offer for all territories in one API call. However, this does not work. The field "included" seems to have no effect whatsoever, no matter what I put in there. Is there a way to create an intro offer for all territories in one go, or do I have to call the create endpoint multiple times?
0
0
245
Jul ’24
Failed to parse the media type: application/json;
Few days ago app store connect api response is incorrect, returns the Content-type "application/json;" It is wrong cause there is a semicolon at the end of mime type. Many http clients fail with 'Failed to parse the media type: application/json;' i tested on https://api.appstoreconnect.apple.com/v1/apps/appid/appStoreVersions After a few retries the response is correct Please help
0
0
257
Jul ’24
Can I change the availability of the auto-renewal subscription item using the API?
In my application, I have to create and remove many auto-renewal subscription items programmatically using an API. Like the YouTube app, when a user creates a channel, I will create a subscription item with their name, and when they shut down the channel, I will cancel the whole subscription and remove the item. I found that I can create subscription items using the following API: https://developer.apple.com/documentation/appstoreconnectapi/create_an_auto-renewable_subscription In the following document, I found that I can stop selling and cancel subscriptions at https://appstoreconnect.apple.com by changing the availability of item from "Cleared for Sale" to "Remove from Sale": https://developer.apple.com/help/app-store-connect/manage-subscriptions/set-availability-for-an-auto-renewable-subscription My question is can I stop selling and cancel subscriptions using an API? The App Store Connect API offers modifying subscription availability, but it only offers changing sales countries: https://developer.apple.com/documentation/appstoreconnectapi/modify_an_auto-renewable_subscription They also offer a subscription deletion API, but I'm not sure if it'll work as I need: https://developer.apple.com/documentation/appstoreconnectapi/delete_a_subscription How do you manage auto-renewal subscription items when you stop selling them? Is there any API or do you do it manually? Thank you.
0
0
274
Jul ’24
Incorrect 400 response when downloading subscriber report
I am attempting to download subscriber reports for my app. I'm using the following URL with vendorNumber redacted: https://api.appstoreconnect.apple.com/v1/salesReports?filter[frequency]=DAILY&filter[reportSubType]=DETAILED&filter[reportType]=SUBSCRIBER&filter[reportDate]=2024-04-04&filter[vendorNumber]=xxxxxxxx&filter[version]=1_3 I am getting the following response: "id": "92183ac5-7881-436c-ac66-5d89673c5070", "status": "400", "code": "PARAMETER_ERROR.INVALID", "title": "A parameter has an invalid value", "detail": "Invalid vendor number specified. Try again.", "source": { "parameter": "filter[vendorNumber]" } However when I use the same vendor number for the sales summary report: https://api.appstoreconnect.apple.com/v1/salesReports?filter[frequency]=MONTHLY&filter[reportDate]=2023-09&filter[reportSubType]=SUMMARY&filter[reportType]=SALES&filter[vendorNumber]=xxxxxxxx&filter[version]=1_0 I get a proper response. I believe I should be getting a 404 on this response, but am not. This issue can be tracked back to 2019, can we please get some detail about this response?
0
1
287
Jul ’24
Empty response returned on read instances GET request
I'm trying following endpoint to get instances of a report, https://api.appstoreconnect.apple.com/v1/analyticsReports/{id}/instances but getting an empty response: {'data': [], 'links': {'self': 'https://api.appstoreconnect.apple.com/v1/analyticsReports/r8-4433f324-ba58-44d0-8b7f-f8976ef36646/instances'}, 'meta': {'paging': {'total': 0, 'limit': 50}}} I'm accessing "App Sessions Standard" report and correctly passing the instance id to get instances of this report. Also made sure that the App I'm accessing have App sessions data in the console. code.txt This is the order of api requests I implemented: 'https://api.appstoreconnect.apple.com/v1/analyticsReportRequests' 'https://api.appstoreconnect.apple.com/v1/analyticsReportRequests/{report_id}/reports' 'https://api.appstoreconnect.apple.com/v1/analyticsReports/{report_id}/instances' Source code is provided in the attached file. Would be grateful if someone can help resolve this issue.
1
0
347
Jul ’24
App Store Connect API: Modifying Phased Release
I'm trying to automate the process of resuming, or completing a phased release using the "PATCH /v1/appStoreVersionPhasedReleases/{id}" endpoint. When sending a request to update the PhasedReleaseState, I am seeing a 409 error that states: An attribute value is not acceptable for the current resource state. You cannot change the state of a phased release in the current version state. Source: {'pointer': '/data/attributes/pendingDeveloperRelease'} Apparently PENDING_DEVELOPER_RELEASE is an invalid state. Based on the "App and submission statuses" document, the PENDING_DEVELOPER_RELEASE state means: Your app was approved, but you still need to release it for distribution on the App Store. I'm a bit surprised that it would fail, when releasing the app for distribution is exactly what I'm trying to do by modifying the PhasedReleaseState to ACTIVE, or COMPLETE. In addition, the "Release a version update in phases" document lists it as a valid state: When you release a version update of your iOS, macOS, tvOS, or universal app, you can choose to release it to the App Store in stages. This option is available if you're submitting a version update and your app has one of the following app statuses; Prepare for Submission Waiting for Review In Review Waiting for Export Compliance Pending Developer Release Developer Rejected Rejected Metadata Rejected Notably, some of the other states seem like they shouldn't be valid states to rollout an app (e.g. Rejected, Waiting for Review, etc.). So this makes me think that this document doesn't necessarily cover the list of valid states; more so, they tell you that you have the capability to perform a phased rollout for your app. So, my question is, what are the valid app version states required for me to be able to successfully modify a phased rollout? Any help, or pointers would be greatly appreciated. Thank you! API Endpoint URL: https://developer.apple.com/documentation/appstoreconnectapi/modify_an_app_store_version_phased_release App and submission statuses document: https://developer.apple.com/help/app-store-connect/reference/app-and-submission-statuses Release a version update in phases document: https://developer.apple.com/help/app-store-connect/update-your-app/release-a-version-update-in-phases
1
0
373
Jul ’24