Skip to content
Closed
204 changes: 204 additions & 0 deletions docs/api/create-device-using-network.api.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,204 @@
---
id: create-device-using-network
title: "Create Device using Network"
description: "Create either an immutable or a mutable device."
sidebar_label: "Create Device using Network"
hide_title: true
hide_table_of_contents: true
api: eJztGdtu20b2Vw4mD2kFUnf5oocCrhPsGm0uSGwUC8toR+QRNTU5w8wMraiC/n1xZkiKlGLZ6Wa3u8DmwaHIM+d+nw2zPDFsesveol0pfQ9XMkFj2V3AYjSRFrkVSrIpu9TILQIKu0QNXILIssLyeYqgNHCofsT4ICLsziSEcJW13xrQ+KkQGiFaFvJeyARyrnmGFrUBLmPgGkHlVmTiD4xhoTSkSiahRZ0FwPMcZRwqma7BWKV5UtJ5s0dljkv+gJCKe4Qo5caIqP5GVGIFUtk2M2DQWiET053JmfyHKiArjAWHiEOlHcdj9Su8VvcowSooDIJdCgMo41wJabswk9PpdMW1JCnBYdR7B3cE7BIh8gr2fEKuxYNIMUHgBqwusAseJZT/WMBUjpqTea5iNmX+/Ct3/MYImZTEWMAMRoUWds2mtxvW4oFNb++2dwEjVaCxP6p4zaYbFilpUVp65HmeisiR6f1uyBU2zERLzDg9KYnvFg6tFTZFNmU7m3tWwDkO+VDA7DonEDX/HSPLPFWhMSb/kzzDCiQgBiRGVml6JvP8mqMWKq5/aiQGCe1dwHJNqrACDfHkME03FTVjtZAJ2/fnkruSLH7mWe74f7OGhdDGNvzbm4RtKwEOUaMsMhKiPnMYPyU9OgmhN/0c4WV94qXz9n2ipsXbDv22qaInZb2sQOHqlSND/lZK1cQ/WUz42WI0mgzicTw/P4/G/RgjnDhyTSscUUHM1yxgK0RyvExJu2QB+1RwbVF/Iau40PNYHWcxt7wKbghBSQS1gJivAyCcATiUAVQYm+xX77aHTrJjWBbZ3J3LhBQZ8dwPWMY/++fRyT6Hbx08MeFwGgp3jZYLCd/1w9HJ900WRidbijYt8NeSzpO2+Yha8BQ8uJM4XVeZKQaxAJNjJB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8lfk2rIQfbcAghPQCPIlVIu1tl7WRvc3TMBfhggnyCPIzjYRyOo5NReHY+noTnw/lkHPPx6emQu46C8tOH3d7odYXhf6Ytqhrqb9eYCrlQztzlnHjNE3X1Di7eXx3Y/MWLFy+g0/m7WrUWiLGKigyldU7f6czkNY0+zZfkGCZPhaX4Xy1FtCy9Zq2Klxp39axEK6SbV8oNn1sjlmzlWj2IGA2MIRaLBWqU1uMy05kModNp5o1OZwrETBlmWmXN9BSUrKxVARGXkKD1MLvRrUpLVKGJCyLQckuicJEaBfdSrWgjceH92X/tAi1la7yOdhkKtcMfEmhFMxG4Mo6lfSnq1POO2gL+wEXqHFYsKr2qlfR7oMb0V0eeaGaqAyYuJE/XRhjPxbTT+aIieQkVNMl741WfKtRhGM6k86CPXnIHdfH+Cl6XC2j4gAl1ifKXJW2auVu288oLyDfoxM4/A2c5N+BzMoGfd/2oy3NqILSgVKMdWp42Nt2XS6UMVqs6OrBQaapWRLGCMjDnBmNQpb4SVInm+VJEPC1xTmnvTtq6kYJapo+WWzTwmhsLA9IZeJXe7O/aYbXEKgHu2icKE0+z1CFyY1FLaKHvVlg7nZsPPxOV3x7tC3q/NW36uqCmCn7Bb8AeISHWPM4neGr1IcST54dMCa8wT9W65oYCxixVkcYuEzge1Eo6R7n58HNdZ1r+5hsJlXEhDRiMHLelYYmIp0GlhRoqn8wG3X63X3ayPKIelAoE9WcZl42KUI4M5VReuMZld03RSpCNS4j/3z399909lfW7McBvA980b8qG/JY1kiI1Ig07uybgLmBL6uCnt2yzoVi40el2S68/FajpsuqOqqwWrj+gi6qg6lh2JfvSO0l47ZeqVVE+mKN2FfzCjctHYe8aQ8b7dx+vWcDm5c1YpmI6o/mKlrt8xabM3cS5zO+mMHq3YSmXScETgvU4KSB4QYppdoN+FV4+uGu08pNcNzismjYvAP11y+gvgW42vsfcbmt4/+nRE3UT6KHJkrTt/idcvDYM
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";

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

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

Create either an immutable or a mutable device.

- Immutable devices require chunking parameters and are optimized for long-term, append-only storage.
- Mutable devices behave like classic devices and do not require chunk settings.

You must have a Network and a Network-Token to use this endpoint.
:::warning
Your Network-Token must have the create device privilege as true.
:::

<Heading id={"request"} as={"h2"} className={"openapi-tabs__heading"} children={"Request"}></Heading>

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

<RequestSchema
title={"Body"}
body={{
content: {
"application/json": {
schema: {
oneOf: [
{
title: "Immutable Device Creation",
type: "object",
required: ["name", "type", "connector", "chunk_period", "chunk_retention"],
properties: {
name: { type: "string", description: "Device name", example: "My first immutable device" },
type: {
type: "string",
enum: ["immutable"],
description: "Device type - must be 'immutable' for immutable devices",
example: "immutable",
},
connector: {
type: "string",
description: "Connector ID for the device",
example: "5f5a8f3351d4db99c40dece5",
},
chunk_period: {
type: "string",
enum: ["day", "week", "month", "quarter"],
description: "Chunk period for data storage - one of day, week, month, quarter",
example: "quarter",
},
chunk_retention: {
type: "number",
minimum: 0,
maximum: 36,
description: "Number of chunks to retain (0-36)",
example: 36,
},
serie_number: {
type: "string",
description: "Serial number - only required if specified by the network",
example: "AB87392C17CA",
},
tags: {
type: "array",
description: "Device tags as key-value string pairs",
items: {
type: "object",
properties: {
key: { type: "string", description: "Tag key", example: "tagKey1" },
value: { type: "string", description: "Tag value", example: "value1" },
},
},
example: [
{ key: "tagKey1", value: "value1" },
{ key: "tagKey2", value: "value2" },
],
},
},
},
{
title: "Mutable Device Creation",
type: "object",
required: ["name", "type", "connector"],
properties: {
name: { type: "string", description: "Device name", example: "My first device" },
type: {
type: "string",
enum: ["mutable"],
description: "Device type - must be 'mutable' for mutable devices",
example: "mutable",
},
connector: {
type: "string",
description: "Connector ID for the device",
example: "5f5a8f3351d4db99c40dece5",
},
serie_number: {
type: "string",
description: "Serial number - only required if specified by the network",
example: "AB87392C12CA",
},
active: { type: "boolean", description: "Device active status", example: true },
tags: {
type: "array",
description: "Device tags",
items: {
type: "object",
properties: {
key: { type: "string", example: "tagKey1" },
value: { type: "string", example: "value1" },
},
},
example: [
{ key: "tagKey1", value: "value1" },
{ key: "tagKey2", value: "value2" },
],
},
visible: { type: "boolean", description: "Device visibility status", example: true },
},
},
],
},
examples: {
"Create Immutable Device": {
value: {
name: "My first immutable device",
type: "immutable",
connector: "5f5a8f3351d4db99c40dece5",
chunk_period: "quarter",
chunk_retention: 36,
serie_number: "AB87392C17CA",
},
},
"Create Mutable Device": {
value: {
name: "My first device",
type: "mutable",
connector: "5f5a8f3351d4db99c40dece5",
serie_number: "AB87392C12CA",
},
},
},
},
"text/plain": {
examples: {
"Create Immutable Device": {
value:
'{\r\n "name": "My first immutable device",\r\n "type": "immutable",\r\n "connector": "5f5a8f3351d4db99c40dece5",\r\n "chunk_period": "quarter", //define a chunk period by "day","week", "month", "quarter"\r\n "chunk_retention": 36, //acceptable range between 0-36\r\n "serie_number": "AB87392C17CA" //only if required by network (optional)\r\n }',
},
"Create Mutable Device": {
value:
'{\r\n "name": "My first device",\r\n "type": "mutable",\r\n "connector": "5f5a8f3351d4db99c40dece5",\r\n "serie_number": "AB87392C12CA" //only if required by network (optional)\r\n }',
},
},
},
},
}}
></RequestSchema>

<StatusCodes
id={undefined}
label={undefined}
responses={{
"201": {
description: "Mutable device created / Immutable device created",
content: {
"application/json": {
schema: {
type: "object",
properties: {
result: {
type: "object",
properties: {
deviceID: { type: "string", example: "5dcad1c216174c001ca23ab9" },
token: { type: "string", example: "5a16405f-b32c-4c91-ae39-cbb2caba18d8" },
},
},
status: { type: "boolean", example: true },
},
},
},
},
},
}}
></StatusCodes>
84 changes: 84 additions & 0 deletions docs/api/create-network-token.api.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
---
id: create-network-token
title: "Create a Token for the Network"
description: "Create a token for the network to use in network endpoints"
sidebar_label: "Create a Token for the Network"
hide_title: true
hide_table_of_contents: true
api: eJy9V9tu2zgQ/RWCeShgSL47jvVQINsGu8EWbZALikUSoGNpLLGRSZWk4hqG/30xpGRLTpN2t9t9SQxxOHPmfrjhFlLDo1v+Hu1K6Qd2LlM0lt8HPEETa1FYoSSP+BuNYJEBs+oBJVsozWyGTFbXrGKlQSbk7gvKpFBCWsMDrgrUQIrOEx7x2KmqDF6TOh5wg3GphV3z6HbDL7RaiBxDfxjd3m/vA67xS4nG/qaSNY82PFbSorT0E4oiF7Ez0PtsCO6GmzjDJdAvuy6QR1zNP2NsudcjNCbktYQl8oBXmMnrQhNYK9DQ3fpgr8ZYLWTKA45fYVnk9On4eDqZ9o+H02QIyaDf789msySGId8G3sCLt72PW7KMjyLHtDJ9CLsNzMfwLT6KuKl/rlSOIJsGrC5xu91uG59uG449j74Gz+sUHQBsQ/Bm7vdmnMyuapwOthI2Y9U3f5EVWjilzotHyMtfjM+HQqMplDRecNjv079n6v0HkAf/vhjbWdVoytx+X+4fVNVPV/CvLcuAW9/jL8EDgPl8HsfhYDAYhMPhcBiORqNROB6Px+AP59wpMxZsaX6sIdyFJdpM0VAqlHHugM14xHtCWkz9zOpVIezZ3ajSj6iNq9NS5zzimbWFiXo9KES3NCEOuhZS1RWKb4NvyWAZrhoy9/vxd0WV4mPpo1jPwJ1HUIg/cc0P5/Mpa8ozm4FlwrBSii8l0nheq1KzxMl02e8oaSLv5/l8zSCO0RghUy/q1b0yrIAUu/tua8EKuCDjGUKCmgf8a7jP2gQHw9F4AmEy7UM4xmESzk9GSTiJ++7geHoyowKrFsGPO1qvqhc9rYS67NS5xc73CTXs9U7Ha6/F0L30MCi05FrKns6cQ/ffClPksH7vpdqutcOzSC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8llIw=
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";

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

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

Create a token for the network to use in network endpoints

<Heading id={"request"} as={"h2"} className={"openapi-tabs__heading"} children={"Request"}></Heading>

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

<RequestSchema
title={"Body"}
body={{
content: {
"application/json": {
schema: {
type: "object",
required: ["name", "network"],
properties: {
network: { type: "string", example: "667570627d2ad1000999dca2" },
name: { type: "string", example: "Token" },
previlegies: { type: "object", properties: { createDevice: { type: "boolean", example: true } } },
},
example: [{ network: "667570627d2ad1000999dca2", name: "Token", previlegies: { createDevice: true } }],
},
examples: {
"Create a Token with Create Device privilege": {
value: [{ network: "667570627d2ad1000999dca2", name: "Token", previlegies: { createDevice: true } }],
},
},
},
},
}}
></RequestSchema>

<StatusCodes
id={undefined}
label={undefined}
responses={{
"200": {
description: "Create a Token with Create Device privilege",
content: {
"application/json": {
schema: {
type: "object",
properties: {
result: {
type: "object",
properties: {
name: { type: "string", example: "Token" },
network: { type: "string", example: "667570627d2ad1000999dca2" },
previlegies: { type: "object", properties: { createDevice: { type: "boolean", example: true } } },
token: { type: "string", example: "aaabbbcc-1111-2222-3333-4444aaaabbbb" },
},
},
status: { type: "boolean", example: true },
},
},
},
},
},
}}
></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-device-using-network",
label: "Create Device using Network",
className: "api-method post",
},
{
type: "doc",
id: "api/create-network-token",
label: "Create Network Token",
className: "api-method post",
},
],
},
{
Expand Down
Loading
Loading