Device Creation
Device Creation
Important Notes
For the plan:""
and planCode:""
parts you can as well select the plan you want your devices to be in. For paid plans, make sure that you have setup your billing information under Billing. The options are:
You can use your personalised plan and code, in case you bought a package. In that case, ask the support team about the plan and use your code to redeem devices on the planCode:""
section.
If you create a device this way, then a new product is also created automatically (the Product Type is set to NEW).
Therefore, in the above mutation, the Product ID is also requested as the return type.
Please make a note of this ID for subsequent mutations, such as creating fields on the product (see below).
For the networkServer:""
part you have of course various options. You can add your devices to any of the integrated LNS:
The field is not case-sensitive, so you can indifferently write: networkServer:"TTI" or networkServer:"tti" and they both should work.
Add Fields to Product
If you want to add new fields in the database to the new product you created using the above query, please use the following query.
Important Notes
To be able to identify the product in the mutation, you have to pass the product ID (key productId
).
You can get this either via a GraphQL query, or you can use the above mutation for the creation of a new device (and subsequent product), which returns the product ID of the created product as a return if successful.
Node-RED Example
Function Node Code
The following code can be used as a function node.
It creates a new and empty Device using the "light" plan.
You will need billing enabled on the workspace and the token you are using for this action needs to have device creation and billing rights.
Last updated