Create Topic

To create any topic you can use the below API.

info

{api-base-url} can be obtained from the MirrorFly console.

HTTP request#

curl -X POST 'https://{api-base-url}/api/v1/chat/topic/create' \
-H "accept: */*" \
--header 'Authorization: AuthToken' \
--header 'Content-Type: application/json' \
--data '{"topicName": "XXXXXX", "licenseKey": "XXXXXXXX", "metaData": {"key1": "value1", "key2": "value2"}}'

Request Params#

ParamDataTypeRequiredDescription
topicNameStringYesTopic name to create the topic
licenseKeyStringNoLicense Key to associate with topic
metaDataStringNoMetadata information

Responses#

If successful, this action returns below response, in the response body.

{
"status": 200,
"data": {
"topicId": "xxxx" // Unique topic id
},
"message": "Topic created successfully"
}

Error#

In the case of an error, an error object like below is returned.

When the token passed in Headers is expired

{
"status": 401,
"message": "Token Expired"
}

In the case of a Bad Request, an error message is returned

{
"status": 400,
"message": "Error Message"
}