create contacts batch

Highlighted
New Contributor

Hello, 

 I am trying to create contacts in my account via API batch request and the contacts are not being created. I getting a 202 status code in response which should indicate that the request was fine, but still it not working 

 

this is my request json 

[
{
"vid": 3,
"properties": [
{
"property": "firstname",
"value": "Jeffrey"
},
{
"property": "lastname",
"value": "v"
},
{
"property": "pg_contact_id",
"value": 3
},
{
"property": "linkedin",
"value": ""
},
{
"property": "company",
"value": "PaperKarma"
},
{
"property": "verified",
"value": null
},
{
"property": "email",
"value": "jt@vexigo.com"
}
]
},
{
"vid": 4,
"properties": [
{
"property": "firstname",
"value": "pep"
},
{
"property": "lastname",
"value": ""
},
{
"property": "pg_contact_id",
"value": 4
},
{
"property": "linkedin",
"value": ""
},
{
"property": "company",
"value": "PaperKarma"
},
{
"property": "verified",
"value": null
},
{
"property": "email",
"value": "vexigo@vexigo.com"
}
]
}
]

Reply
0 Upvotes
1 Reply 1
Community Manager

Hi @vexigo,

 

I hope all is well with you 😄

 

When looking to create contacts using this endpoint: Create or update a group of contacts, you would use the vid property to identified existing contacts to update and the email property to identified contacts that may or may not exist to either update/create contacts.

 

In this case, when looking into your portal 6391833, I wouldn't able to locate any contacts with vid 3 or 4 and hence, the contacts wasn't updated. I understand that you're looking to create these contacts and so for this, you would have to change the POST body to something like this:

[
{
"email": "jt@vexigo.com",
"properties": [
{
"property": "firstname",
"value": "Jeffrey"
},
{
"property": "lastname",
"value": "v"
},
{
"property": "linkedin",
"value": ""
},
{
"property": "company",
"value": "PaperKarma"
}
]
},
{
"email": "vexigo@vexigo.com",
"properties": [
{
"property": "firstname",
"value": "pep"
},
{
"property": "lastname",
"value": ""
},
{
"property": "linkedin",
"value": ""
},
{
"property": "company",
"value": "PaperKarma"
}
]
}
]

I hope this helps to clarify!

Reply
0 Upvotes