Contacts
Import contacts from a file
POST
/
v1
/
contacts
/
import
Import contacts from a file
curl --request POST \
--url https://app.chatbotx.io/api/v1/contacts/import \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"fileId": "<string>",
"inboxId": "<string>",
"countryCode": "<string>",
"phoneNumber": "<string>",
"contactId": "<string>",
"email": "<string>",
"firstName": "<string>",
"lastName": "<string>",
"tagId": "<string>",
"fieldMapping": [
{
"column": "<string>",
"customFieldId": "<string>"
}
]
}
'import requests
url = "https://app.chatbotx.io/api/v1/contacts/import"
payload = {
"fileId": "<string>",
"inboxId": "<string>",
"countryCode": "<string>",
"phoneNumber": "<string>",
"contactId": "<string>",
"email": "<string>",
"firstName": "<string>",
"lastName": "<string>",
"tagId": "<string>",
"fieldMapping": [
{
"column": "<string>",
"customFieldId": "<string>"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
fileId: '<string>',
inboxId: '<string>',
countryCode: '<string>',
phoneNumber: '<string>',
contactId: '<string>',
email: '<string>',
firstName: '<string>',
lastName: '<string>',
tagId: '<string>',
fieldMapping: [{column: '<string>', customFieldId: '<string>'}]
})
};
fetch('https://app.chatbotx.io/api/v1/contacts/import', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.chatbotx.io/api/v1/contacts/import",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'fileId' => '<string>',
'inboxId' => '<string>',
'countryCode' => '<string>',
'phoneNumber' => '<string>',
'contactId' => '<string>',
'email' => '<string>',
'firstName' => '<string>',
'lastName' => '<string>',
'tagId' => '<string>',
'fieldMapping' => [
[
'column' => '<string>',
'customFieldId' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.chatbotx.io/api/v1/contacts/import"
payload := strings.NewReader("{\n \"fileId\": \"<string>\",\n \"inboxId\": \"<string>\",\n \"countryCode\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"contactId\": \"<string>\",\n \"email\": \"<string>\",\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"tagId\": \"<string>\",\n \"fieldMapping\": [\n {\n \"column\": \"<string>\",\n \"customFieldId\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.chatbotx.io/api/v1/contacts/import")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"fileId\": \"<string>\",\n \"inboxId\": \"<string>\",\n \"countryCode\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"contactId\": \"<string>\",\n \"email\": \"<string>\",\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"tagId\": \"<string>\",\n \"fieldMapping\": [\n {\n \"column\": \"<string>\",\n \"customFieldId\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.chatbotx.io/api/v1/contacts/import")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"fileId\": \"<string>\",\n \"inboxId\": \"<string>\",\n \"countryCode\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"contactId\": \"<string>\",\n \"email\": \"<string>\",\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"tagId\": \"<string>\",\n \"fieldMapping\": [\n {\n \"column\": \"<string>\",\n \"customFieldId\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body"<unknown>"Authorizations
developerAccessTokentokenInSearchParams
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Pattern:
\d+Available options:
omnichannel, webchat, messenger, whatsapp, zalo, smtp, telegram, instagram, tiktok Pattern:
\d+Pattern:
^\+\d{1,4}$Maximum string length:
255Maximum string length:
255Maximum string length:
255Maximum string length:
255Maximum string length:
255Pattern:
\d+Maximum array length:
10Show child attributes
Show child attributes
Response
201 - application/json
OK
The response is of type any.
Was this page helpful?
⌘I
Import contacts from a file
curl --request POST \
--url https://app.chatbotx.io/api/v1/contacts/import \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"fileId": "<string>",
"inboxId": "<string>",
"countryCode": "<string>",
"phoneNumber": "<string>",
"contactId": "<string>",
"email": "<string>",
"firstName": "<string>",
"lastName": "<string>",
"tagId": "<string>",
"fieldMapping": [
{
"column": "<string>",
"customFieldId": "<string>"
}
]
}
'import requests
url = "https://app.chatbotx.io/api/v1/contacts/import"
payload = {
"fileId": "<string>",
"inboxId": "<string>",
"countryCode": "<string>",
"phoneNumber": "<string>",
"contactId": "<string>",
"email": "<string>",
"firstName": "<string>",
"lastName": "<string>",
"tagId": "<string>",
"fieldMapping": [
{
"column": "<string>",
"customFieldId": "<string>"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
fileId: '<string>',
inboxId: '<string>',
countryCode: '<string>',
phoneNumber: '<string>',
contactId: '<string>',
email: '<string>',
firstName: '<string>',
lastName: '<string>',
tagId: '<string>',
fieldMapping: [{column: '<string>', customFieldId: '<string>'}]
})
};
fetch('https://app.chatbotx.io/api/v1/contacts/import', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.chatbotx.io/api/v1/contacts/import",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'fileId' => '<string>',
'inboxId' => '<string>',
'countryCode' => '<string>',
'phoneNumber' => '<string>',
'contactId' => '<string>',
'email' => '<string>',
'firstName' => '<string>',
'lastName' => '<string>',
'tagId' => '<string>',
'fieldMapping' => [
[
'column' => '<string>',
'customFieldId' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.chatbotx.io/api/v1/contacts/import"
payload := strings.NewReader("{\n \"fileId\": \"<string>\",\n \"inboxId\": \"<string>\",\n \"countryCode\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"contactId\": \"<string>\",\n \"email\": \"<string>\",\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"tagId\": \"<string>\",\n \"fieldMapping\": [\n {\n \"column\": \"<string>\",\n \"customFieldId\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.chatbotx.io/api/v1/contacts/import")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"fileId\": \"<string>\",\n \"inboxId\": \"<string>\",\n \"countryCode\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"contactId\": \"<string>\",\n \"email\": \"<string>\",\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"tagId\": \"<string>\",\n \"fieldMapping\": [\n {\n \"column\": \"<string>\",\n \"customFieldId\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.chatbotx.io/api/v1/contacts/import")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"fileId\": \"<string>\",\n \"inboxId\": \"<string>\",\n \"countryCode\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"contactId\": \"<string>\",\n \"email\": \"<string>\",\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"tagId\": \"<string>\",\n \"fieldMapping\": [\n {\n \"column\": \"<string>\",\n \"customFieldId\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body"<unknown>"