Reading the documentation for the API end points create contact and bulk import use a different
json definition for the same object.
So If I create one contact the name is stored in firstName and if import them in bulk i need to change the field to first_name ?
Also in the bulk doc, there is a reference to the contact object having a “subscribe” array ?
Can I use this in single create contact ?
Going back to the bulk import doc, there is also a reference to contact object having an "“unsubscribe” array. I could see using this in contact update, but this is an import (new contact), what is he being unsubscribed from ?
In many places the doc uses strings for some field in one place and int in others.
for example field id in contacts, in bulk is int, but in update and create is string, and in fieldCreate is an int again.
in the contact create the field phone is documented as int, but it takes and its string.
can bulk import update existing users, i dont see the id of the contact being passed as i see in update contact
So If I create one contact the name is stored in firstName and if import them in bulk i need to change the field to first_name ?
Unfortunately you are correct, the key naming is not consistent, and will be brought to the dev team’s attention.
Also in the bulk doc, there is a reference to the contact object having a “subscribe” array ? Can I use this in single create contact ?
The subscribe array is available on contact creation, if you use the v1 api endpoint which is still supported. API Examples Using contact_add the subscription array (of integers) is called "p"
The subscribe
array is not a field available on the individual create contact v3 POST endpoint.
Going back to the bulk import doc, there is also a reference to contact object having an “unsubscribe” array. I could see using this in contact update, but this is an import (new contact), what is he being unsubscribed from ?
This is an “upcert” it’s for bulk import and you just want to make sure users are subscribed to some lists, and unsubscribed to others. It may be redundant.
In many places the doc uses strings for some field in one place and int in others. For example field id in contacts, in bulk is int, but in update and create is string, and in fieldCreate is an int again.
For the endpoints I’ve tested, you can pass an int or a string. You should generally use ints for numbers.
…in the contact create the field phone is documented as int, but it takes and its string.
Different users require their phone numbers in different formats. Therefore, the create contact POST endpoint can be sent phone
in a string OR an integer. For example:
INT: "phone": 1112223333
will show up as 1112223333
in the contact record*
STRING: "phone": "1112223333"
will show up as 1112223333
in the contact record
STRING (v2): "phone": "(111) 222-3333"
will show up as “(111) 222-3333”` in the contact record.
In other words, if characters like ()
or -
need to be part of the phone number, send the phone number as a string.
can bulk import update existing users, i don’t see the id of the contact being passed as i see in update contact
This also an upcert function, a contact will either be created or updated, unless it already exists, in which case it will be skipped: Here are the requirements: Bulk import contacts
You may want to look at using the contact_sync
v1 API method. This endpoint allows you to syncing Contact data, assigning the Contact to a List, and adding tags to the Contact all with a single API call.
Thank you so much for taking the time to answer.