Creating contact with phone numbers

jonl527
Rookie
0 Votes

I'm creating a contact with the v3 api (POST to /v3/contacts), and I get a 201 response. But when I look at the contact record that was created via GET to that same endpoint, I see the record with the email address, but no phone numbers associated. Have even tried GET to https://api.cc.email/v3/contacts?include=phone_numbers and I see a phone_numbers array on the record but it is empty. What can I do to ensure that I'm adding a phone number during contact creation properly? Thanks!

 

REQUEST:

{
  "email_address" : {
    "address": "testwithphone2@example.com",
    "permission_to_send": "implicit"
  },
  "create_source": "Contact",
  "phone numbers": [
    {
      "phone_number": "2123334444",
      "kind": "mobile",
      "create_source": "Contact"
    }
  ]
}
 
RESPONSE (201 Created):
{
  "contact_id": "5bbbb590-2229-11ec-98af-fa163e3c5d75",
  "email_address": {
    "address": "testwithphone2@example.com",
    "permission_to_send": "explicit",
    "created_at": "2021-09-30T20:02:36Z",
    "updated_at": "2021-09-30T20:02:36Z",
    "opt_in_source": "Contact",
    "opt_in_date": "2021-09-30T20:02:36+00:00",
    "confirm_status": "off"
  },
  "create_source": "Contact",
  "created_at": "2021-09-30T20:02:36Z",
  "updated_at": "2021-09-30T20:02:36Z"
}
1 REPLY 1
Caleb_A
Employee
0 Votes

Hello,

 

My name is Caleb and I am a member of Constant Contact's API Support Team.

 

After reviewing the request provided I have been able to identify the cause of this issue as having a missing underscore for 'phone_numbers": ['. This allowed for the system to successfully create the contact record (201 success) however it prevented the creation of the phone number field as there was no matching label due to the missing underscore. I am able to confirm that once correcting the request to include the underscore that this now creates the contact correctly and shouldn't pose any further issues.


Regards,

Caleb A.
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

Announcements

API Updates

Join our list to be notified of new features and updates to our V3 API.

Sign Up