Got a 'How do I' question? Join 'Ask a Trainer' Monday to Friday, 11am to 4pm ET for instant help and pro tips!

creating contact with custom field using API v3 not working

AndreaL3758
Rookie
0 Votes

Im using the API v3 to add or update a client, Im adding a custom_field and I get no error, just no custom field is entered.

this is my update json

{
    "email_address":  "John@smith.com",
    "first_name":  "John",
    "last_name":  "Smith",
    "update_source":  "Account",
    "list_memberships":  [
                             "81c141fa-4732-11ec-b72a-fa163ec17584",
                             "509470fa-5f71-11ec-bdd8-fa163e78853a"
                         ],
    "custom_fields":  [
                          {
                              "custom_field_id":  "72e8a1ca-48ac-11ec-a37a-fa163eae0edb",
                              "Value":  "11518"
                          }
                      ]
}
 

this is my create json

 

{
    "email_address":  {
                          "address":  "John@smith.com",
                          "permission_to_send":  "implicit"
                      },
    "first_name":  "John",
    "last_name":  "Smith",
    "create_source":  "Account",
    "list_memberships":  [
                             "81c141fa-4732-11ec-b72a-fa163ec17584",
                             "509470fa-5f71-11ec-bdd8-fa163e78853a"
                         ],
    "custom_fields":  [
                          {
                              "custom_field_id":  "72e8a1ca-48ac-11ec-a37a-fa163eae0edb",
                              "Value":  "11518"
                          }
                      ]
}

is something broken with the API?

1 REPLY 1
John__B
Employee
0 Votes

Hello AndreaL3758,

 

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.

 

The full format of the error is "custom_fields.{custom field name} is missing". In this instance, the name of the custom field associated with the custom_field_id you provided is "id". Based on the request body you provided it looks like the error is being caused by the “value” property being capitalized in your request when our system is expecting the property in lower case. I am including documentation on the full request which includes a body sample below:

 

PUT (update) a Contact:

https://developer.constantcontact.com/api_reference/index.html#!/Contacts/putContact

 

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

Announcements

API Updates

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

Sign Up