0

I want to automatically update SMS subscription status through a Data Extension.

At first, I was going to use an import definition in Mobile Connect and then put in an automation. It went well for unsubscribing but not resubscribing. You can read about this issue from this post. Briefly once we import them with active status, their "global" status will turn into active status but the keyword status is still opted-out. I checked it by myself.

Therefore QueueMO REST API seems like a promised solution (its document HERE). The thing is I don't know how to use it properly. They have the sample code:

Host: https://YOUR_SUBDOMAIN.rest.marketingcloudapis.com
POST /sms/v1/queueMO/
Content-Type: application/json
Authorization: Bearer YOUR_ACCESS_TOKEN

{
  "mobileNumbers" : [
  "15555551212"
  ],
  "shortCode" : "86288",
  "messageText" : "CODETEST"
}

How do I get the YOUR_SUBDOMAIN and Bearer YOUR_ACCESS_TOKEN values? I doubt if I will have to make additional steps in order to make the API call and get the response after that. Eventually I will have to put the QueueMO in a Script activity, right?

P/s: it isn't mandatory to use QueueMO. Any helps would be appreciated. Thanks.

1 Answer 1

1

The MobileConnect demographic has interesting quirks and MobileConnect Subscription adds another layer of complexity when managing the Optin.

With regards to QueueMO API, you'd need the OAuth credentials to be able to leverage the APIs - I will list the references to achieve this:

Alternatively, I have used the UpdateData AMPScript or SSJS function to manipulate the Optin values in the Subscription table.

SubscriptionStatusOptIn = 2;
SubscriptionStatusOptOut = 0;
    
UpdateSubscription = Platform.Function.UpdateData('_MobileSubscription',['_MobileNumber'],[MobileNumber],['_OptInStatusID','_OptOutStatusID'],[SubscriptionStatusOptIn,SubscriptionStatusOptOut])

The MobileNumber is the phone number to update the keyword subscription and the SubscriptionStatus holds a numeric value that needs to be mapped correctly as per below:

  • Not Oped-In: 0
  • Opted-In: 2

Above script will update all the keywords under that phone number - if you wish to change a specific keyword/SubscriptionDefinitionID then you'd need a guid of that keyword.

There is more information on the SubscriptionLog Data view regarding these IDs and their equivalent values.

You can use the above SSJS script in the script activity within the Automation Studio to change the Subscription data. (Note: above script isn't the full solution working code but provides enough direction to achieve the outcome)

Lastly, I do not believe this method has been listed officially by Salesforce so please use it under your own acknowledgement - similar concept by Mateusz to change mobile numbers.

2
  • 1
    Thank you so much! The second way really opens my eyes. I always wonder why we don't update the data in "data views" but go around with stuff. Actually I thought data views are only for observation. Note: we have to update OptInStatusID and OptOutStatusID at the same time in order to update SMS subscription status. Opt out will be like this: Not Oped-In: 1, Opted-In: 0
    – Duc Le
    Jul 26, 2021 at 7:59
  • @duyduc27 I am glad it was helpful. thank you for accepting and upvoting the answer. Jul 26, 2021 at 10:59

You must log in to answer this question.

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