0

As I heard re-optin to mobile contact using import definition doesn't work. I could see there are 2 options to re-optin:

  1. QueueMO API request
  2. Update Contact

I don't want to send sms while re-optin to contact, so I was trying to use the 2nd option and while I was achieving this, i got "Internal server error - 500".
Can someone help me with this? is this the correct request I'm doing?

Below are the API request details used:

Host: https://YOUR_SUBDOMAIN.rest.marketingcloudapis.com 
PATCH /contacts/v1/contacts
Content-Type: application/json
Authorization: Bearer YOUR_ACCESS_TOKEN
Payload:
{
    "contactKey": "1111111111",
    "attributeSets": [{
        "name": "MobileConnect Subscriptions",
            "items": [{
                "values": [                {
                        "name": "Mobile Number",
                        "value": "1111111110"
                },
                {
                    "name": "Opt In Status",
                    "value": 2
                },
                {
                    "name": "Opt Out Status",
                    "value": 0
                },
                {
                    "name": "Modified Date",
                    "value": "03-14-2023"
                },
                {
                    "name": "Created Date",
                    "value": "03-14-2023"
                }]
            }]
    }]
}
Error:   
"documentation": "https://developer.salesforce.com/docs/atlas.en-us.mc-apis.meta/mc-apis/error-handling.htm",  
"errorcode": 0,
"message": "Internal Server Error"

1 Answer 1

0

Two things might be causing an issue:

  1. You are not specifying the keyword to which contact should Opt In
  2. There could be some built-in date validation for the "Created Date" and "Modified Date" fields, so unless those are needed for you, I would have just removed them

Sample payload:

{
    "contactKey": "xxxxxxx",
    "attributeSets": [{
        "name": "MobileConnect Subscriptions",
        "items": [{
            "values": [
                {"name":"Keyword","value": "xxxxxxx"},
                {"name":"Mobile Number","value": "xxxxxxx"},
                {"name":"Opt In Status","value": "2"},
                {"name":"Opt Out Status","value": "0"}
            ]
        }]
    }]
}
1
  • Hi @Niko, I have tried the same you mentioned, but still getting the same error. Mar 20, 2023 at 15:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .