1

We are trying to find a way to automate a change of a contact's device Status in MobilePush demographics in the Marketing Cloud. Theoretically, this should be possible with the Update contacts call in MC API (it is possible to change it manually in the Contact Builder but that's not really feasible for us).

I am calling the Update contacts API but it doesn't work, nothing happens in MC. I get operationStatus OK and 0 rowsAffected without any errors (testing with Postman, see the request and response below). I tried to change the Status to Inactive by setting the value to both the values 2 (as an Integer) and "2" (as a String), same response. It's called as a PATCH method with the correct domain, I set the correct content-type and the bearer token (all double checked). In the request body, I supply the correct contact key and device ID from All Contacts in the Contact Builder (the device is currently Active).

Am I setting incorrect values or is there something else I am missing? If there is another way to automate this use case, I would be also open to it.

My request:

{
    "contactKey": "myContactKey",
    "attributeSets": [
    {
        "name": "MobilePush Demographics",
            "items": [{
                "values": [
                {
                    "name": "Device ID",
                    "value": "myDeviceID"
                },
                {
                    "name": "Status",
                    "value": "2"
                }]
            }]
    }
    ]
}

Response:

{
    "operationStatus": "OK",
    "rowsAffected": 0,
    "contactKey": "myContactKey",
    "contactID": 123456789,
    "contactTypeID": 0,
    "isNewContactKey": false,
    "requestServiceMessageID": "0ecb1697-1db6-48cd-b538-d80262e47b77",
    "responseDateTime": "2020-07-03T04:21:20.278043-06:00",
    "hasErrors": false,
    "resultMessages": [],
    "serviceMessageID": "1b86d736-8b62-467d-a9d5-3e0bb8e28fd6"
}  

EDIT: MC Support told me that the Status field has 3 states. But didn't explain why nothing happens.

1= Active
2= Inactive
3= Deleted

1

The "Application" parameter for the values of MobilePush Demographics is also required.

The request should look like this:

{
    "contactKey": "myContactKey",
    "attributeSets": [{
        "name": "MobilePush Demographics",
            "items": [{
                "values": [
                {
                    "name": "Device ID",
                    "value": "myDeviceID"
                },
                {
                    "name": "Application",
                    "value": "myApplicationID"
                },
                {
                    "name": "Status",
                    "value": "2"
                }]
            }]
        }
    ]
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.