error:add contact from example code

SOLVED
Go to solution
Regular Participant

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
Regular Participant

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
Regular Participant

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.

Visit Page