Atualizar cliente
curl --request PUT \
--url https://api.olie.ai/api/management/customers/{customer} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Cliente Atualizado",
"email": "[email protected]",
"status": true,
"tags": {
"to_add": [],
"to_rem": []
}
}
'import requests
url = "https://api.olie.ai/api/management/customers/{customer}"
payload = {
"name": "Cliente Atualizado",
"email": "[email protected]",
"status": True,
"tags": {
"to_add": [],
"to_rem": []
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Cliente Atualizado',
email: '[email protected]',
status: true,
tags: {to_add: [], to_rem: []}
})
};
fetch('https://api.olie.ai/api/management/customers/{customer}', 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/customers/{customer}",
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' => 'Cliente Atualizado',
'email' => '[email protected]',
'status' => true,
'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/customers/{customer}"
payload := strings.NewReader("{\n \"name\": \"Cliente Atualizado\",\n \"email\": \"[email protected]\",\n \"status\": true,\n \"tags\": {\n \"to_add\": [],\n \"to_rem\": []\n }\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.olie.ai/api/management/customers/{customer}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Cliente Atualizado\",\n \"email\": \"[email protected]\",\n \"status\": true,\n \"tags\": {\n \"to_add\": [],\n \"to_rem\": []\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.olie.ai/api/management/customers/{customer}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Cliente Atualizado\",\n \"email\": \"[email protected]\",\n \"status\": true,\n \"tags\": {\n \"to_add\": [],\n \"to_rem\": []\n }\n}"
response = http.request(request)
puts response.read_bodycustomers
Atualizar cliente
Atualiza os dados de um cliente existente. Todos os campos são opcionais; envie apenas os que deseja alterar.
PUT
/
api
/
management
/
customers
/
{customer}
Atualizar cliente
curl --request PUT \
--url https://api.olie.ai/api/management/customers/{customer} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Cliente Atualizado",
"email": "[email protected]",
"status": true,
"tags": {
"to_add": [],
"to_rem": []
}
}
'import requests
url = "https://api.olie.ai/api/management/customers/{customer}"
payload = {
"name": "Cliente Atualizado",
"email": "[email protected]",
"status": True,
"tags": {
"to_add": [],
"to_rem": []
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Cliente Atualizado',
email: '[email protected]',
status: true,
tags: {to_add: [], to_rem: []}
})
};
fetch('https://api.olie.ai/api/management/customers/{customer}', 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/customers/{customer}",
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' => 'Cliente Atualizado',
'email' => '[email protected]',
'status' => true,
'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/customers/{customer}"
payload := strings.NewReader("{\n \"name\": \"Cliente Atualizado\",\n \"email\": \"[email protected]\",\n \"status\": true,\n \"tags\": {\n \"to_add\": [],\n \"to_rem\": []\n }\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.olie.ai/api/management/customers/{customer}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Cliente Atualizado\",\n \"email\": \"[email protected]\",\n \"status\": true,\n \"tags\": {\n \"to_add\": [],\n \"to_rem\": []\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.olie.ai/api/management/customers/{customer}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Cliente Atualizado\",\n \"email\": \"[email protected]\",\n \"status\": true,\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.
Path Parameters
Body
application/json
Nome do cliente
Maximum string length:
255Maximum string length:
1001 = CPF, 2 = CNPJ
Available options:
1, 2 1 = Matriz, 2 = Filial
Available options:
1, 2 Maximum string length:
40Maximum string length:
255Maximum string length:
254Maximum string length:
30Maximum string length:
255Maximum string length:
255ID do cliente matriz (obrigatório se customer_type = 2)
Etiquetas do cliente. Envie to_add (etiquetas a adicionar) e to_rem (etiquetas a remover).
Show child attributes
Show child attributes
Response
Cliente atualizado com sucesso
Was this page helpful?
⌘I