使用App Store Connect API创建配置文件时的Bundle ID报错问题
解决App Store Connect API创建配置文件的Bundle ID字段问题
你需要传入的是App Store Connect中该Bundle ID对应的UUID,而非你从developer.apple.com复制的反向域名格式标识符(比如com.appmysite.iaptest)。
报错原因
在开发者门户和App Store Connect网页界面中,我们习惯使用反向域名格式的Bundle ID,但API层面要求的是该Bundle ID资源在App Store Connect系统内的唯一UUID标识——网页端会自动帮你完成反向域名到UUID的映射,API则需要你手动指定。
获取正确UUID的步骤
- 调用App Store Connect API的
GET v1/bundleIds接口(需携带有效的API授权凭证) - 在返回的
data数组中,找到attributes.identifier与你使用的反向域名匹配的条目 - 提取该条目的
id字段值(格式类似2X9R4HXF3J的字符串),将其替换到请求体的bundleId.data.id位置
修正后的请求体示例(仅修改bundleId部分)
{ "data": { "relationships": { "certificates": { "data": [ { "id": "BD615443", "type": "certificates" } ] }, "bundleId": { "data": { "id": "2X9R4HXF3J", // 替换为获取到的UUID "type": "bundleIds" } } }, "attributes": { "profileType": "IOS_APP_STORE", "name": "SO Question Profile" }, "type": "profiles" } }
内容的提问来源于stack exchange,提问作者hsiraaH
相关产品推荐
相关产品推荐

