Create a contact
Create a contact
POST
/
public
/
api
/
v1
/
inboxes
/
{inbox_identifier}
/
contacts
Create a contact
curl --request POST \
--url https://chat.wiseapp360.com/public/api/v1/inboxes/{inbox_identifier}/contacts \
--header 'Content-Type: application/json' \
--data '
{
"identifier": "1234567890",
"identifier_hash": "e93275d4eba0e5679ad55f5360af00444e2a888df9b0afa3e8b691c3173725f9",
"email": "alice@acme.inc",
"name": "Alice",
"phone_number": "+123456789",
"avatar": "https://example.com/resource",
"custom_attributes": {
"source": "api",
"segment": "enterprise"
}
}
'const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
identifier: '1234567890',
identifier_hash: 'e93275d4eba0e5679ad55f5360af00444e2a888df9b0afa3e8b691c3173725f9',
email: 'alice@acme.inc',
name: 'Alice',
phone_number: '+123456789',
avatar: 'https://example.com/resource',
custom_attributes: {source: 'api', segment: 'enterprise'}
})
};
fetch('https://chat.wiseapp360.com/public/api/v1/inboxes/{inbox_identifier}/contacts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://chat.wiseapp360.com/public/api/v1/inboxes/{inbox_identifier}/contacts"
payload = {
"identifier": "1234567890",
"identifier_hash": "e93275d4eba0e5679ad55f5360af00444e2a888df9b0afa3e8b691c3173725f9",
"email": "alice@acme.inc",
"name": "Alice",
"phone_number": "+123456789",
"avatar": "https://example.com/resource",
"custom_attributes": {
"source": "api",
"segment": "enterprise"
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://chat.wiseapp360.com/public/api/v1/inboxes/{inbox_identifier}/contacts",
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([
'identifier' => '1234567890',
'identifier_hash' => 'e93275d4eba0e5679ad55f5360af00444e2a888df9b0afa3e8b691c3173725f9',
'email' => 'alice@acme.inc',
'name' => 'Alice',
'phone_number' => '+123456789',
'avatar' => 'https://example.com/resource',
'custom_attributes' => [
'source' => 'api',
'segment' => 'enterprise'
]
]),
CURLOPT_HTTPHEADER => [
"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://chat.wiseapp360.com/public/api/v1/inboxes/{inbox_identifier}/contacts"
payload := strings.NewReader("{\n \"identifier\": \"1234567890\",\n \"identifier_hash\": \"e93275d4eba0e5679ad55f5360af00444e2a888df9b0afa3e8b691c3173725f9\",\n \"email\": \"alice@acme.inc\",\n \"name\": \"Alice\",\n \"phone_number\": \"+123456789\",\n \"avatar\": \"https://example.com/resource\",\n \"custom_attributes\": {\n \"source\": \"api\",\n \"segment\": \"enterprise\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
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://chat.wiseapp360.com/public/api/v1/inboxes/{inbox_identifier}/contacts")
.header("Content-Type", "application/json")
.body("{\n \"identifier\": \"1234567890\",\n \"identifier_hash\": \"e93275d4eba0e5679ad55f5360af00444e2a888df9b0afa3e8b691c3173725f9\",\n \"email\": \"alice@acme.inc\",\n \"name\": \"Alice\",\n \"phone_number\": \"+123456789\",\n \"avatar\": \"https://example.com/resource\",\n \"custom_attributes\": {\n \"source\": \"api\",\n \"segment\": \"enterprise\"\n }\n}")
.asString();{
"id": 1,
"source_id": 1,
"name": "Sample resource",
"email": "agent@example.com",
"phone_number": "+15551234567",
"pubsub_token": "Sample text"
}{
"error": "Unauthorized"
}Parâmetros de caminho
Corpo
application/json
Resposta
Success
⌘I
Create a contact
curl --request POST \
--url https://chat.wiseapp360.com/public/api/v1/inboxes/{inbox_identifier}/contacts \
--header 'Content-Type: application/json' \
--data '
{
"identifier": "1234567890",
"identifier_hash": "e93275d4eba0e5679ad55f5360af00444e2a888df9b0afa3e8b691c3173725f9",
"email": "alice@acme.inc",
"name": "Alice",
"phone_number": "+123456789",
"avatar": "https://example.com/resource",
"custom_attributes": {
"source": "api",
"segment": "enterprise"
}
}
'const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
identifier: '1234567890',
identifier_hash: 'e93275d4eba0e5679ad55f5360af00444e2a888df9b0afa3e8b691c3173725f9',
email: 'alice@acme.inc',
name: 'Alice',
phone_number: '+123456789',
avatar: 'https://example.com/resource',
custom_attributes: {source: 'api', segment: 'enterprise'}
})
};
fetch('https://chat.wiseapp360.com/public/api/v1/inboxes/{inbox_identifier}/contacts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://chat.wiseapp360.com/public/api/v1/inboxes/{inbox_identifier}/contacts"
payload = {
"identifier": "1234567890",
"identifier_hash": "e93275d4eba0e5679ad55f5360af00444e2a888df9b0afa3e8b691c3173725f9",
"email": "alice@acme.inc",
"name": "Alice",
"phone_number": "+123456789",
"avatar": "https://example.com/resource",
"custom_attributes": {
"source": "api",
"segment": "enterprise"
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://chat.wiseapp360.com/public/api/v1/inboxes/{inbox_identifier}/contacts",
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([
'identifier' => '1234567890',
'identifier_hash' => 'e93275d4eba0e5679ad55f5360af00444e2a888df9b0afa3e8b691c3173725f9',
'email' => 'alice@acme.inc',
'name' => 'Alice',
'phone_number' => '+123456789',
'avatar' => 'https://example.com/resource',
'custom_attributes' => [
'source' => 'api',
'segment' => 'enterprise'
]
]),
CURLOPT_HTTPHEADER => [
"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://chat.wiseapp360.com/public/api/v1/inboxes/{inbox_identifier}/contacts"
payload := strings.NewReader("{\n \"identifier\": \"1234567890\",\n \"identifier_hash\": \"e93275d4eba0e5679ad55f5360af00444e2a888df9b0afa3e8b691c3173725f9\",\n \"email\": \"alice@acme.inc\",\n \"name\": \"Alice\",\n \"phone_number\": \"+123456789\",\n \"avatar\": \"https://example.com/resource\",\n \"custom_attributes\": {\n \"source\": \"api\",\n \"segment\": \"enterprise\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
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://chat.wiseapp360.com/public/api/v1/inboxes/{inbox_identifier}/contacts")
.header("Content-Type", "application/json")
.body("{\n \"identifier\": \"1234567890\",\n \"identifier_hash\": \"e93275d4eba0e5679ad55f5360af00444e2a888df9b0afa3e8b691c3173725f9\",\n \"email\": \"alice@acme.inc\",\n \"name\": \"Alice\",\n \"phone_number\": \"+123456789\",\n \"avatar\": \"https://example.com/resource\",\n \"custom_attributes\": {\n \"source\": \"api\",\n \"segment\": \"enterprise\"\n }\n}")
.asString();{
"id": 1,
"source_id": 1,
"name": "Sample resource",
"email": "agent@example.com",
"phone_number": "+15551234567",
"pubsub_token": "Sample text"
}{
"error": "Unauthorized"
}