Import caller context
curl --request POST \
--url https://api.nixflex.com/v1/phone-numbers/{phone_number}/callers/importimport requests
url = "https://api.nixflex.com/v1/phone-numbers/{phone_number}/callers/import"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.nixflex.com/v1/phone-numbers/{phone_number}/callers/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://api.nixflex.com/v1/phone-numbers/{phone_number}/callers/import",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.nixflex.com/v1/phone-numbers/{phone_number}/callers/import"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.nixflex.com/v1/phone-numbers/{phone_number}/callers/import")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.nixflex.com/v1/phone-numbers/{phone_number}/callers/import")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyCaller context
Import caller context
POST /v1/phone-numbers/:phoneNumber/callers/import
POST
/
v1
/
phone-numbers
/
{phone_number}
/
callers
/
import
Import caller context
curl --request POST \
--url https://api.nixflex.com/v1/phone-numbers/{phone_number}/callers/importimport requests
url = "https://api.nixflex.com/v1/phone-numbers/{phone_number}/callers/import"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.nixflex.com/v1/phone-numbers/{phone_number}/callers/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://api.nixflex.com/v1/phone-numbers/{phone_number}/callers/import",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.nixflex.com/v1/phone-numbers/{phone_number}/callers/import"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.nixflex.com/v1/phone-numbers/{phone_number}/callers/import")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.nixflex.com/v1/phone-numbers/{phone_number}/callers/import")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyLoads many caller records onto one of your numbers in a single request - your existing customer list, so the agent knows them from the first call.
Row errors name the row:
Request
curl -X POST https://api.nixflex.com/v1/phone-numbers/+447450307843/callers/import \
-H "Authorization: Bearer KEY_ID:KEY_SECRET" \
-H "Content-Type: application/json" \
-d '{
"callers": [
{ "caller_number": "+447453573770", "name": "Sam Carter", "email": "sam.carter@example.com", "reference_id": "4827" },
{ "caller_number": "+447700900002", "name": "Priya Shah", "email": "priya.shah@example.com", "preference": "prefers afternoon appointments" }
]
}'
Body parameters
| Field | Type | Required | Notes |
|---|---|---|---|
callers | array | Yes | 1 to 1,000 rows. Each row takes caller_number plus any of the fields on Set caller context. |
callers[].caller_number | string | Yes | The caller’s number in E.164 form. A leading + is added if you leave it out. |
Response
200 OK
{
"phone_number": "+447450307843",
"imported": 2
}
Behaviour
- Every row is checked before any row is written. One bad row rejects the whole request, so you never end up half-imported.
- A repeated caller in the same file simply ends on its last row.
- Existing records are merged, not replaced - a field you leave out keeps its current value, exactly as on Set caller context.
- Per number. To recognise the same customers on a second number, import them again for that number.
- More than 1,000 rows: split into several requests. The standard rate limits apply.
Errors
| Code | Cause |
|---|---|
phone_number_not_found | The number is not on this account |
invalid_body | callers missing, not an array, or empty |
too_many_rows | More than 1,000 rows in one request |
missing_field | A row has no caller_number, or no fields to set |
engine_only_field | A row contains last_call or open_item |
unknown_field | A row contains an unrecognised field name |
invalid_email | A row has an invalid email |
field_too_long | A row has a value over its maximum length |
Row 7: email is not a valid address.