Update Contact
Update a contact belonging to the account using ID
PUT
/
api
/
v1
/
accounts
/
{account_id}
/
contacts
/
{id}
Update Contact
curl --request PUT \
--url https://chat.wiseapp360.com/api/v1/accounts/{account_id}/contacts/{id} \
--header 'Content-Type: application/json' \
--header 'api_access_token: <api-key>' \
--data '
{
"name": "Alice",
"email": "alice@acme.inc",
"blocked": false,
"ignore_greeting": false,
"ignore_csat": false,
"ignore_agent_name": false,
"phone_number": "+123456789",
"avatar": "https://example.com/resource",
"avatar_url": "https://example.com/avatar.png",
"identifier": "1234567890",
"additional_attributes": {
"type": "customer",
"age": 30
},
"custom_attributes": {
"source": "api",
"segment": "enterprise"
}
}
'const options = {
method: 'PUT',
headers: {api_access_token: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Alice',
email: 'alice@acme.inc',
blocked: false,
ignore_greeting: false,
ignore_csat: false,
ignore_agent_name: false,
phone_number: '+123456789',
avatar: 'https://example.com/resource',
avatar_url: 'https://example.com/avatar.png',
identifier: '1234567890',
additional_attributes: {type: 'customer', age: 30},
custom_attributes: {source: 'api', segment: 'enterprise'}
})
};
fetch('https://chat.wiseapp360.com/api/v1/accounts/{account_id}/contacts/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://chat.wiseapp360.com/api/v1/accounts/{account_id}/contacts/{id}"
payload = {
"name": "Alice",
"email": "alice@acme.inc",
"blocked": False,
"ignore_greeting": False,
"ignore_csat": False,
"ignore_agent_name": False,
"phone_number": "+123456789",
"avatar": "https://example.com/resource",
"avatar_url": "https://example.com/avatar.png",
"identifier": "1234567890",
"additional_attributes": {
"type": "customer",
"age": 30
},
"custom_attributes": {
"source": "api",
"segment": "enterprise"
}
}
headers = {
"api_access_token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://chat.wiseapp360.com/api/v1/accounts/{account_id}/contacts/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Alice',
'email' => 'alice@acme.inc',
'blocked' => false,
'ignore_greeting' => false,
'ignore_csat' => false,
'ignore_agent_name' => false,
'phone_number' => '+123456789',
'avatar' => 'https://example.com/resource',
'avatar_url' => 'https://example.com/avatar.png',
'identifier' => '1234567890',
'additional_attributes' => [
'type' => 'customer',
'age' => 30
],
'custom_attributes' => [
'source' => 'api',
'segment' => 'enterprise'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"api_access_token: <api-key>"
],
]);
$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://chat.wiseapp360.com/api/v1/accounts/{account_id}/contacts/{id}"
payload := strings.NewReader("{\n \"name\": \"Alice\",\n \"email\": \"alice@acme.inc\",\n \"blocked\": false,\n \"ignore_greeting\": false,\n \"ignore_csat\": false,\n \"ignore_agent_name\": false,\n \"phone_number\": \"+123456789\",\n \"avatar\": \"https://example.com/resource\",\n \"avatar_url\": \"https://example.com/avatar.png\",\n \"identifier\": \"1234567890\",\n \"additional_attributes\": {\n \"type\": \"customer\",\n \"age\": 30\n },\n \"custom_attributes\": {\n \"source\": \"api\",\n \"segment\": \"enterprise\"\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("api_access_token", "<api-key>")
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.put("https://chat.wiseapp360.com/api/v1/accounts/{account_id}/contacts/{id}")
.header("api_access_token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Alice\",\n \"email\": \"alice@acme.inc\",\n \"blocked\": false,\n \"ignore_greeting\": false,\n \"ignore_csat\": false,\n \"ignore_agent_name\": false,\n \"phone_number\": \"+123456789\",\n \"avatar\": \"https://example.com/resource\",\n \"avatar_url\": \"https://example.com/avatar.png\",\n \"identifier\": \"1234567890\",\n \"additional_attributes\": {\n \"type\": \"customer\",\n \"age\": 30\n },\n \"custom_attributes\": {\n \"source\": \"api\",\n \"segment\": \"enterprise\"\n }\n}")
.asString();{
"payload": {
"additional_attributes": {
"city": "Sample text",
"country": "Sample text",
"country_code": "Sample text",
"created_at_ip": "Sample text"
},
"availability_status": "online",
"email": "agent@example.com",
"id": 1,
"name": "Sample resource",
"phone_number": "+15551234567",
"blocked": true,
"identifier": "Sample text",
"thumbnail": "Sample text",
"custom_attributes": {
"source": "api",
"segment": "enterprise"
},
"last_activity_at": 1,
"created_at": 1
}
}{
"error": "Forbidden"
}{
"error": "Resource not found"
}Autorizações
Parâmetros de caminho
Corpo
application/json
⌘I
Update Contact
curl --request PUT \
--url https://chat.wiseapp360.com/api/v1/accounts/{account_id}/contacts/{id} \
--header 'Content-Type: application/json' \
--header 'api_access_token: <api-key>' \
--data '
{
"name": "Alice",
"email": "alice@acme.inc",
"blocked": false,
"ignore_greeting": false,
"ignore_csat": false,
"ignore_agent_name": false,
"phone_number": "+123456789",
"avatar": "https://example.com/resource",
"avatar_url": "https://example.com/avatar.png",
"identifier": "1234567890",
"additional_attributes": {
"type": "customer",
"age": 30
},
"custom_attributes": {
"source": "api",
"segment": "enterprise"
}
}
'const options = {
method: 'PUT',
headers: {api_access_token: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Alice',
email: 'alice@acme.inc',
blocked: false,
ignore_greeting: false,
ignore_csat: false,
ignore_agent_name: false,
phone_number: '+123456789',
avatar: 'https://example.com/resource',
avatar_url: 'https://example.com/avatar.png',
identifier: '1234567890',
additional_attributes: {type: 'customer', age: 30},
custom_attributes: {source: 'api', segment: 'enterprise'}
})
};
fetch('https://chat.wiseapp360.com/api/v1/accounts/{account_id}/contacts/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://chat.wiseapp360.com/api/v1/accounts/{account_id}/contacts/{id}"
payload = {
"name": "Alice",
"email": "alice@acme.inc",
"blocked": False,
"ignore_greeting": False,
"ignore_csat": False,
"ignore_agent_name": False,
"phone_number": "+123456789",
"avatar": "https://example.com/resource",
"avatar_url": "https://example.com/avatar.png",
"identifier": "1234567890",
"additional_attributes": {
"type": "customer",
"age": 30
},
"custom_attributes": {
"source": "api",
"segment": "enterprise"
}
}
headers = {
"api_access_token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://chat.wiseapp360.com/api/v1/accounts/{account_id}/contacts/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Alice',
'email' => 'alice@acme.inc',
'blocked' => false,
'ignore_greeting' => false,
'ignore_csat' => false,
'ignore_agent_name' => false,
'phone_number' => '+123456789',
'avatar' => 'https://example.com/resource',
'avatar_url' => 'https://example.com/avatar.png',
'identifier' => '1234567890',
'additional_attributes' => [
'type' => 'customer',
'age' => 30
],
'custom_attributes' => [
'source' => 'api',
'segment' => 'enterprise'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"api_access_token: <api-key>"
],
]);
$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://chat.wiseapp360.com/api/v1/accounts/{account_id}/contacts/{id}"
payload := strings.NewReader("{\n \"name\": \"Alice\",\n \"email\": \"alice@acme.inc\",\n \"blocked\": false,\n \"ignore_greeting\": false,\n \"ignore_csat\": false,\n \"ignore_agent_name\": false,\n \"phone_number\": \"+123456789\",\n \"avatar\": \"https://example.com/resource\",\n \"avatar_url\": \"https://example.com/avatar.png\",\n \"identifier\": \"1234567890\",\n \"additional_attributes\": {\n \"type\": \"customer\",\n \"age\": 30\n },\n \"custom_attributes\": {\n \"source\": \"api\",\n \"segment\": \"enterprise\"\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("api_access_token", "<api-key>")
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.put("https://chat.wiseapp360.com/api/v1/accounts/{account_id}/contacts/{id}")
.header("api_access_token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Alice\",\n \"email\": \"alice@acme.inc\",\n \"blocked\": false,\n \"ignore_greeting\": false,\n \"ignore_csat\": false,\n \"ignore_agent_name\": false,\n \"phone_number\": \"+123456789\",\n \"avatar\": \"https://example.com/resource\",\n \"avatar_url\": \"https://example.com/avatar.png\",\n \"identifier\": \"1234567890\",\n \"additional_attributes\": {\n \"type\": \"customer\",\n \"age\": 30\n },\n \"custom_attributes\": {\n \"source\": \"api\",\n \"segment\": \"enterprise\"\n }\n}")
.asString();{
"payload": {
"additional_attributes": {
"city": "Sample text",
"country": "Sample text",
"country_code": "Sample text",
"created_at_ip": "Sample text"
},
"availability_status": "online",
"email": "agent@example.com",
"id": 1,
"name": "Sample resource",
"phone_number": "+15551234567",
"blocked": true,
"identifier": "Sample text",
"thumbnail": "Sample text",
"custom_attributes": {
"source": "api",
"segment": "enterprise"
},
"last_activity_at": 1,
"created_at": 1
}
}{
"error": "Forbidden"
}{
"error": "Resource not found"
}