Followers Are Great, Contacts Are Gold. Create a Free AI-Quiz With Lead Magnet to Share With Your Followers and Own Your Contacts!

Can't set the sms address for contact via API v3 with /contacts/sign_up_for

SOLVED
Go to solution
user736688
Rookie
0 Votes

Here is an example request and response I get with personal info redacted....

 

 

INFO:config:Request payload for reger@blarg.net: {
"email_address": "*******",
"first_name": "*****",
"last_name": "*******",
"list_memberships": [
"84bb262c-31e5-11f0-9936-fa163ea63899"
],
"create_source": "Account",
"phone_number": "**********",
"sms_channel": {
"sms_address": "**********",
"dial_code": "1",
"country_code": "US",
"sms_channel_consents": [
{
"sms_consent_permission": "explicit",
"consent_type": "promotional_sms"
}
]
}
}
ERROR:config:Error response for *********** 400 Client Error: Bad Request for url: https://api.cc.email/v3/contacts/sign_up_form
ERROR:config:Error creating/updating contact for reger@blarg.net: 400 Client Error: Bad Request for url: https://api.cc.email/v3/contacts/sign_up_form
ERROR:config:Response body: [{"error_key":"contacts.api.validation.error","error_message":"sms_channel[sms_channel_consents][0][sms_consent_permission] does not have a valid value"}]

 

 

the documentation is conflicting and sometimes specify full_sms_address and sometimes sms_address as the place to put the mobile number.  However sms_address is what doesnt give me an error.   But I cant get past the above error on the sms_consent_permission which I have set to the exact same value as every other example and what I see on existing entries in my account.  The documentation overall is very poor and incomplete.

1 ACCEPTED SOLUTION
John__B
Employee
0 Votes

Hello user736688,

 

Thank you for reaching out to Constant Contact API Developer Support. My team is here to assist outside software developers with questions about building into Constant Contact's API.

 

We greatly appreciate your feedback regarding our documentation as your experience is essential to improving our product, so thank you for reaching out to us regarding this matter.

 

The contact SMS fields are formatted differently depending on the V3 endpoint that you’re using to import contacts. The “full_sms_address” field is used specifically for POST and PUT requests to the /contacts endpoint. For the /sign_up_form endpoint specifically, the SMS portion of the request body is formatted as follows:

 

"sms_channel": {

"sms_address": "7815551212",

"dial_code": "1",

"country_code": "US",

"sms_channel_consents": [

{

"sms_consent_permission": "pending_confirmation",

"consent_type": "promotional_sms",

"consent_medium_type": "LF",

"consent_medium_url": "https://lp.constantcontactpages.com/su/iPtuMuh",

"consent_medium_details": "Contact used our landing page to consent to SMS.",

"advertised_frequency": 1,

"advertised_interval": "weekly"

}

 

The likely cause of the error that you shared is that your request body did not contain the “consent_medium_type”, “consent_medium_url” and “consent_medium_details” fields, all of which are required for this endpoint. Below I’m including our API Reference documentation for this request.

 

Create or Update a Contact:

https://developer.constantcontact.com/api_reference/index.html#tag/Contacts/operation/createOrUpdate...

 

Please have a look and let us know if you have any other questions!

 

Regards,


John B.
API Support Specialist
Did I answer your question? If so, please mark my post as an "Accepted Solution" by clicking the Accept as Solution button in the bottom right hand corner of this post.

View solution in original post

1 REPLY 1
John__B
Employee
0 Votes

Hello user736688,

 

Thank you for reaching out to Constant Contact API Developer Support. My team is here to assist outside software developers with questions about building into Constant Contact's API.

 

We greatly appreciate your feedback regarding our documentation as your experience is essential to improving our product, so thank you for reaching out to us regarding this matter.

 

The contact SMS fields are formatted differently depending on the V3 endpoint that you’re using to import contacts. The “full_sms_address” field is used specifically for POST and PUT requests to the /contacts endpoint. For the /sign_up_form endpoint specifically, the SMS portion of the request body is formatted as follows:

 

"sms_channel": {

"sms_address": "7815551212",

"dial_code": "1",

"country_code": "US",

"sms_channel_consents": [

{

"sms_consent_permission": "pending_confirmation",

"consent_type": "promotional_sms",

"consent_medium_type": "LF",

"consent_medium_url": "https://lp.constantcontactpages.com/su/iPtuMuh",

"consent_medium_details": "Contact used our landing page to consent to SMS.",

"advertised_frequency": 1,

"advertised_interval": "weekly"

}

 

The likely cause of the error that you shared is that your request body did not contain the “consent_medium_type”, “consent_medium_url” and “consent_medium_details” fields, all of which are required for this endpoint. Below I’m including our API Reference documentation for this request.

 

Create or Update a Contact:

https://developer.constantcontact.com/api_reference/index.html#tag/Contacts/operation/createOrUpdate...

 

Please have a look and let us know if you have any other questions!

 

Regards,


John B.
API Support Specialist
Did I answer your question? If so, please mark my post as an "Accepted Solution" by clicking the Accept as Solution button in the bottom right hand corner of this post.
Resources
Developer Portal

View API documentation, code samples, get your API key.

Visit Page