ittybittyapps / appstoreconnect-cli

An easy to use command-line tool for interacting with the Apple AppStore Connect API
MIT License
175 stars 17 forks source link

Modify a Capability Configuration #95

Open orj opened 4 years ago

orj commented 4 years ago

🗣 Context

Update the configuration of a specific capability.

💬 Narrative

As a user I want modify a capability on a specific bundle ID So that my app can use that capability

📝 Notes

Covering this API.

🎨 Design

asc capability modify bundleId capabilityType <capability settings>

✅ Acceptance Criteria

GIVEN ... WHEN ... THEN ...

DechengMa commented 4 years ago

Tried both in CLI and Postman but seems the CapabilitySetting can't be easily changed in API. I tried input one or both of these field documented in API

allowedInstances, description, enabledByDefault, name, visible, minInstances

but the API all gave me an error of Unrecognized field. Might need further investigation on this.

My request body

{
    "data": {
        "id": "123456789_PUSH_NOTIFICATIONS",
        "attributes": {
            "capabilityType": "PUSH_NOTIFICATIONS",
            "settings": [
                {
                    "enabledByDefault": true,
                    "options": [
                        {
                            "enabled": true
                        }
                    ]
                }
            ]
        },
        "type": "bundleIdCapabilities"
    }
}

Response:

{
  "errors" : [ {
    "id" : "1234567-1234-1234-1234-123456asdcasd",
    "status" : "409",
    "code" : "ENTITY_ERROR.ATTRIBUTE.INVALID",
    "title" : "An attribute in the provided entity has invalid value",
    "detail" : "Unrecognized field 'enabledByDefault'"
  } ]
}