Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions docs/api/create-device-using-network.RequestSchema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
{
"title": "Body",
"body": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": ["name", "type", "connector"],
"properties": {
"name": {
"type": "string",
"description": "Device name",
"example": "My Network Device"
},
"type": {
"type": "string",
"enum": ["mutable", "immutable"],
"description": "Device type",
"example": "mutable"
},
"connector": {
"type": "string",
"description": "Connector ID for the device",
"example": "5f5a8f3351d4db99c40dece5"
},
"serie_number": {
"type": "string",
"description": "Serial number for the device (optional, only if required by the network)",
"example": "AB87392C17CA"
},
"tags": {
"type": "array",
"description": "Device tags as key-value string pairs",
"items": {
"type": "object",
"properties": {
"key": { "type": "string", "example": "location" },
"value": { "type": "string", "example": "warehouse-01" }
}
},
"example": [
{ "key": "location", "value": "warehouse-01" },
{ "key": "type", "value": "sensor" }
]
}
}
},
"examples": {
"Create Mutable Device": {
"value": {
"name": "My Network Device",
"type": "mutable",
"connector": "5f5a8f3351d4db99c40dece5"
}
},
"Create Device with Serial Number and Tags": {
"value": {
"name": "Warehouse Sensor",
"type": "mutable",
"connector": "5f5a8f3351d4db99c40dece5",
"serie_number": "AB87392C17CA",
"tags": [
{ "key": "location", "value": "warehouse-01" },
{ "key": "type", "value": "temperature" }
]
}
}
}
}
}
}
}
38 changes: 38 additions & 0 deletions docs/api/create-device-using-network.StatusCodes.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"responses": {
"201": {
"description": "Device created successfully",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"result": {
"type": "object",
"properties": {
"device_id": { "type": "string", "example": "5dcad1c216174c001ca23ab9" },
"token": { "type": "string", "example": "5a16405f-b32c-4c91-ae39-cbb2caba18d8" }
}
},
"status": { "type": "boolean", "example": true }
}
}
}
}
},
"401": {
"description": "Authorization denied. The Network Token is missing, invalid, or does not have the createDevice privilege.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"status": { "type": "boolean", "example": false },
"message": { "type": "string", "example": "Authorization Denied" }
}
}
}
}
}
}
}
45 changes: 45 additions & 0 deletions docs/api/create-device-using-network.api.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
id: create-device-using-network
title: "Create Device using Network"
description: "Create a new device using a Network Token with the createDevice privilege."
sidebar_label: "Create Device using Network"
hide_title: true
hide_table_of_contents: true
api: eJy1V11v2zYU/SsEX9YClm3ZUvzxUCBNhiEY2gaLiz0ERnFFXttsZFIlqTie4f8+kJRsKXE+tnV5iS1fXh6ee3ju1Y5aWBo6vaWf0W6UviMzdYeSvKu+RjneY/6ezjuUo2FaFFYoSaf0QiNYJEAkbgjHe8GQlEbIJQHSTrURdkXsCgnzSy5DbKHFvchxiV0yW2GdQZgqipNSctR+XaHVQuRI7AosURtp/FMZNunSDlUFanC4rjid0uY2Xx2iCg7tUI0/SjT2o+JbOt35r0Ijp1OrS+xQpqRFad1PUBS5YD5p77txJ95Rw1a4BvfJbgukU6qy78hslTckuqUS1kg7IcSnlMis0o7BQjukVqBxSXzgMZmxWsglfcxzRVeVFR9gXeQu/NP2QHMIoftq0xMpUZZrh21dWshyl0is689PKlvtWB3guGO9YN881av4L+pQcnVJFipUNFS7lT1dpDBeDIdpzBOeTSYs6XNkmLrtDGqB32S5zvANO96gFpCTEE7eKf8c8g5RMt8SsSB1tUi2bSrpfQvP+cfxaDgZXMSji3NPrb8mh71Ba9g+VywXS8CQO9xG95CXSAJUUoDQxrFvcW1OCamtkDvcnqzmAWSugkQdQL/Ry+Eb0LhSpcGoH9P9ft/47bba7ZjykPHRsnlzoYdZWcGnoI9ajtPdEVKQ+gnN1pJtKLOhrRdEse/U21ace5epSg+Sk1lVr8cY/qwPQ25QGqX/NYTHsmwrphbMP+PVU6vRFEqawO2gH7t/J2VWO6UpGUNjFmWeb+l/cLG2+DSaMrevx4W7/E3wl7WXcgY8ZoP4LB4lrN+PGQyGkE383XJ94pXlEJ8l/XQRZcMBixI2iSPA4SRiWTZgkEE85uMgaWPBls3LlSmVI8hmOmf3Nd3JKYbPS7tSWvzlqSMcpUD+86h9C8QF5Ab3HbpGY2D5ysVuw70McPf1CddoV8p1xkIZDwbsik5pT0iLy9A4e5UH9g7ObFDfow4KLnVOp3RlbWGmvR4UoluaCOOuhaXqCkX3nVMxWEabRszc5WSlFnbrk1ZOMAu1v503A24ckYGroPVo9kgiUIjf8akBn5NmfJgYhCGlFD9KJFaRrSp11X665DeUbnBwU4yXoGsI4O+SM2sfGtL9YkgBS3SzRmUjLVgdKtzmKwSOzlAeooZwMR4MkxQiPupDlOCAR9l4yKOU9f0PZ6OxvwP1vPXmg7aHrGdOWgV1ybk/Frk6ltyQD4ccH0IW49YtH5PimnYr2ZGF545/KUyRw/ZziGofrU3PgqfJBPggGsdDFiX87CzKFqNBlPbHmGaTMSxw6Oi5DjPg2+m5rofGl+hBaYU+DJgNQQgZAoAxVUpLDFor5NI0zt5G9JIEIE4RUoSI8wGPEnY2jMaTJI0mgyxNOCSj0QB8R3M+8sdxRP21zvB/NFAHeKE8k8J6mDNYqqsv5Pz6yvUo1CZQGXf73X7lfcCc9zmozkrWIBvY2u04vAocJ+9WeXZHI/2J7xFHLiw+2F6Rg/CDkXemXeV6t7Theq6YDYSe0HmHrpxNTm/pbpeBwa863+/d4x8lamddc9fBtfBsO9/q1FU/NvuLcLxoFmbouuE/6RnOOMMKdz8L+2LsvOHk119uZrRDs+pFZq24W6Nh415GYEOn1L8W+Xvum7l7tqM5yGXpuwkNOd3f3150wLI=
sidebar_class_name: "post api-method"
info_path: docs/api/tagoio-api
custom_edit_url: null
---

import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint";
import ParamsDetails from "@theme/ParamsDetails";
import RequestSchema from "@theme/RequestSchema";
import StatusCodes from "@theme/StatusCodes";
import OperationTabs from "@theme/OperationTabs";
import TabItem from "@theme/TabItem";
import Heading from "@theme/Heading";
import Translate from "@docusaurus/Translate";

<Heading as={"h1"} className={"openapi__heading"} children={"Create Device using Network"}></Heading>

<MethodEndpoint method={"post"} path={"/integration/network/device"} context={"endpoint"}></MethodEndpoint>

Create a new device using a Network Token. The token must have the `createDevice` privilege enabled.

This endpoint allows network integrations to provision devices programmatically without requiring a Profile Token. The device is created under the profile that owns the network and is automatically associated with the network and connector specified in the request.

To use this endpoint, first [create a Network Token](/docs/api/create-network-token) with the `createDevice` privilege set to `true`.

:::info Authorization
This endpoint uses a **Network Token** for authentication (not a Profile Token). Pass the token in the `Authorization` header.
:::

<Heading id={"request"} as={"h2"} className={"openapi-tabs__heading"}>
<Translate id="theme.openapi.request.title">Request</Translate>
</Heading>

<ParamsDetails parameters={undefined}></ParamsDetails>

<RequestSchema {...require("./create-device-using-network.RequestSchema.json")}></RequestSchema>

<StatusCodes {...require("./create-device-using-network.StatusCodes.json")}></StatusCodes>
54 changes: 54 additions & 0 deletions docs/api/create-network-token.RequestSchema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"title": "Body",
"body": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": ["name", "network"],
"properties": {
"name": {
"type": "string",
"description": "Display name for the token",
"example": "My Network Token"
},
"network": {
"type": "string",
"description": "Network ID that this token will be associated with",
"example": "5dc1e879d344a330bb1548db"
},
"privileges": {
"type": "object",
"description": "Optional privileges to grant to the token. Omit to create a token with default permissions (data ingestion only).",
"properties": {
"createDevice": {
"type": "boolean",
"description": "Allow the token to create devices via POST /integration/network/device",
"example": true
}
}
}
}
},
"examples": {
"Basic Token": {
"value": {
"name": "Data Ingestion Token",
"network": "5dc1e879d344a330bb1548db"
}
},
"Token with Device Creation Privilege": {
"value": {
"name": "Provisioning Token",
"network": "5dc1e879d344a330bb1548db",
"privileges": {
"createDevice": true
}
}
}
}
}
}
}
}
45 changes: 45 additions & 0 deletions docs/api/create-network-token.StatusCodes.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"responses": {
"200": {
"description": "Network token created successfully",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"result": {
"type": "object",
"properties": {
"token": { "type": "string", "example": "550e8400-e29b-41d4-a716-446655440000" },
"name": { "type": "string", "example": "My Network Token" },
"network": { "type": "string", "example": "5dc1e879d344a330bb1548db" },
"privileges": {
"type": "object",
"properties": {
"createDevice": { "type": "boolean", "example": true }
}
}
}
},
"status": { "type": "boolean", "example": true }
}
}
}
}
},
"401": {
"description": "Authorization denied. The Profile Token is missing, invalid, or does not have write permission.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"status": { "type": "boolean", "example": false },
"message": { "type": "string", "example": "Authorization Denied" }
}
}
}
}
}
}
}
45 changes: 45 additions & 0 deletions docs/api/create-network-token.api.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
id: create-network-token
title: "Create Network Token"
description: "Create a new token for a network integration with optional privileges."
sidebar_label: "Create Network Token"
hide_title: true
hide_table_of_contents: true
api: eJytV01v4zYQ/SvEXNoCli3bkr8OC2SbogiKboJuegp8GIljmRtZVEjKXtfwfy9IyrGUOB/bxpdY8vBx5s3Mm8keDOYa5nfwhcxWqnt2K++pZD83j2FBGyp+gUUAnHSmRGWELGEOvypCQwxZSVtm3JmlVO7Z44jSUK7QmrOtMCsm3VEsWKXERhSUk+5BALIib3XFYQ6Zg20ud65AAIoeatLms+Q7mO/do1DEYW5UTQFksjRUGvsTVlUhMgfX/6ato3vQ2YrWaL+ZXUUwB5l+o8w0uB7oDkpcEwTQeG/jrZR1zQjS9qz7/YShjRJlDk9ZuRS6KnDHrLXjw6zIswMB0HdcV4U9/eeOdeiGw+nmN+84nry6ZGaFhpmV0E0GtqIoWEoMtZaZQEPcUd+5O+HZgKaTGR/FMY5GUZoOknjKU+vDKTPn6Oq6cf08ncxIlissjf3SjrxLpc/xJW1E1q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sidebar_class_name: "post api-method"
info_path: docs/api/tagoio-api
custom_edit_url: null
---

import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint";
import ParamsDetails from "@theme/ParamsDetails";
import RequestSchema from "@theme/RequestSchema";
import StatusCodes from "@theme/StatusCodes";
import OperationTabs from "@theme/OperationTabs";
import TabItem from "@theme/TabItem";
import Heading from "@theme/Heading";
import Translate from "@docusaurus/Translate";

<Heading as={"h1"} className={"openapi__heading"} children={"Create Network Token"}></Heading>

<MethodEndpoint method={"post"} path={"/integration/network/token"} context={"endpoint"}></MethodEndpoint>

Create a new token for a network integration. Network Tokens are used to authenticate requests from external systems to TagoIO network endpoints (e.g., sending data, creating devices).

Tokens can be granted optional **privileges** that control what operations the token is allowed to perform beyond the default data ingestion. Currently supported privileges:

- **createDevice** – Allows the token to create devices via `POST /integration/network/device`.

:::info Authorization
This endpoint requires a **Profile Token** with write permission. The profile must own the target network.
:::

<Heading id={"request"} as={"h2"} className={"openapi-tabs__heading"}>
<Translate id="theme.openapi.request.title">Request</Translate>
</Heading>

<ParamsDetails parameters={undefined}></ParamsDetails>

<RequestSchema {...require("./create-network-token.RequestSchema.json")}></RequestSchema>

<StatusCodes {...require("./create-network-token.StatusCodes.json")}></StatusCodes>
12 changes: 12 additions & 0 deletions docs/api/sidebar/api-sidebar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,18 @@ const sidebar: SidebarsConfig = {
label: "Send Data using Network",
className: "api-method post",
},
{
type: "doc",
id: "api/create-network-token",
label: "Create Network Token",
className: "api-method post",
},
{
type: "doc",
id: "api/create-device-using-network",
label: "Create Device using Network",
className: "api-method post",
},
],
},
{
Expand Down
Loading