Batch create contacts

POST https://contacts.8x8.com/api/v1/accounts/:accountId/contacts/batches/createContacts

Batch create contacts using file. The file can be either CSV or Excel. The CSV file can contain a header row (the mapping of the columns will be automatic in this case), or not. For files without a header, the fileColumns property should be specified for a columns mapping.

Request

Path Parameters

    accountId stringrequired

    Possible values: >= 32 characters and <= 36 characters, Value must match regular expression ^[0-9A-Fa-f]{8}[-]?(?:[0-9A-Fa-f]{4}[-]?){3}[0-9A-Fa-f]{12}$

    You must replace {accountId} with the accountid that you want to use.

Body

    fileobjectrequired

    Binary content of the file.

    The file size is limited to 30 Mb.

    groupsstring

    Comma-separated list of group id (integer) to add contacts to.

    You can add contacts to 10 groups max.

    Example: 11566,88996
    fileHasHeaderboolean

    Set this property 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

    Default value: true
    fileColumnsstring

    Comma-separated list of columns.

    This field is mandatory is fileHasHeader is false

    Example: msisdn, firstName, lastName

Accepted

Schema

    fileNamestring

    Name of the uploaded file

    fileTypestring

    Type of the uploaded file

    Possible values: [csv, xls]

    fileLocationstring

    URL of the uploaded file

    idstring<uuid>

    Batch id. Use this value to request batch status.

    typeBatch type (string)

    The type of the batch job

    Possible values: [createContacts, deleteContacts, copyContacts, moveContacts, deleteGroups]

    statusBatch Status (string)

    The status of the batch job

    Possible values: [queued, inProgress, failed, completed, stopped, timeout]

    createdAtstring

    Created time

    Possible values: non-empty

{
"fileName":"string",
"fileType":"csv",
"fileLocation":"string",
"id":"3fa85f64-5717-4562-b3fc-2c963f66afa6",
"type":"createContacts",
"status":"queued",
"createdAt":"string"
}

Bad request error response

Schema

    codeintegerrequired

    Error code

    messagestring

    Error description

    errorIdstring<uuid>required

    Unique id of error. You can use it as reference when sending enquiries to 8x8 support

    timestampstring<date-time>required

    Data and time of the error occurence

{
"code":1001,
"message":"Provided subAccountId doesn't belongs to your account",
"errorId":"91b106f0-c0da-4aba-a43a-7af9c5893a80",
"timestamp":"2017-04-19T02:31:19.4297387+00:00"
}
{
"code":1002,
"message":"Invalid MSISDN format (not E.164 international number)",
"errorId":"b4478860-b76c-e811-814e-022a35cc1c71",
"timestamp":"2018-08-04T09:25:40.9235752+00:00"
}

Source: https://developer.8x8.com/connect/reference/batch-upload-contacts · 8x8 CPaaS Developer Docs. Synced for support deflection.

Was this article helpful?
or
0 out of 0 found this helpful

0 Comments

Please sign in to leave a comment.

Didn't find what you were looking for?

Submit a request