Criar um contato
curl --request POST \
--url https://api.olie.ai/api/management/contacts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "João Silva",
"role": "Gerente de Vendas",
"email": "[email protected]",
"phone": "(91) 99999-0000",
"description": "Contato principal da empresa",
"customers": {
"to_add": [],
"to_rem": []
},
"tags": {
"to_add": [],
"to_rem": []
}
}
'import requests
url = "https://api.olie.ai/api/management/contacts"
payload = {
"name": "João Silva",
"role": "Gerente de Vendas",
"email": "[email protected]",
"phone": "(91) 99999-0000",
"description": "Contato principal da empresa",
"customers": {
"to_add": [],
"to_rem": []
},
"tags": {
"to_add": [],
"to_rem": []
}
}
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({
name: 'João Silva',
role: 'Gerente de Vendas',
email: '[email protected]',
phone: '(91) 99999-0000',
description: 'Contato principal da empresa',
customers: {to_add: [], to_rem: []},
tags: {to_add: [], to_rem: []}
})
};
fetch('https://api.olie.ai/api/management/contacts', 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.olie.ai/api/management/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([
'name' => 'João Silva',
'role' => 'Gerente de Vendas',
'email' => '[email protected]',
'phone' => '(91) 99999-0000',
'description' => 'Contato principal da empresa',
'customers' => [
'to_add' => [
],
'to_rem' => [
]
],
'tags' => [
'to_add' => [
],
'to_rem' => [
]
]
]),
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://api.olie.ai/api/management/contacts"
payload := strings.NewReader("{\n \"name\": \"João Silva\",\n \"role\": \"Gerente de Vendas\",\n \"email\": \"[email protected]\",\n \"phone\": \"(91) 99999-0000\",\n \"description\": \"Contato principal da empresa\",\n \"customers\": {\n \"to_add\": [],\n \"to_rem\": []\n },\n \"tags\": {\n \"to_add\": [],\n \"to_rem\": []\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://api.olie.ai/api/management/contacts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"João Silva\",\n \"role\": \"Gerente de Vendas\",\n \"email\": \"[email protected]\",\n \"phone\": \"(91) 99999-0000\",\n \"description\": \"Contato principal da empresa\",\n \"customers\": {\n \"to_add\": [],\n \"to_rem\": []\n },\n \"tags\": {\n \"to_add\": [],\n \"to_rem\": []\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.olie.ai/api/management/contacts")
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 \"name\": \"João Silva\",\n \"role\": \"Gerente de Vendas\",\n \"email\": \"[email protected]\",\n \"phone\": \"(91) 99999-0000\",\n \"description\": \"Contato principal da empresa\",\n \"customers\": {\n \"to_add\": [],\n \"to_rem\": []\n },\n \"tags\": {\n \"to_add\": [],\n \"to_rem\": []\n }\n}"
response = http.request(request)
puts response.read_bodycontacts
Criar um contato
Criar um novo contato.
POST
/
api
/
management
/
contacts
Criar um contato
curl --request POST \
--url https://api.olie.ai/api/management/contacts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "João Silva",
"role": "Gerente de Vendas",
"email": "[email protected]",
"phone": "(91) 99999-0000",
"description": "Contato principal da empresa",
"customers": {
"to_add": [],
"to_rem": []
},
"tags": {
"to_add": [],
"to_rem": []
}
}
'import requests
url = "https://api.olie.ai/api/management/contacts"
payload = {
"name": "João Silva",
"role": "Gerente de Vendas",
"email": "[email protected]",
"phone": "(91) 99999-0000",
"description": "Contato principal da empresa",
"customers": {
"to_add": [],
"to_rem": []
},
"tags": {
"to_add": [],
"to_rem": []
}
}
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({
name: 'João Silva',
role: 'Gerente de Vendas',
email: '[email protected]',
phone: '(91) 99999-0000',
description: 'Contato principal da empresa',
customers: {to_add: [], to_rem: []},
tags: {to_add: [], to_rem: []}
})
};
fetch('https://api.olie.ai/api/management/contacts', 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.olie.ai/api/management/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([
'name' => 'João Silva',
'role' => 'Gerente de Vendas',
'email' => '[email protected]',
'phone' => '(91) 99999-0000',
'description' => 'Contato principal da empresa',
'customers' => [
'to_add' => [
],
'to_rem' => [
]
],
'tags' => [
'to_add' => [
],
'to_rem' => [
]
]
]),
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://api.olie.ai/api/management/contacts"
payload := strings.NewReader("{\n \"name\": \"João Silva\",\n \"role\": \"Gerente de Vendas\",\n \"email\": \"[email protected]\",\n \"phone\": \"(91) 99999-0000\",\n \"description\": \"Contato principal da empresa\",\n \"customers\": {\n \"to_add\": [],\n \"to_rem\": []\n },\n \"tags\": {\n \"to_add\": [],\n \"to_rem\": []\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://api.olie.ai/api/management/contacts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"João Silva\",\n \"role\": \"Gerente de Vendas\",\n \"email\": \"[email protected]\",\n \"phone\": \"(91) 99999-0000\",\n \"description\": \"Contato principal da empresa\",\n \"customers\": {\n \"to_add\": [],\n \"to_rem\": []\n },\n \"tags\": {\n \"to_add\": [],\n \"to_rem\": []\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.olie.ai/api/management/contacts")
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 \"name\": \"João Silva\",\n \"role\": \"Gerente de Vendas\",\n \"email\": \"[email protected]\",\n \"phone\": \"(91) 99999-0000\",\n \"description\": \"Contato principal da empresa\",\n \"customers\": {\n \"to_add\": [],\n \"to_rem\": []\n },\n \"tags\": {\n \"to_add\": [],\n \"to_rem\": []\n }\n}"
response = http.request(request)
puts response.read_bodyAuthorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Nome do contato
Maximum string length:
255Cargo/função do contato
E-mail do contato
Maximum string length:
254Telefone do contato
Maximum string length:
30Descrição do contato
Maximum string length:
255Clientes vinculados ao contato. Envie to_add (clientes a adicionar) e to_rem (clientes a remover).
Show child attributes
Show child attributes
Etiquetas do contato. Envie to_add (etiquetas a adicionar) e to_rem (etiquetas a remover).
Show child attributes
Show child attributes
Respostas do formulário dinâmico
Response
200
Sucesso
Was this page helpful?
⌘I