Obter agrupamento de expedição
curl --request GET \
--url https://api.tiny.com.br/public-api/v3/expedicao/{idAgrupamento} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.tiny.com.br/public-api/v3/expedicao/{idAgrupamento}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.tiny.com.br/public-api/v3/expedicao/{idAgrupamento}', 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.tiny.com.br/public-api/v3/expedicao/{idAgrupamento}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.tiny.com.br/public-api/v3/expedicao/{idAgrupamento}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.tiny.com.br/public-api/v3/expedicao/{idAgrupamento}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tiny.com.br/public-api/v3/expedicao/{idAgrupamento}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": 123,
"identificacao": "<string>",
"data": "<string>",
"formaEnvio": {
"id": 123,
"nome": "<string>"
},
"expedicoes": [
{
"id": 123,
"data": "<string>",
"situacao": "<string>",
"tipoObjeto": "<string>",
"idObjeto": 123,
"dataEmissao": "<string>",
"venda": {
"id": 123,
"numero": 123,
"data": "<string>"
},
"notaFiscal": {
"id": 123,
"numero": 123,
"data": "<string>"
},
"destinatario": {
"nome": "<string>",
"codigo": "<string>",
"fantasia": "<string>",
"cpfCnpj": "<string>",
"inscricaoEstadual": "<string>",
"rg": "<string>",
"telefone": "<string>",
"celular": "<string>",
"email": "<string>",
"endereco": {
"endereco": "<string>",
"numero": "<string>",
"complemento": "<string>",
"bairro": "<string>",
"municipio": "<string>",
"cep": "<string>",
"uf": "<string>",
"pais": "<string>"
},
"id": 123
},
"volume": {
"embalagem": {
"id": 123,
"descricao": "<string>"
},
"largura": 123,
"altura": 123,
"comprimento": 123,
"diametro": 123,
"pesoBruto": 123,
"quantidadeVolumes": 123
},
"logistica": {
"codigoRastreio": "<string>",
"urlRastreio": "<string>",
"possuiValorDeclarado": true,
"valorDeclarado": 123,
"possuiAvisoRecebimento": true,
"formaFrete": {
"id": 123,
"nome": "<string>"
},
"transportador": {
"id": 123,
"nome": "<string>"
}
}
}
]
}{
"mensagem": "Ocorreram erros de validação",
"detalhes": [
{
"campo": "codigo",
"mensagem": "O campo código é obrigatório"
}
]
}Expedição
Obter agrupamento de expedição
GET
/
expedicao
/
{idAgrupamento}
Obter agrupamento de expedição
curl --request GET \
--url https://api.tiny.com.br/public-api/v3/expedicao/{idAgrupamento} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.tiny.com.br/public-api/v3/expedicao/{idAgrupamento}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.tiny.com.br/public-api/v3/expedicao/{idAgrupamento}', 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.tiny.com.br/public-api/v3/expedicao/{idAgrupamento}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.tiny.com.br/public-api/v3/expedicao/{idAgrupamento}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.tiny.com.br/public-api/v3/expedicao/{idAgrupamento}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tiny.com.br/public-api/v3/expedicao/{idAgrupamento}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": 123,
"identificacao": "<string>",
"data": "<string>",
"formaEnvio": {
"id": 123,
"nome": "<string>"
},
"expedicoes": [
{
"id": 123,
"data": "<string>",
"situacao": "<string>",
"tipoObjeto": "<string>",
"idObjeto": 123,
"dataEmissao": "<string>",
"venda": {
"id": 123,
"numero": 123,
"data": "<string>"
},
"notaFiscal": {
"id": 123,
"numero": 123,
"data": "<string>"
},
"destinatario": {
"nome": "<string>",
"codigo": "<string>",
"fantasia": "<string>",
"cpfCnpj": "<string>",
"inscricaoEstadual": "<string>",
"rg": "<string>",
"telefone": "<string>",
"celular": "<string>",
"email": "<string>",
"endereco": {
"endereco": "<string>",
"numero": "<string>",
"complemento": "<string>",
"bairro": "<string>",
"municipio": "<string>",
"cep": "<string>",
"uf": "<string>",
"pais": "<string>"
},
"id": 123
},
"volume": {
"embalagem": {
"id": 123,
"descricao": "<string>"
},
"largura": 123,
"altura": 123,
"comprimento": 123,
"diametro": 123,
"pesoBruto": 123,
"quantidadeVolumes": 123
},
"logistica": {
"codigoRastreio": "<string>",
"urlRastreio": "<string>",
"possuiValorDeclarado": true,
"valorDeclarado": 123,
"possuiAvisoRecebimento": true,
"formaFrete": {
"id": 123,
"nome": "<string>"
},
"transportador": {
"id": 123,
"nome": "<string>"
}
}
}
]
}{
"mensagem": "Ocorreram erros de validação",
"detalhes": [
{
"campo": "codigo",
"mensagem": "O campo código é obrigatório"
}
]
}⌘I
