Envia uma ação de encaminhamento dos dispositivos
curl --request POST \
--url https://apicorp.algartelecom.com.br/telecom/product-Inventory-management/management/v1/lorawan/broker/referrals \
--header 'Content-Type: <content-type>' \
--header 'access_token: <access_token>' \
--header 'client_id: <client_id>' \
--data '
{
"action": "16",
"contractId": "A12154648484",
"deviceReferrals": [
{
"filter": {
"description": "Filtro de dispositivos específicos",
"applications": [
"app_001",
"app_002"
],
"devices": [
"device_001",
"device_002"
],
"tags": [
"tag_001",
"tag_002"
]
},
"connection": {
"clientId": "client_001",
"topicUp": "lorawan/topicUp",
"topicDown": "lorawan/topicDown",
"description": "Conexão para monitoramento remoto",
"authorization": "Basic abc123xyz",
"uri": "mqtt://teste.teste",
"url": "https://teste.teste",
"type": "mqtt"
}
}
]
}
'import requests
url = "https://apicorp.algartelecom.com.br/telecom/product-Inventory-management/management/v1/lorawan/broker/referrals"
payload = {
"action": "16",
"contractId": "A12154648484",
"deviceReferrals": [
{
"filter": {
"description": "Filtro de dispositivos específicos",
"applications": ["app_001", "app_002"],
"devices": ["device_001", "device_002"],
"tags": ["tag_001", "tag_002"]
},
"connection": {
"clientId": "client_001",
"topicUp": "lorawan/topicUp",
"topicDown": "lorawan/topicDown",
"description": "Conexão para monitoramento remoto",
"authorization": "Basic abc123xyz",
"uri": "mqtt://teste.teste",
"url": "https://teste.teste",
"type": "mqtt"
}
}
]
}
headers = {
"Content-Type": "<content-type>",
"client_id": "<client_id>",
"access_token": "<access_token>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Content-Type': '<content-type>',
client_id: '<client_id>',
access_token: '<access_token>'
},
body: JSON.stringify({
action: '16',
contractId: 'A12154648484',
deviceReferrals: [
{
filter: {
description: 'Filtro de dispositivos específicos',
applications: ['app_001', 'app_002'],
devices: ['device_001', 'device_002'],
tags: ['tag_001', 'tag_002']
},
connection: {
clientId: 'client_001',
topicUp: 'lorawan/topicUp',
topicDown: 'lorawan/topicDown',
description: 'Conexão para monitoramento remoto',
authorization: 'Basic abc123xyz',
uri: 'mqtt://teste.teste',
url: 'https://teste.teste',
type: 'mqtt'
}
}
]
})
};
fetch('https://apicorp.algartelecom.com.br/telecom/product-Inventory-management/management/v1/lorawan/broker/referrals', 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://apicorp.algartelecom.com.br/telecom/product-Inventory-management/management/v1/lorawan/broker/referrals",
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([
'action' => '16',
'contractId' => 'A12154648484',
'deviceReferrals' => [
[
'filter' => [
'description' => 'Filtro de dispositivos específicos',
'applications' => [
'app_001',
'app_002'
],
'devices' => [
'device_001',
'device_002'
],
'tags' => [
'tag_001',
'tag_002'
]
],
'connection' => [
'clientId' => 'client_001',
'topicUp' => 'lorawan/topicUp',
'topicDown' => 'lorawan/topicDown',
'description' => 'Conexão para monitoramento remoto',
'authorization' => 'Basic abc123xyz',
'uri' => 'mqtt://teste.teste',
'url' => 'https://teste.teste',
'type' => 'mqtt'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: <content-type>",
"access_token: <access_token>",
"client_id: <client_id>"
],
]);
$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://apicorp.algartelecom.com.br/telecom/product-Inventory-management/management/v1/lorawan/broker/referrals"
payload := strings.NewReader("{\n \"action\": \"16\",\n \"contractId\": \"A12154648484\",\n \"deviceReferrals\": [\n {\n \"filter\": {\n \"description\": \"Filtro de dispositivos específicos\",\n \"applications\": [\n \"app_001\",\n \"app_002\"\n ],\n \"devices\": [\n \"device_001\",\n \"device_002\"\n ],\n \"tags\": [\n \"tag_001\",\n \"tag_002\"\n ]\n },\n \"connection\": {\n \"clientId\": \"client_001\",\n \"topicUp\": \"lorawan/topicUp\",\n \"topicDown\": \"lorawan/topicDown\",\n \"description\": \"Conexão para monitoramento remoto\",\n \"authorization\": \"Basic abc123xyz\",\n \"uri\": \"mqtt://teste.teste\",\n \"url\": \"https://teste.teste\",\n \"type\": \"mqtt\"\n }\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("client_id", "<client_id>")
req.Header.Add("access_token", "<access_token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://apicorp.algartelecom.com.br/telecom/product-Inventory-management/management/v1/lorawan/broker/referrals")
.header("Content-Type", "<content-type>")
.header("client_id", "<client_id>")
.header("access_token", "<access_token>")
.body("{\n \"action\": \"16\",\n \"contractId\": \"A12154648484\",\n \"deviceReferrals\": [\n {\n \"filter\": {\n \"description\": \"Filtro de dispositivos específicos\",\n \"applications\": [\n \"app_001\",\n \"app_002\"\n ],\n \"devices\": [\n \"device_001\",\n \"device_002\"\n ],\n \"tags\": [\n \"tag_001\",\n \"tag_002\"\n ]\n },\n \"connection\": {\n \"clientId\": \"client_001\",\n \"topicUp\": \"lorawan/topicUp\",\n \"topicDown\": \"lorawan/topicDown\",\n \"description\": \"Conexão para monitoramento remoto\",\n \"authorization\": \"Basic abc123xyz\",\n \"uri\": \"mqtt://teste.teste\",\n \"url\": \"https://teste.teste\",\n \"type\": \"mqtt\"\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apicorp.algartelecom.com.br/telecom/product-Inventory-management/management/v1/lorawan/broker/referrals")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = '<content-type>'
request["client_id"] = '<client_id>'
request["access_token"] = '<access_token>'
request.body = "{\n \"action\": \"16\",\n \"contractId\": \"A12154648484\",\n \"deviceReferrals\": [\n {\n \"filter\": {\n \"description\": \"Filtro de dispositivos específicos\",\n \"applications\": [\n \"app_001\",\n \"app_002\"\n ],\n \"devices\": [\n \"device_001\",\n \"device_002\"\n ],\n \"tags\": [\n \"tag_001\",\n \"tag_002\"\n ]\n },\n \"connection\": {\n \"clientId\": \"client_001\",\n \"topicUp\": \"lorawan/topicUp\",\n \"topicDown\": \"lorawan/topicDown\",\n \"description\": \"Conexão para monitoramento remoto\",\n \"authorization\": \"Basic abc123xyz\",\n \"uri\": \"mqtt://teste.teste\",\n \"url\": \"https://teste.teste\",\n \"type\": \"mqtt\"\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"message": "Encaminhamento criado com sucesso."
}{
"errors": "Parameter not found"
}Lorawan
API para Criação de Encaminhamentos LoRaWAN
Cria uma ação para encaminhamento de dispositivos no sistema LoRaWAN.
POST
/
lorawan
/
broker
/
referrals
Envia uma ação de encaminhamento dos dispositivos
curl --request POST \
--url https://apicorp.algartelecom.com.br/telecom/product-Inventory-management/management/v1/lorawan/broker/referrals \
--header 'Content-Type: <content-type>' \
--header 'access_token: <access_token>' \
--header 'client_id: <client_id>' \
--data '
{
"action": "16",
"contractId": "A12154648484",
"deviceReferrals": [
{
"filter": {
"description": "Filtro de dispositivos específicos",
"applications": [
"app_001",
"app_002"
],
"devices": [
"device_001",
"device_002"
],
"tags": [
"tag_001",
"tag_002"
]
},
"connection": {
"clientId": "client_001",
"topicUp": "lorawan/topicUp",
"topicDown": "lorawan/topicDown",
"description": "Conexão para monitoramento remoto",
"authorization": "Basic abc123xyz",
"uri": "mqtt://teste.teste",
"url": "https://teste.teste",
"type": "mqtt"
}
}
]
}
'import requests
url = "https://apicorp.algartelecom.com.br/telecom/product-Inventory-management/management/v1/lorawan/broker/referrals"
payload = {
"action": "16",
"contractId": "A12154648484",
"deviceReferrals": [
{
"filter": {
"description": "Filtro de dispositivos específicos",
"applications": ["app_001", "app_002"],
"devices": ["device_001", "device_002"],
"tags": ["tag_001", "tag_002"]
},
"connection": {
"clientId": "client_001",
"topicUp": "lorawan/topicUp",
"topicDown": "lorawan/topicDown",
"description": "Conexão para monitoramento remoto",
"authorization": "Basic abc123xyz",
"uri": "mqtt://teste.teste",
"url": "https://teste.teste",
"type": "mqtt"
}
}
]
}
headers = {
"Content-Type": "<content-type>",
"client_id": "<client_id>",
"access_token": "<access_token>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Content-Type': '<content-type>',
client_id: '<client_id>',
access_token: '<access_token>'
},
body: JSON.stringify({
action: '16',
contractId: 'A12154648484',
deviceReferrals: [
{
filter: {
description: 'Filtro de dispositivos específicos',
applications: ['app_001', 'app_002'],
devices: ['device_001', 'device_002'],
tags: ['tag_001', 'tag_002']
},
connection: {
clientId: 'client_001',
topicUp: 'lorawan/topicUp',
topicDown: 'lorawan/topicDown',
description: 'Conexão para monitoramento remoto',
authorization: 'Basic abc123xyz',
uri: 'mqtt://teste.teste',
url: 'https://teste.teste',
type: 'mqtt'
}
}
]
})
};
fetch('https://apicorp.algartelecom.com.br/telecom/product-Inventory-management/management/v1/lorawan/broker/referrals', 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://apicorp.algartelecom.com.br/telecom/product-Inventory-management/management/v1/lorawan/broker/referrals",
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([
'action' => '16',
'contractId' => 'A12154648484',
'deviceReferrals' => [
[
'filter' => [
'description' => 'Filtro de dispositivos específicos',
'applications' => [
'app_001',
'app_002'
],
'devices' => [
'device_001',
'device_002'
],
'tags' => [
'tag_001',
'tag_002'
]
],
'connection' => [
'clientId' => 'client_001',
'topicUp' => 'lorawan/topicUp',
'topicDown' => 'lorawan/topicDown',
'description' => 'Conexão para monitoramento remoto',
'authorization' => 'Basic abc123xyz',
'uri' => 'mqtt://teste.teste',
'url' => 'https://teste.teste',
'type' => 'mqtt'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: <content-type>",
"access_token: <access_token>",
"client_id: <client_id>"
],
]);
$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://apicorp.algartelecom.com.br/telecom/product-Inventory-management/management/v1/lorawan/broker/referrals"
payload := strings.NewReader("{\n \"action\": \"16\",\n \"contractId\": \"A12154648484\",\n \"deviceReferrals\": [\n {\n \"filter\": {\n \"description\": \"Filtro de dispositivos específicos\",\n \"applications\": [\n \"app_001\",\n \"app_002\"\n ],\n \"devices\": [\n \"device_001\",\n \"device_002\"\n ],\n \"tags\": [\n \"tag_001\",\n \"tag_002\"\n ]\n },\n \"connection\": {\n \"clientId\": \"client_001\",\n \"topicUp\": \"lorawan/topicUp\",\n \"topicDown\": \"lorawan/topicDown\",\n \"description\": \"Conexão para monitoramento remoto\",\n \"authorization\": \"Basic abc123xyz\",\n \"uri\": \"mqtt://teste.teste\",\n \"url\": \"https://teste.teste\",\n \"type\": \"mqtt\"\n }\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("client_id", "<client_id>")
req.Header.Add("access_token", "<access_token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://apicorp.algartelecom.com.br/telecom/product-Inventory-management/management/v1/lorawan/broker/referrals")
.header("Content-Type", "<content-type>")
.header("client_id", "<client_id>")
.header("access_token", "<access_token>")
.body("{\n \"action\": \"16\",\n \"contractId\": \"A12154648484\",\n \"deviceReferrals\": [\n {\n \"filter\": {\n \"description\": \"Filtro de dispositivos específicos\",\n \"applications\": [\n \"app_001\",\n \"app_002\"\n ],\n \"devices\": [\n \"device_001\",\n \"device_002\"\n ],\n \"tags\": [\n \"tag_001\",\n \"tag_002\"\n ]\n },\n \"connection\": {\n \"clientId\": \"client_001\",\n \"topicUp\": \"lorawan/topicUp\",\n \"topicDown\": \"lorawan/topicDown\",\n \"description\": \"Conexão para monitoramento remoto\",\n \"authorization\": \"Basic abc123xyz\",\n \"uri\": \"mqtt://teste.teste\",\n \"url\": \"https://teste.teste\",\n \"type\": \"mqtt\"\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apicorp.algartelecom.com.br/telecom/product-Inventory-management/management/v1/lorawan/broker/referrals")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = '<content-type>'
request["client_id"] = '<client_id>'
request["access_token"] = '<access_token>'
request.body = "{\n \"action\": \"16\",\n \"contractId\": \"A12154648484\",\n \"deviceReferrals\": [\n {\n \"filter\": {\n \"description\": \"Filtro de dispositivos específicos\",\n \"applications\": [\n \"app_001\",\n \"app_002\"\n ],\n \"devices\": [\n \"device_001\",\n \"device_002\"\n ],\n \"tags\": [\n \"tag_001\",\n \"tag_002\"\n ]\n },\n \"connection\": {\n \"clientId\": \"client_001\",\n \"topicUp\": \"lorawan/topicUp\",\n \"topicDown\": \"lorawan/topicDown\",\n \"description\": \"Conexão para monitoramento remoto\",\n \"authorization\": \"Basic abc123xyz\",\n \"uri\": \"mqtt://teste.teste\",\n \"url\": \"https://teste.teste\",\n \"type\": \"mqtt\"\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"message": "Encaminhamento criado com sucesso."
}{
"errors": "Parameter not found"
}Headers
Define o formato da requisição.
🔹 Valor padrão:
application/json
📌 Dica: Copie e cole esse valor no campo Content-Type.
Example:
"application/json"
Example:
"client_id"
Token gerado.
Example:
"access_token"
Body
application/json
Dados para a criação do encaminhamento.
Response
Encaminhamento criado com sucesso.

