Managing topics
Creating a topic
You can create topics with the REST API in a similar manner to the topic creation methods in Diffusion client SDKs.
Endpoint |
|
Content-type |
|
Method |
|
curl --include \
--request POST \
--url https://api.diffusion.cloud/topics/add \
--header 'authorization: Bearer <TOKEN>' \
--header 'content-type: application/json' \
-d '{"path":"my-topic", "type":"json",
"properties":{ "VALIDATE_VALUES":"true" }
}'
Parameter | Whether Optional | Description |
---|---|---|
|
No |
The path at which the topic must be added |
|
Yes |
The type of topic. The default value is |
|
Yes |
A map of topic properties. The default value is |
200 |
The topic was added successfully (or already exists) |
---|---|
|
There was a problem adding the topic due to the parameters supplied. See |
|
There was an unexpected problem adding the topic. See |
Removing topics
You can remove a single topic, or multiple topics using a topic selector.
Endpoint |
|
Content-type |
|
Method |
|
curl --include \
--request POST \
--url https://api.diffusion.cloud/topics/remove \
--header 'authorization: Bearer <TOKEN>' \
--header 'content-type: application/json' \
-d '{"path":"my-topic"}'
Parameter | Optional? | Default | Description |
---|---|---|---|
path |
Yes |
— |
The Diffusion topic path as a string. |
selector |
Yes |
— |
The Diffusion topic selector as a string. |
Code | Description |
---|---|
|
Topics removed successfully |
|
There was a problem removing the topics due to the parameters supplied. See |
|
There was an unexpected problem removing the topics. See |