User Tools

Site Tools


api:iptv:mqttbroker:create

API : IPTV : MQTT broker : Create

Introduction

This will create a new MQTT broker configuration for IPTV / FlexCare.

A configuration identifies an MQTT broker (host, port and protocol) together with an optional topic prefix, and is assigned to a reseller. The reseller must already exist, be a reseller and have the FLEXCARE feature enabled.

The id of the new configuration is generated by the server; any _id sent in the request body is ignored. On success the full, stored configuration is returned.

Request

URL https://api.telecomx.dk/iptv/brokerconfig
Method POST
Access level RESELLER admin (with the TV employee feature)
ADMIN
Body reseller [required] ObjectId of the reseller that owns the configuration. Must be an existing reseller with the FLEXCARE feature.
name [required] Name of the broker configuration.
host [required] Hostname or IP address of the MQTT broker.
port [required] Port of the MQTT broker.
topicPrefix [optional] Prefix applied to MQTT topics. Default empty string.
protocol [optional] Connection protocol, one of TCP, SSL or TLS. Default SSL.

Request body

{
   reseller: "0987654321DCBA0987654321",
   name: "Main broker",
   host: "mqtt.telecomx.dk",
   port: 8883,
   topicPrefix: "acme/",
   protocol: "SSL"
}

Response

Configuration
_id ObjectId Unique id of the broker configuration (generated by the server)
reseller ObjectId The reseller (customer) that owns the configuration
name String Name of the broker configuration
host String Hostname or IP address of the MQTT broker
port Number Port of the MQTT broker
topicPrefix String Prefix applied to MQTT topics (may be an empty string)
protocol String Connection protocol: TCP, SSL or TLS

Example

{
   _id: "1234567890ABCD1234567890",
   reseller: "0987654321DCBA0987654321",
   name: "Main broker",
   host: "mqtt.telecomx.dk",
   port: 8883,
   topicPrefix: "acme/",
   protocol: "SSL"
}

Errors

Error code Message Description
404 name name is required. Returned as “Property is missing.” when omitted or not a string.
404 host host is required. Returned as “Property is missing.” when omitted or not a string.
404 port port is required. Returned as “Property is missing.” when omitted or not a number.
409 protocol protocol must be one of TCP, SSL or TLS.
404 reseller The given reseller is missing, malformed, or is not an existing reseller.
403 reseller The given reseller exists but does not have the FLEXCARE feature.
403 access_denied Insufficient access level — minimum RESELLER admin required, or the RESELLER admin does not have the TV employee feature.
422 multiple More than one field failed validation; the individual errors are returned in the inner array.
500 internal_error <Unspecified>
api/iptv/mqttbroker/create.txt · Last modified: by Mikkel Frederiksen

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki