Batch people update
curl --request PATCH \
--url https://api.messaging.phonovation.com/people/2/persons/batch \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"people": [
{
"query": {
"identifier": "dab3a9cf-e8d0-42cf-9b2b-4745a8fff",
"type": "EXTERNAL_ID"
},
"update": {
"firstName": "Jack",
"lastName": "Smith",
"customAttributes": {
"displayName": "jacky"
},
"contactInformation": {
"phone": [
{
"number": "353861234592"
}
]
}
}
},
{
"query": {
"identifier": "353861234579",
"type": "PHONE"
},
"update": {
"firstName": "Jane",
"lastName": "Smith"
}
}
]
}
'import requests
url = "https://api.messaging.phonovation.com/people/2/persons/batch"
payload = { "people": [
{
"query": {
"identifier": "dab3a9cf-e8d0-42cf-9b2b-4745a8fff",
"type": "EXTERNAL_ID"
},
"update": {
"firstName": "Jack",
"lastName": "Smith",
"customAttributes": { "displayName": "jacky" },
"contactInformation": { "phone": [{ "number": "353861234592" }] }
}
},
{
"query": {
"identifier": "353861234579",
"type": "PHONE"
},
"update": {
"firstName": "Jane",
"lastName": "Smith"
}
}
] }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)using RestSharp;
var options = new RestClientOptions("https://api.messaging.phonovation.com/people/2/persons/batch");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "<api-key>");
request.AddJsonBody("{\n \"people\": [\n {\n \"query\": {\n \"identifier\": \"dab3a9cf-e8d0-42cf-9b2b-4745a8fff\",\n \"type\": \"EXTERNAL_ID\"\n },\n \"update\": {\n \"firstName\": \"Jack\",\n \"lastName\": \"Smith\",\n \"customAttributes\": {\n \"displayName\": \"jacky\"\n },\n \"contactInformation\": {\n \"phone\": [\n {\n \"number\": \"353861234592\"\n }\n ]\n }\n }\n },\n {\n \"query\": {\n \"identifier\": \"353861234579\",\n \"type\": \"PHONE\"\n },\n \"update\": {\n \"firstName\": \"Jane\",\n \"lastName\": \"Smith\"\n }\n }\n ]\n}", false);
var response = await client.PatchAsync(request);
Console.WriteLine("{0}", response.Content);
HttpResponse<String> response = Unirest.patch("https://api.messaging.phonovation.com/people/2/persons/batch")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"people\": [\n {\n \"query\": {\n \"identifier\": \"dab3a9cf-e8d0-42cf-9b2b-4745a8fff\",\n \"type\": \"EXTERNAL_ID\"\n },\n \"update\": {\n \"firstName\": \"Jack\",\n \"lastName\": \"Smith\",\n \"customAttributes\": {\n \"displayName\": \"jacky\"\n },\n \"contactInformation\": {\n \"phone\": [\n {\n \"number\": \"353861234592\"\n }\n ]\n }\n }\n },\n {\n \"query\": {\n \"identifier\": \"353861234579\",\n \"type\": \"PHONE\"\n },\n \"update\": {\n \"firstName\": \"Jane\",\n \"lastName\": \"Smith\"\n }\n }\n ]\n}")
.asString();<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.messaging.phonovation.com/people/2/persons/batch",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'people' => [
[
'query' => [
'identifier' => 'dab3a9cf-e8d0-42cf-9b2b-4745a8fff',
'type' => 'EXTERNAL_ID'
],
'update' => [
'firstName' => 'Jack',
'lastName' => 'Smith',
'customAttributes' => [
'displayName' => 'jacky'
],
'contactInformation' => [
'phone' => [
[
'number' => '353861234592'
]
]
]
]
],
[
'query' => [
'identifier' => '353861234579',
'type' => 'PHONE'
],
'update' => [
'firstName' => 'Jane',
'lastName' => 'Smith'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
people: [
{
query: {identifier: 'dab3a9cf-e8d0-42cf-9b2b-4745a8fff', type: 'EXTERNAL_ID'},
update: {
firstName: 'Jack',
lastName: 'Smith',
customAttributes: {displayName: 'jacky'},
contactInformation: {phone: [{number: '353861234592'}]}
}
},
{
query: {identifier: '353861234579', type: 'PHONE'},
update: {firstName: 'Jane', lastName: 'Smith'}
}
]
})
};
fetch('https://api.messaging.phonovation.com/people/2/persons/batch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"results": [
{
"errors": [
{
"message": "There is no person matching the query"
}
],
"status": 409,
"query": {
"type": "PHONE",
"identifier": "353861234579"
}
}
]
}{
"results": [
{
"errors": [
{
"message": "There is no person matching the query"
}
],
"status": 409,
"query": {
"type": "PHONE",
"identifier": "353861234579"
}
}
]
}{
"requestError": {
"serviceException": {
"messageId": "BAD_REQUEST",
"text": "Bad request"
}
}
}{
"requestError": {
"serviceException": {
"messageId": "UNAUTHORIZED",
"text": "Unauthorized"
}
}
}{
"requestError": {
"serviceException": {
"messageId": "FORBIDDEN",
"text": "Forbidden"
}
}
}{
"requestError": {
"serviceException": {
"messageId": "TOO_MANY_REQUESTS",
"text": "Too many requests"
}
}
}{
"requestError": {
"serviceException": {
"messageId": "GENERAL_ERROR",
"text": "Something went wrong. Please contact support."
}
}
}{
"requestError": {
"serviceException": {
"messageId": "<string>",
"text": "<string>"
}
}
}{
"requestError": {
"serviceException": {
"messageId": "<string>",
"text": "<string>"
}
}
}customer-engagement
Batch people update
Use this method to update multiple person profiles with the data passed in the request body as follows:<br>1. New values for standard and custom profile attributes replace existing values on the profile. If no value is passed in the request, the attribute keeps its value.<br>2. Tags in the request are appended to the profile tag list.<br>3. New contact information (email addresses and phone numbers) in the request is appended to the contact list of the profile.<br>**NOTE** Array size of the batch update request is limited to `1000` persons.
**Required scope:** Enable one of: `people:manage`.
PATCH
/
people
/
2
/
persons
/
batch
Batch people update
curl --request PATCH \
--url https://api.messaging.phonovation.com/people/2/persons/batch \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"people": [
{
"query": {
"identifier": "dab3a9cf-e8d0-42cf-9b2b-4745a8fff",
"type": "EXTERNAL_ID"
},
"update": {
"firstName": "Jack",
"lastName": "Smith",
"customAttributes": {
"displayName": "jacky"
},
"contactInformation": {
"phone": [
{
"number": "353861234592"
}
]
}
}
},
{
"query": {
"identifier": "353861234579",
"type": "PHONE"
},
"update": {
"firstName": "Jane",
"lastName": "Smith"
}
}
]
}
'import requests
url = "https://api.messaging.phonovation.com/people/2/persons/batch"
payload = { "people": [
{
"query": {
"identifier": "dab3a9cf-e8d0-42cf-9b2b-4745a8fff",
"type": "EXTERNAL_ID"
},
"update": {
"firstName": "Jack",
"lastName": "Smith",
"customAttributes": { "displayName": "jacky" },
"contactInformation": { "phone": [{ "number": "353861234592" }] }
}
},
{
"query": {
"identifier": "353861234579",
"type": "PHONE"
},
"update": {
"firstName": "Jane",
"lastName": "Smith"
}
}
] }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)using RestSharp;
var options = new RestClientOptions("https://api.messaging.phonovation.com/people/2/persons/batch");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "<api-key>");
request.AddJsonBody("{\n \"people\": [\n {\n \"query\": {\n \"identifier\": \"dab3a9cf-e8d0-42cf-9b2b-4745a8fff\",\n \"type\": \"EXTERNAL_ID\"\n },\n \"update\": {\n \"firstName\": \"Jack\",\n \"lastName\": \"Smith\",\n \"customAttributes\": {\n \"displayName\": \"jacky\"\n },\n \"contactInformation\": {\n \"phone\": [\n {\n \"number\": \"353861234592\"\n }\n ]\n }\n }\n },\n {\n \"query\": {\n \"identifier\": \"353861234579\",\n \"type\": \"PHONE\"\n },\n \"update\": {\n \"firstName\": \"Jane\",\n \"lastName\": \"Smith\"\n }\n }\n ]\n}", false);
var response = await client.PatchAsync(request);
Console.WriteLine("{0}", response.Content);
HttpResponse<String> response = Unirest.patch("https://api.messaging.phonovation.com/people/2/persons/batch")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"people\": [\n {\n \"query\": {\n \"identifier\": \"dab3a9cf-e8d0-42cf-9b2b-4745a8fff\",\n \"type\": \"EXTERNAL_ID\"\n },\n \"update\": {\n \"firstName\": \"Jack\",\n \"lastName\": \"Smith\",\n \"customAttributes\": {\n \"displayName\": \"jacky\"\n },\n \"contactInformation\": {\n \"phone\": [\n {\n \"number\": \"353861234592\"\n }\n ]\n }\n }\n },\n {\n \"query\": {\n \"identifier\": \"353861234579\",\n \"type\": \"PHONE\"\n },\n \"update\": {\n \"firstName\": \"Jane\",\n \"lastName\": \"Smith\"\n }\n }\n ]\n}")
.asString();<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.messaging.phonovation.com/people/2/persons/batch",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'people' => [
[
'query' => [
'identifier' => 'dab3a9cf-e8d0-42cf-9b2b-4745a8fff',
'type' => 'EXTERNAL_ID'
],
'update' => [
'firstName' => 'Jack',
'lastName' => 'Smith',
'customAttributes' => [
'displayName' => 'jacky'
],
'contactInformation' => [
'phone' => [
[
'number' => '353861234592'
]
]
]
]
],
[
'query' => [
'identifier' => '353861234579',
'type' => 'PHONE'
],
'update' => [
'firstName' => 'Jane',
'lastName' => 'Smith'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
people: [
{
query: {identifier: 'dab3a9cf-e8d0-42cf-9b2b-4745a8fff', type: 'EXTERNAL_ID'},
update: {
firstName: 'Jack',
lastName: 'Smith',
customAttributes: {displayName: 'jacky'},
contactInformation: {phone: [{number: '353861234592'}]}
}
},
{
query: {identifier: '353861234579', type: 'PHONE'},
update: {firstName: 'Jane', lastName: 'Smith'}
}
]
})
};
fetch('https://api.messaging.phonovation.com/people/2/persons/batch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"results": [
{
"errors": [
{
"message": "There is no person matching the query"
}
],
"status": 409,
"query": {
"type": "PHONE",
"identifier": "353861234579"
}
}
]
}{
"results": [
{
"errors": [
{
"message": "There is no person matching the query"
}
],
"status": 409,
"query": {
"type": "PHONE",
"identifier": "353861234579"
}
}
]
}{
"requestError": {
"serviceException": {
"messageId": "BAD_REQUEST",
"text": "Bad request"
}
}
}{
"requestError": {
"serviceException": {
"messageId": "UNAUTHORIZED",
"text": "Unauthorized"
}
}
}{
"requestError": {
"serviceException": {
"messageId": "FORBIDDEN",
"text": "Forbidden"
}
}
}{
"requestError": {
"serviceException": {
"messageId": "TOO_MANY_REQUESTS",
"text": "Too many requests"
}
}
}{
"requestError": {
"serviceException": {
"messageId": "GENERAL_ERROR",
"text": "Something went wrong. Please contact support."
}
}
}{
"requestError": {
"serviceException": {
"messageId": "<string>",
"text": "<string>"
}
}
}{
"requestError": {
"serviceException": {
"messageId": "<string>",
"text": "<string>"
}
}
}Authorizations
This is the most secure authorization type and the one with the most flexibility.
API keys can be generated by calling the dedicated API method. Furthermore, API keys can have a limited scope and cover only some API methods. Lastly, they can be revoked at any time. This range of possibilities makes API keys well suited for separating the API access rights across multiple applications or use cases. Finally, the loss of an API key is easily manageable.
You can manage your API keys from GUI, or programmatically with dedicated API.
API key Authorization header example:
Authorization: App 003026bbc133714df1834b8638bb496e-8f4b3d9a-e931-478d-a994-28a725159ab9