Apple Connect API keeps getting 401 errors. Can you tell me in detail what the problem is? And I'm sending you an es256 type jwt to use Apple API, so could you update the exact location of the key file I use at? I've been facing a 401 error for a few days now. The data thrown from Apple's server is difficult to pinpoint and the document is too complicated. Please also provide developmental support. Currently, I am sending from node to axios.
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
Apple Connect API keeps getting 401 errors. Can you tell me in detail what the problem is?
And I'm sending you an es256 type jwt to use Apple API, so could you update the exact location of the key file I use at?
I've been facing a 401 error for a few days now.
The data thrown from Apple's server is difficult to pinpoint and the document is too complicated. Please also provide developmental support.
Currently, I am sending from node to axios.
I've had several internal users note that the Summary Sales report API has started to have updates to historical reports.
As an example - a subscription quantity might be 1 when the API is queried for 1/15/24, but then if the API is queried and reconciled against itself it might be quantity of 3 when pulled 3/15/24.
This only started after 1/1/24, so I am wondering if there was a change to the report logic, or a new policy that Apple has started to allow that is making backdated changes to the summary sales report. This is causing a lot of potential missed revenue and manual effort for our accounting teams.
Is there any guidance that Apple team or others can provide on this topic?
Hi,
I've tried to authenticate this endpoint https://appstoreconnect.apple.com/iris/v1/betaFeedbacks with the JWT token as described in the documentation, but it's not working. I know this endpoint is not documented, but gathering the beta feedback and being able to extract it to some ticket system (e.g. GitHub board) would be a really helpful option for us.
Does anyone know how we can authenticate this one?
We are pulling data from the salesReports endpoint, specifically focusing on the Subscriber, Subscription_Event, and Subscription report types. Our goal is to perform internal analysis on our subscriptions, such as comparing renewals to new subscriptions.
However, we have observed that the data quality is not as high as we would expect from Apple. While some insights can be gleaned with a degree of uncertainty, our biggest concern is the discrepancy between the data obtained from the API or manually downloaded from the portal (https://appstoreconnect.apple.com/trends/reports) and the data displayed in the Portal visualizations (https://appstoreconnect.apple.com/trends/events). This discrepancy makes cross-checking difficult and lowers our confidence in the data’s accuracy.
Is anyone else experiencing similar issues, or has anyone managed to obtain reliable data for their app(s)?
I'm fetching Apple Store Connect data from the API (in particular, fetching the App Store Purchases report) and trying to replicate the dashboards that we can see under Analytics > Metrics.
The thresholding that Apple applies ("Omits values with data from fewer than 5 users or 5 unique devices") means that a lot of data is lost.
Is there a way of specifying the dimensions of the report? If we had less dimensions, the threshold would affect to less rows of data, and we would be able to analyze more data.
It's strange that from the website of App Store Analytics we can get the data, but through the automated reports we cannot or a lot of data is lost due to not being able to set the report dimensions.
I am considering the risks and management methods for API keys in case of leakage.
It seems that the maximum number of active API keys that can be used at one time is 10. Is it possible to relax this limit?
In the event that an API key is misused, is there a way to check the history of API requests and identify which API key was used for each request?
If you have any best practices for using API keys across multiple companies, it would be helpful to know.
We have been receiving this error from app store connects sales reporting API for the last hour or so. No outages reported on the Developer System Status page, but curious if anyone else is experiencing the same issue?
Worked fine earlier in the day.
https://api.appstoreconnect.apple.com/v1/salesReports
500
{
"errors": [{
"status": "500",
"code": "UNEXPECTED_ERROR",
"title": "An unexpected error occurred.",
"detail": "An unexpected error occurred on the server side. If this issue continues, contact us at https://developer.apple.com/contact/."
}]
}
When attempting to download the reports at GET https://api.appstoreconnect.apple.com/v1/salesReports we get an 500 Internal Server Error.
We didn't change the code for a long time and it worked fine before. Credentials are also correct.
So in the WWDC24 session What's new in App Store Connect a new Apple Developer Enterprise Program API is briefly mentioned at the end of the talk.
But there seems to be no other mention of it and would like to know more so that we perhaps can retire some rather not nice ways of automating Enterprise stuff :)
JWT header
{
"alg": "ES256",
"kid": "2X9R4HXF34",
"typ": "JWT"
}
JWT payload
{
"iss": "57246542-96fe-1a63-e053-0824d011072a",
"iat": 1528407600,
"exp": 1528408800,
"aud": "appstoreconnect-v1",
"scope": [
"GET /v1/apps?filter[platform]=IOS"
]
}
JWT
{
"alg": "ES256",
"kid": "private key",
"typ": "JWT"
}
I would like to find out how to calculate the "iat" and "exp" for the current time by using swift mathematical calculations if possible.
I want to find out how to sign the JWT with my private key after I download it, to find out how to create a JWT that would receive a HTTP Status Code 200 OK response from the Terminal.App . I received a 401 error not authorized response and to provide a proper JWT token that has not expired after my first attempt on this a application programming interface, I want to find where to place my private key if not in the "kid" ?
Kind Regards
I am following the Downloading Analytics Reports guide which consists of five steps:
request the ONGOING report generation for the app once
list all analytics report requests for the app
list all analytics reports based on the analytics report request id
:x: list all analytics report instances based on the analytics report id
list all segments of the analytics report instance to get the download url
I can only complete the third step which returns a list of all available reports.
However when I continue with step four, the request for the analytics report instances returns with a response code 200 but the data array is always empty:
I am using the Home Screen Widget Installs report but this is also happening for other reports
Also changing or omitting the filter doesn't change anything
{
"data": [],
"links": {
"self": "https://api.appstoreconnect.apple.com/v1/analyticsReports/{reportId}/instances?filter%5Bgranularity%5D=DAILY"
},
"meta": {
"paging": {
"total": 0,
"limit": 50
}
}
}
What could be the reason that the data array is empty and how can I fix it because there is no error message?
I created a project to validate in-app purchase receipts using c# but I always get error 401, you don't have permission, I followed the instructions exactly but still failed, I created a private key in Certificates, IDs & Profiles and download the .p8 file but it still doesn't work, I also created and tried another key in Users and Access > Integrations > App Store Connect API and also In-App Purchase but it still doesn't work.
When I try to put the created token on jwt.io, I always get an Invalid Signature error
using Jose;
using System;
using System.Collections.Generic;
using System.Net.Http.Headers;
using System.Net.Http;
using System.Security.Cryptography;
using System.Threading.Tasks;
using System.IO;
using System.Net;
namespace CheckIAP
{
internal class Program
{
static async Task Main(string[] args)
{
string jwtToken = GenerateAppStoreJwtToken();
string transactionId = "110002159078***";
Console.WriteLine(jwtToken);
string url = $"https://api.storekit.itunes.apple.com/inApps/v2/history/{transactionId}";
using (HttpClient client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", jwtToken);
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
HttpResponseMessage response = await client.GetAsync(url);
if (response.IsSuccessStatusCode)
{
string responseData = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseData);
}
else
{
Console.WriteLine($"Error: {response.StatusCode}, {response.ReasonPhrase}");
string responseData = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseData);
}
}
Console.ReadLine();
}
public static string GenerateAppStoreJwtToken()
{
string teamId = "PZG479xxxx";
string keyId = "JCXH26xxxx";
string issuerId = "7aa0c9c2-***-***-***-xxxx";
string bundleId = "com.***.***";
const string API_KEY = "MIGTAgEAMBMGByqGSM....";
var header = new Dictionary<string, object>()
{
{ "alg", "ES256" },
{ "kid", keyId },
{ "typ", "JWT" }
};
var payload = new Dictionary<string, object>
{
{ "iss", issuerId },
{ "iat", DateTimeOffset.UtcNow.ToUnixTimeSeconds() },
{ "exp", DateTimeOffset.UtcNow.AddMinutes(15).ToUnixTimeSeconds() },
{ "aud", "appstoreconnect-v1" },
{ "sub", bundleId }
};
var key = CngKey.Import(Convert.FromBase64String(API_KEY),
CngKeyBlobFormat.Pkcs8PrivateBlob);
return Jose.JWT.Encode(payload, key, JwsAlgorithm.ES256, header);
}
}
}
Is it possible, with the new analytics API, to get analytics (for example, App Sessions) for a specific date, such as 2 months ago?
I'm using the App Store Server API's Get Transaction History.
If you specify DESCENDING for the sort parameter, receipts will be sorted in chronological order when verified in a sandbox environment, but in a commercial environment they will be in random order.
Is there anyone stuck with a similar problem?
Hi, I'm just using the APPLE api to get the sales, installs and profit data for the month but I don't know why I think I'm not getting all the data because if I look at the financial cut for the month (APRIL FOR EXAMPLE) I see that APPLE it pays me XYZ amount, but in the API, if I get the profit or the sales, neither gives me the correct amount from the financial report. I am doing something wrong? how can i get the correct amount using the APIs
https://api.appstoreconnect.apple.com/v1/betaTesters/{id}
Cannot call delete on any of the above
Cannot be uninstalled from the app store console
(IDs cannot be provided as personal information)
{
"errors": [
{
"status": "500",
"code": "UNEXPECTED_ERROR",
"title": "An unexpected error occurred.",
"detail": "An unexpected error occurred on the server side. If this issue continues, contact us at https://developer.apple.com/contact/."
}
]
}
As other threads have reported, the endpoint “GET /v1/salesReports” responds with a status of 403 (Forbidden). It worked a week ago but no longer works today.
Further Information:
There is no warning on https://appstoreconnect.apple.com/ after logging in.
I have generated API keys with Admin, Developer, and Finance authority, but none worked.
It does not reach the request rate limit per hour.
Other endpoints "GET /v1/apps" for instance, respond with status 200(work properly).
I would appreciate any help or advice. Thank you.
I want to do an app transfer,
but TeamPlayerID is inconsistent and I'm screwed.
What can I do?
There are 170,000 accounts.
help me.
When using individual key to retrieve sales report via https://api.appstoreconnect.apple.com/v1/financeReports, I keep receiving status:500, unexpected_error. Other endpoints are fine.
Anybody also have this issue?