Criar integração
curl --request POST \
--url https://nexus.ticto.com.br/api/v1/integrations \
--header 'Content-Type: application/json' \
--header 'X-Api-Client-Token: <api-key>' \
--data '
{
"name": "<string>",
"type": "correios",
"product_hashes": [
"<string>"
],
"options": {
"username": "<string>",
"api_key": "<string>",
"postcard_number": "<string>",
"access_token": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
}
}
'import requests
url = "https://nexus.ticto.com.br/api/v1/integrations"
payload = {
"name": "<string>",
"type": "correios",
"product_hashes": ["<string>"],
"options": {
"username": "<string>",
"api_key": "<string>",
"postcard_number": "<string>",
"access_token": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
}
}
headers = {
"X-Api-Client-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Api-Client-Token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
type: 'correios',
product_hashes: ['<string>'],
options: {
username: '<string>',
api_key: '<string>',
postcard_number: '<string>',
access_token: '<string>',
expires_at: '2023-11-07T05:31:56Z'
}
})
};
fetch('https://nexus.ticto.com.br/api/v1/integrations', 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://nexus.ticto.com.br/api/v1/integrations",
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' => '<string>',
'type' => 'correios',
'product_hashes' => [
'<string>'
],
'options' => [
'username' => '<string>',
'api_key' => '<string>',
'postcard_number' => '<string>',
'access_token' => '<string>',
'expires_at' => '2023-11-07T05:31:56Z'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Api-Client-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://nexus.ticto.com.br/api/v1/integrations"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"type\": \"correios\",\n \"product_hashes\": [\n \"<string>\"\n ],\n \"options\": {\n \"username\": \"<string>\",\n \"api_key\": \"<string>\",\n \"postcard_number\": \"<string>\",\n \"access_token\": \"<string>\",\n \"expires_at\": \"2023-11-07T05:31:56Z\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Api-Client-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.post("https://nexus.ticto.com.br/api/v1/integrations")
.header("X-Api-Client-Token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"type\": \"correios\",\n \"product_hashes\": [\n \"<string>\"\n ],\n \"options\": {\n \"username\": \"<string>\",\n \"api_key\": \"<string>\",\n \"postcard_number\": \"<string>\",\n \"access_token\": \"<string>\",\n \"expires_at\": \"2023-11-07T05:31:56Z\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://nexus.ticto.com.br/api/v1/integrations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Api-Client-Token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"type\": \"correios\",\n \"product_hashes\": [\n \"<string>\"\n ],\n \"options\": {\n \"username\": \"<string>\",\n \"api_key\": \"<string>\",\n \"postcard_number\": \"<string>\",\n \"access_token\": \"<string>\",\n \"expires_at\": \"2023-11-07T05:31:56Z\"\n }\n}"
response = http.request(request)
puts response.read_body{
"hash": "<string>",
"name": "<string>",
"type": "correios",
"product_hashes": [
"<string>"
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"options": {}
}Integrações
Criar integração
Cria uma nova integração vinculada a um ou mais produtos do cliente.
Regras principais:
- O campo
product_hashesdeve conter apenas hashes de produtos que:- pertencem ao cliente autenticado.
- Para integrações do tipo
correios:- todos os produtos referenciados em
product_hashesdevem ser do tipophysical. - o objeto
optionsdeve conter as credenciais obrigatórias (username,api_key,postcard_number).
- todos os produtos referenciados em
POST
/
integrations
Criar integração
curl --request POST \
--url https://nexus.ticto.com.br/api/v1/integrations \
--header 'Content-Type: application/json' \
--header 'X-Api-Client-Token: <api-key>' \
--data '
{
"name": "<string>",
"type": "correios",
"product_hashes": [
"<string>"
],
"options": {
"username": "<string>",
"api_key": "<string>",
"postcard_number": "<string>",
"access_token": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
}
}
'import requests
url = "https://nexus.ticto.com.br/api/v1/integrations"
payload = {
"name": "<string>",
"type": "correios",
"product_hashes": ["<string>"],
"options": {
"username": "<string>",
"api_key": "<string>",
"postcard_number": "<string>",
"access_token": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
}
}
headers = {
"X-Api-Client-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Api-Client-Token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
type: 'correios',
product_hashes: ['<string>'],
options: {
username: '<string>',
api_key: '<string>',
postcard_number: '<string>',
access_token: '<string>',
expires_at: '2023-11-07T05:31:56Z'
}
})
};
fetch('https://nexus.ticto.com.br/api/v1/integrations', 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://nexus.ticto.com.br/api/v1/integrations",
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' => '<string>',
'type' => 'correios',
'product_hashes' => [
'<string>'
],
'options' => [
'username' => '<string>',
'api_key' => '<string>',
'postcard_number' => '<string>',
'access_token' => '<string>',
'expires_at' => '2023-11-07T05:31:56Z'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Api-Client-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://nexus.ticto.com.br/api/v1/integrations"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"type\": \"correios\",\n \"product_hashes\": [\n \"<string>\"\n ],\n \"options\": {\n \"username\": \"<string>\",\n \"api_key\": \"<string>\",\n \"postcard_number\": \"<string>\",\n \"access_token\": \"<string>\",\n \"expires_at\": \"2023-11-07T05:31:56Z\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Api-Client-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.post("https://nexus.ticto.com.br/api/v1/integrations")
.header("X-Api-Client-Token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"type\": \"correios\",\n \"product_hashes\": [\n \"<string>\"\n ],\n \"options\": {\n \"username\": \"<string>\",\n \"api_key\": \"<string>\",\n \"postcard_number\": \"<string>\",\n \"access_token\": \"<string>\",\n \"expires_at\": \"2023-11-07T05:31:56Z\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://nexus.ticto.com.br/api/v1/integrations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Api-Client-Token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"type\": \"correios\",\n \"product_hashes\": [\n \"<string>\"\n ],\n \"options\": {\n \"username\": \"<string>\",\n \"api_key\": \"<string>\",\n \"postcard_number\": \"<string>\",\n \"access_token\": \"<string>\",\n \"expires_at\": \"2023-11-07T05:31:56Z\"\n }\n}"
response = http.request(request)
puts response.read_body{
"hash": "<string>",
"name": "<string>",
"type": "correios",
"product_hashes": [
"<string>"
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"options": {}
}Authorizations
ApiClientTokenbearerAuth
Token de autenticação do cliente obtido via endpoint /auth
Body
application/json
Nome da integração
Maximum string length:
191Tipo da integração
Available options:
correios Lista de hashes de produtos vinculados à integração.
Regras:
- Pelo menos 1 produto é obrigatório.
- Devem pertencer ao cliente autenticado.
- Para integrações do tipo
correios, todos os produtos devem ser do tipo físico.
Minimum array length:
1Configurações específicas da integração.
Para integrações do tipo correios, os campos abaixo são obrigatórios:
username- Usuário de autenticação Correiosapi_key- Chave da API Correiospostcard_number- Número do cartão de postagem
Show child attributes
Show child attributes
Response
Integração criada com sucesso
Hash único da integração
Nome da integração
Tipo da integração
Available options:
correios Lista de hashes dos produtos vinculados à integração
Data de criação no formato ISO 8601
Data de atualização no formato ISO 8601
Configurações específicas da integração