Skip to main content

"deleteTopic"

Abstract

deleteTopic deletes an MQTT topic.

The "deleteTopic" action deletes an MQTT topic.

Important

"deleteTopic" preserves nothing about a topic. This action cannot be undone. It deletes a topic’s configuration, its messages, and the table that stores its messages.

Request examples

Minimal request example

{
  "api": "mq",
  "apiVersion": "1.0",
  "authToken": "replaceWithAuthtokenFromCreateSession",
  "action": "deleteTopic",
  "params": {
    "topic": "test/topic1"
  }
}
{
  "api": "mq",
  "apiVersion": "1.0",
  "authToken": "replaceWithAuthtokenFromCreateSession",
  "requestId": "2",
  "action": "deleteTopic",
  "params": {
    "topic": "test/topic2",
    "preserve": "data"
  }
}

Response examples

{
  "authToken": "authToken",
  "result": {},
  "errorCode": 0,
  "errorMessage": ""
}
{
  "authToken": "authToken",
  "result": {},
  "requestId": "2",
  "errorCode": 0,
  "errorMessage": ""
}

"params"

The "params" property is an object that contains an action's parameters. Each action defines its own required and optional properties.

Property summary

Table 1. "params" property summaries

Property

Description

Default

Type

Limits (inclusive)

"preserve"

determines how data, if any, that is associated with the topic is preserved

"nothing"

string

"data"
"nothing"
"table"

"topic"

contains a unique user-defined name for the topic

Required - No default value

string

Minimum length: 1
Maximum length: 65,500


The "preserve" property is an optional, case-insensitive string enum that determines how data, if any, that is associated with an integration table or MQTT topic is preserved. It defaults to "data".

Possible values:
  • "data"

    "data" is the default value, it preserves the entire table and its records.

  • "nothing"

    "nothing" removes the table and its data.

The topic attribute is a unique user-defined name for the topic.

Things to know:
  • The "topic" name may be up to 65,500 characters long, but it is typically less than 150 characters.

  • The "topic" name will be used in all subsequent references to the topic, such as when re-configuring or deleting the topic.