Creating a Custom Topic for a Device
Function
This API is used to create a topic on ROMA Connect.
URI
POST /v1/{project_id}/link/instances/{instance_id}/topics
|
Parameter |
Type |
Mandatory |
Description |
|---|---|---|---|
|
project_id |
string |
Yes |
Project ID of each region of a tenant. |
|
instance_id |
string |
Yes |
ID of the ROMA Connect instance used by the tenant. |
Request
Request parameters
|
Parameter |
Type |
Mandatory |
Description |
|---|---|---|---|
|
product_name |
string |
Yes |
Name of a product that has been created. |
|
device_name |
string |
Yes |
Name of a product that has been created. |
|
topic_name |
string |
Yes |
Topic name. The value can contain a maximum of 64 characters, including letters, digits, underscores (_), and hyphens (-). |
|
topic_perm |
string |
Yes |
Permission of a topic. Only the pub and sub permissions are supported. |
|
remark |
string |
No |
Description, which contains a maximum of 200 characters. |
Example request
https://example.cloud.com/v1/80e2b******f4a398d6409a50932d917/link/instances/fb3b24ab-5d87-473d-9c57-fc6******6a1/topics
{
"product_name" : "product01",
"device_name" : "device01",
"topic_name" : "alarm",
"topic_perm" : "pub",
"remark" : "alarm topic"
}
Response
Response parameters
|
Parameter |
Type |
Description |
|---|---|---|
|
remark |
string |
Device description, which contains a maximum of 200 characters. |
|
topic_id |
integer |
Topic ID.
|
|
topic_name |
string |
Topic name. |
|
topic_perm |
string |
Permission of a topic. Only the pub and sub permissions are supported. |
Example response
{
"remark": "alarm topic ",
"topic_id": null,
"topic_name": "alarm",
"topic_perm": "pub"
}
Last Article: Creating a Device
Next Article: Querying Devices
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.