Add endpoint for MQTT device

This request allows the client application to create an MQTT endpoint in IMPACT DC.

Table 1. Add endpoint for MQTT device
Title Add endpoint for MQTT device
URL http://<Impact_URL>/m2m/endpoints
Method POST
Content-Type application/json
URL Params

The URL parameters are:

  • serialNumber:[string]: Specifies the serial number of MQTT device. This parameter is mandatory.

  • protocol:[string]: Specifies the communication protocol of the device. For MQTT device, use MQTT. This parameter is mandatory.

  • groupName:[string]: Specifies the name of the IMPACT group to which the device registers. This parameter is mandatory.

  • additionalParams:[composite]: Specifies the additional parameters for MQTT Payload. Additional parameters are username or password.

    Following is the sample MQTT payload for Add End point API:

    {
         "serialNumber": "<deviceid>",
         "protocol": "MQTT",
         "groupName": "<tenant>",
         "additionalParams": 
         { "userName": "<user>","password": "<pass>" }
    }
Data Params msg:[string] - info/warning/error message
Success Code
Response Code: 200
Error Code
403  Forbidden 
401  Unauthorized 
404  Not Found 
Sample Call Curl:
curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' --header 'Authorization: Basic ZG9jdXNlcjpBc2RmMSM=' curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' --header 'Authorization: Basic ZG9jdXNlcjpBc2RmMSM=' -d { "serialNumber": "mqttdevice", "protocol": "MQTT", "groupName": "Nokia", "additionalParams": { "userName": "mqttuser", "password": "mqttpass" }}

{"msg":"Device added successfully","code":3000}