Changing data protection capability with Connect API

Hi there!


I’m working on a task that would require configuring new apps in the developer portal as well as App Store Connect.


The issue I’m seeing is that the data protection capability in the dev portal isn’t being set successfully. Other capabilities (SiriKit, push notifications, etc.) are configured as expected. However, data protection is not enabled and not set to the complete protection level.


Initially, I tried using Fastlane but `enable_services` and `modify_services` silently fail.


Then, by way of Fastlane’s Spaceship to manage sessions, I tried Connect API but I have not yet been able to get a successful response. We have other scripts that successfully leverage Connect API so it’s not our session or process I’m too worried about. I just can’t seem to find the right format for the JSON body to get anything but a 500 error with generic response.


I’ve been over the Connect documentation a bunch of times (https://developer.apple.com/documentation/appstoreconnectapi/enable_a_capability) but I still have had no luck.


The endpoint I’m targeting is: https://appstoreconnect.apple.com/iris/v1/bundleIdCapabilities


Here’s an example JSON body:


{

"data": {

"type": "bundleIdCapabilities",

"attributes": {

"capabilityType": "DATA_PROTECTION",

"settings": [{

"key": "DATA_PROTECTION_PERMISSION_LEVEL",

"options": [{

"key": "COMPLETE_PROTECTION",

"enabled": true

}]

}]

},

"relationships": {

"bundleId": {

"data": {

"id": "[some valid bundle ID]",

"type": "bundleIds"

}

}

}

}

}


Does anyone have any ideas what I’m doing wrong? Any suggestions on alternative ways to change this configuration via a script?


Thanks,

-adam

Replies

Hello,

I have a similar problem her.

I can't figure out how to configure a bundleId PUSH_NOTIFICATIONS capability, i can create a bundle ID, and enable PUSH_NOTIFICATIONS capability for it, but i need to set PUSH_NOTIFICATIONS capability certificate and i'm stock at this point, can same one help? I'm responding this post, first because it's related post and it's without answer for a while, but if same one feel to make it as a new post feel free to do dat.

Thanks, hope same one response with an answer.