error saying custom field is missing, but it is in my code

AndreaL3758
Rookie
0 Votes

Im getting this error , my code below shows I am entering the custom field id

 

[
  {
    "error_key": "contacts.api.validation.error",
    "error_message": "custom_fields.id is missing"
  }
]
{
"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"
                    }
                  ]
}
1 REPLY 1
Aarron_G
Moderator
0 Votes

Hello @AndreaL3758,

This post appears to be following up on your previous post, found here:
https://community.constantcontact.com/t5/Developer-Support-ask-questions/creating-contact-with-custo...

Thank you for providing the full error response you're receiving. The error is consistent with the solution provided in the other thread. For reference, I'm including that solution here:

@John__B wrote:

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,


Aarron G.
API Support Engineer
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