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?
App Store Connect API
RSS for tagThe App Store Connect API helps you automate tasks usually done on the Apple Developer website and App Store Connect.
Post
Replies
Boosts
Views
Activity
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?
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"
}
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/***"
}
}
I would like to be able to get analytic information for app number of downloads and installs from the App Store using REST Api programmatically.
I would appreciate any resource on these REST Api for my use.
Thank you
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.
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 🙃
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?
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?
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)")
}
}
}**`
Is it possible to modify "Description" and "What's New in This Version" field via 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.
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.
您好,我们想获得App Store自定义产品页面的收益值,我们可以使用哪个API获取数据
Hello, we would like to obtain the values of proceeds to the custom product page of the App Store,Which API can we use to obtain data
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?
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.
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
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.
Now that provisioning has been added to the App Store Connect API I was wondering if support for enterprise developer accounts will also be added. As of yet there is no way to generate API keys for enterprise accounts.
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