You need to upload contacts from the file.
Request:
POST /accounts/{accountId}/contacts/batches/createContacts
Request body:
Format: multipart form-data
Property name | Property type | Description |
---|---|---|
file | binary content | Required File type should be CSV,TXT or XLS. The file size limit is 30Mb. |
groups | string | Comma-separatd list of group id(integer) to add. |
fileHasHeader | bool | Set to true if provided file has a header row. The header row will be parsed automatically, you don’t need to provide a list of columns in this case. Default value is true |
fileColumns | string | Comma-separated list of columns. Example: msisdn, firstName, lastName |
The uploaded file can have the following columns (names case-insensitive):
- MSISDN required column
- FirstName
- LastName
- Country
- ExternalId
- WeChatUserId
- FacebookUserId
- ZaloId
- LineId
- KakaoTalkId
Response:
Returns 202 Accepted
status code with batch information body:
Property name | Property type | Description |
---|---|---|
id | string (UUID) | Batch id. You can use this to request batch status. |
fileName | string | Name of the uploaded file |
fileType | string | Type of the uploaded file Possible value: csv xls *txt |
fileLocation | string | URL of the uploaded file |
status | string(enum) | Batch status. Possible values: queued inProgress failed completed stopped timeout |
totalRows | int | Total rows in uploaded file |
errorRows | int | Rows with errors |
duplicateRows | int | Number of duplicate contacts |
insertedRows | int | Number of contacts added or inserted |
contactGroups | int | Number of contacts added to a group |
createdAt | datetime | Batch job creation time |
Examples
Request examples:
Example of CSV file with headers that will be parsed automatically:
msisdn,firstname,lastname
639988618108,Praksmix,Onthemix
639325981131,Glenn,Pagaduan
639989943162,Ronald ,Gem
639326303383,Rocky,Coronel
639422919024,Prokopyo,Tumambling
For the following file fileHeader:
should be set to false
and fileColumns:
should set "msisdn, firstName, lastName" or you can only specify "msisdn"
Take note columns should be set in this order msisdn(required),firstName,lastName(both are optional)
639988618108,Praksmix,Onthemix
639325981131,Glenn,Pagaduan
639989943162,Ronald ,Gem
639326303383,Rocky,Coronel
639422919024,Prokopyo,Tumambling