I have a Ruby (web) app that collects a user’s email and phone number. They can then optionally opt into email and sms marketing. I have tried passing consent through the “sms_consent”: true attribute as well as via API, but the profile still shows as “NEVER_SUBSCRIBED” in my list.
Using revision: 2023-07-15, I create a profile if one doesn’t already exist.
self.class.post("/profiles/", body: body, headers: headers)
{ "data":
{
"type": "profile",
"attributes": {
"properties": {
"$first_name": "Jane",
"$last_name": "Doe",
"sms_consent": true
},
"email": "janedoe@example.com",
"phone_number": "+447911128888"
}
}
}
Then, I post to the subscribe endpoint
self.class.post("/profile-subscription-bulk-create-jobs/", body: body, headers: headers)
{
"data": {
"type": "profile-subscription-bulk-create-job",
"attributes": {
"profiles": {
"data":
{
"type": "profile",
"id": "01H7A7T1TS*************",
"attributes": {
"phone_number": "+447911128888",
"email": "janedoe@example.com",
"subscriptions": {
"email":
"MARKETING"
],
"sms":
"MARKETING"
]
}
}
}
]
}
},
"relationships": {
"list": {
"data": {
"type": "list",
"id": "kdjalkd"
}
}
}
}
}
However, when I get the profile from my list I get:
"properties": {
"$source": -9,
"$consent": /
"email",
"sms"
],
"$consent_timestamp": "2023-08-07T11:37:48.409Z"
},
"subscriptions": null
When I get the profile, I get:
"properties": {
"$source": -9,
"$consent": >
"email",
"sms"
],
"$consent_timestamp": "2023-08-07T11:37:48.409Z"
},
"subscriptions": {
"email": {
"marketing": {
"consent": "SUBSCRIBED",
"timestamp": "2023-08-07T11:37:48.695806+00:00",
"method": "API",
"method_detail": "35cd",
"custom_method_detail": null,
"double_optin": false,
"suppressions": "],
"list_suppressions": _]
}
},
"sms": {
"marketing": null
}
Although I have SMS set up for the UK and I am not receiving any errors, would the issue be that our account cannot grant SMS consent? Or am I not properly sending the sms consent?