Child pages
  • HTTP Communications Protocol
Skip to end of metadata
Go to start of metadata

HTTP

Labeeb IoT supports pushing data through a HTTP POST request,which covers all applications and devices uses HTTP as a communication protocol and gives a wide range of supported devices and applications.

HTTP Overview

HTTP clients  can use POST requests to push data to Labeeb IoT Platform as shown in the below figure:

HTTP POST request : 

Use the following header options for your POST request : 

headervalue
URL

http://mea.labeeb-iot.com/iot-dcm/rest/PushServices/pushData

MethodPOST
Content-Type

application/json

HTTP Messages Format : 

Use the following JSON object as your HTTP POST body : 

Body format :

{
  "username" : "UserName", / / / As mentioned on the DeviceTemplate
  "password" : "Password", / / / As mentioned on the DeviceTemplate
  "enterpriseName" : "EnterpriseName", / / / Use only lower case
  "deviceTemplateId" : "TemplateName", / / / Use the device template name
  "deviceId" : "DeviceId", / / / Use the device name
  "dataModelValues" :

  [

   {
     "modelId" : "DataModelName",
     "dataTime" : "Timestamp", // example: "1480879058989"
     "longitude" : "Longitude", // example: "52.367"
     "latitude" : "Latitude", // example: "28.458"
     "altitudeInMeters" : "Altitude", // example: "0.5"
     "values" :

      [
       {
         "dataTypeId" : "DataTypeId", / / / Use the data type name
         "value" : "Value"
       },
       {
         "dataTypeId" : "DataTypeId",/ / / Use the data type name
         "value" : "Value"
       }
      ]

   }

  ]

}

 

Response Body 

Body format :

{
"status": <STATUS>,
"message": "<MESSAGE>"
}


Status CodeMessageDescriptionResponse Example
200Message sent
Data sent to Labeeb Platform {
"status": 200,
"message": "Message sent"
}
200Error : <SOME FIELD> is missingData sent to Labeeb with a missing required field

{
"status": 200,
"message": "Error : deviceTemplateId is missing"
}

125Unexpected character .. error in JSON structure

Unexpected character ('}' (code 125)): was expecting double-quote to start field name at

[Source: org.apache.catalina.connector.CoyoteInputStream@6df0531c; line: 11, column: 8]