I tried creating a provisioning profile through App Store Connect API. Here is the body with obfuscated data that I sent to POST v1/profiles
.
{
"data": {
"relationships": {
"certificates": {
"data": [
{
"id": "BD615443",
"type": "certificates"
} ]
},
"bundleId": {
"data": {
"id": "bundle.identifier.app",
"type": "bundleIds"
}
}
},
"attributes": {
"profileType": "IOS_APP_STORE",
"name": "SO Question Profile"
},
"type": "profiles"
}
}
I cross verified that all the above supplied data was correct. But I ended up receiving an error response with error description - There is no App ID with ID 'com.appmysite.iaptest' on this team.
I can see that I have not made a mistake while copying and pasting the bundle ID from developer.apple.com. I have also tried the app ID (teamID.bundle.identifier.app) and also the app Apple ID (1234567) for this API field and nothing seems to work. Moreover, I am able to create a provisioning profile using the same certificate and bundle ID through App Store Connect portal. There is little to no documentation and online resources regarding this, so what exactly does Apple expect me to send as bundleId
?
So, since I was sending the
primaryID
of the certificate that I want to use to create the provisioning profile. I thought of trying the same for thebundleID
and it worked like a charm.It is important to note that these '
primaryId
s' are not exposed through App Store Connect portal and needs to be obtained using App Store Connect APIs.For certificates you can use
GET v1/certificates
and for bundleIds useGET v1/bundleIds
.