error:add contact from example code

SOLVED
Highlighted
Occasional Contributor

error:add contact from example code

if i use the example code at add & update

 

{"email_addresses": [
"user1@example.com"
],
"first_name": "John",
"middle_name": "R",
"last_name": "Smith"}

 

in the io-docs - Add a Contact to the collection

 

i get :

[{
   
"error_key":"json.type.invalid",
   
"error_message":"#/email_addresses/0: Value is of a disallowed type. Allowed types are: Object."
}]

how does the JSON need to be formed?

 

is the example incorrect?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Occasional Contributor

Re: error:add contact from example code

nevermind it needs to look like this:

 

"email_addresses": ["user1@example.com"],
"first_name": "John",
"last_name": "Smith"

{"email_addresses": [
{"email_address": "user1@example.com"}
],
"first_name": "John",
"middle_name": "R",
"last_name": "Smith",
"lists": [
{
"id": "1"
}]}

View solution in original post

1 REPLY 1
Highlighted
Occasional Contributor

Re: error:add contact from example code

nevermind it needs to look like this:

 

"email_addresses": ["user1@example.com"],
"first_name": "John",
"last_name": "Smith"

{"email_addresses": [
{"email_address": "user1@example.com"}
],
"first_name": "John",
"middle_name": "R",
"last_name": "Smith",
"lists": [
{
"id": "1"
}]}

View solution in original post

Developer Portal

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

Constant Contact Would Like To Hear From You!

We want to hear from customers like you about your favorite features and how they have helped your business or organization. Tell us by answering a few questions in...

Read More
Featured