The chat responses are generated using Generative AI technology for intuitive search and may not be entirely accurate. They are not intended as professional advice. For full details, including our use rights, privacy practices and potential export control restrictions, please refer to our Generative AI Service Terms of Use and Generative AI Service Privacy Information. As this is a test version, please let us know if something irritating comes up. Like you get recommended a chocolate fudge ice cream instead of an energy managing application. If that occurs, please use the feedback button in our contact form!
Skip to content
Insights Hub and Industrial IoT

Insights Hub drives smart manufacturing through the industrial Internet of Things. Gain actionable insights with asset and operational data and improve your processes.

Message Broker Service– Samples¶

Subscribing Events¶

Note

This is applicable only for Early access customers.

You can choose to be notified for events of your Interest. It is also possible to subscribe for event notifications generated based on event changes. Multiple subscriptions for the same event can be created for each version of the application.

Subscribe to the event notification¶

Creating or updating Event Subscription:

Use the following endpoint:

PUT /subscribers/{id}/versions/{versionId}/topics/{topicId}
Content-Type: application/json

After successful subscription, the subscriber can receive messages from the given topic over the webhook uri. Webhook uri should provide support for http post operation only.

Request example:

{
  "uri": "https://gateway.eu1.mindsphere.io/api/thirdpartyapp-tenantname/v1/mywebhookURL"
}

Response example:

{
  "uri": "https://gateway.eu1.mindsphere.io/api/thirdpartyapp-tenantname/v1/mywebhookURL"
}

Getting the details of events subscribed¶

You can get the details of the subscription to which you are already subscribed. Use the following endpoint:

GET /subscribers/{id}/versions/{versionId}/topics/{topicId}

Response example:

{
  "uri": "https://gateway.eu1.mindsphere.io/api/thirdpartyapp-tenantname/v1/mywebhookURL"
}

Deleting the subscription¶

If you do not want to receive any further notifications, you can delete the created subscription.

DELETE /subscribers/{id}/versions/{versionId}/topics/{topicId}

Response example

Status 204 No Content

Publishing message on topic of Interest¶

Publishing the message:

Publishes new messages to the given topic. Use the following endpoint:

POST /topics/{id}/sendmessage
Content-Type: application/json

Request example:

{
  "content": "string"
}

Response example:

Status 201 No Content