Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Tip
titleWelcome to the Labeeb IoT APIs and Web Services space!

This page is dedicated to the Labeeb IoT Platform APIs and Web Services space.

The Labeeb IoT platform exposes a comprehensive set of RestFul/JSON web services which could be used to develop new IoT services and applications, or to integrate existing systems with Labeeb IoT. All the features which are available on the Labeeb IoT Portal are also exposed as web services.

This page describes the list of all existing web services and how to use them.


 

Table of Contents

1.Purpose

2. Web Services

2.1 User Services

2.1.1 Authenticate


TitleAuthenticate
URL/authenticate
MethodPOST
URL Params-
Content-Type
  • application/json
Data Params
  • enterpriseName : required
  • userName : required
  • password : required
  • ip : optional
Sample Request


Code Block
themeConfluence
titlejson
{
 "enterpriseName": "QMIC",
 "userName": "user1",
 "password": "password1"
}


Accept
  • application/json
Success Response
  • Code: 200 
  • Content:
     
Code Block
themeConfluence
titlejson
{
    "companyName":null,
    "enterpriseId": 5,
    "enterpriseName": "QMIC",
    "lastLock":
    {
    },
    "numberOfFailedAuthenticationBeforeSuccessfulLogin": 0,
    "permissions":
    [
        {
            "description": "Permission to access updateDataTypeAssignment web service",
            "name": "updateDataTypeAssignment",
            "permissionId": null,
            "type": "WEB_SERVICE"
        },
        {
            "description": "Permission to access updateDevice web service",
            "name": "updateDevice",
            "permissionId": null,
            "type": "WEB_SERVICE"
        },
        {
            "description": "Permission to access updateDeviceTemplate web service",
            "name": "updateDeviceTemplate",
            "permissionId": null,
            "type": "WEB_SERVICE"
        }
    ],
    "person":
    {
        "personId": 1,
        "firstName": "elyes",
        "fullName": null,
        "lastName": "elyes",
        "personTitle": null
    },
    "userAcoountIpId": 1,
    "userName": "qmic"
}


Error Response
  • Code: 500
     

    Code Block
    themeConfluence
    titlejson
    {
        "message": "Authentication Failure",
        "code": "TECHNICAL_PROBLEM"
    }


 

2.1.2 Logout


TitleLogout
URL/logout
MethodGET
URL Params-
Content-Type

-

Data Params

-

Sample Request

-

Accept
  • application/json
Success Response
  • Code: 200 
  • Content:
     
Code Block
themeConfluence
titlejson
{
    "status": 200,
    "message": "Logout with Success"
}


Error Response

-

 

2.2 Data Services

2.2.1 Get Dashboard Data

 

TitlegetDashBoardData
URL/getDashBoardData
MethodGET
URL Params
  • startDate : optional
    • Pattern : yyyy-MM-dd HH:mm:ss.SSS
  • endDate : optional
    • Pattern : yyyy-MM-dd HH:mm:ss.SSS
  • type : List optional
    • ALL

    • DEVICE_STATUS_COUNT

    • DEVICE_STATUS_ALERTS_COUNT

    • DEVICE_STATUS_LOCATION

    • USERS_COUNT

    • DEVICES_COUNT

    • DATA_RECORDS_COUNT

Content-Type

-

Data Params

-

Sample Request

/getDashBoardData?startDate=01-01-2012%2000:00:00.000&endDate=31-12-2015%2000:00:00.000&type=USERS_COUNT&type=DEVICES_COUNT

Accept
  • application/json
Success Response
  • Code: 200 
  • Content:
     
Code Block
themeConfluence
titlejson
{
    "devicesCount": 4,
    "storedDataRecordsCount": 0,
    "filteredDataRecords": 0,
    "behaviorAlertCount":
    {
        "availabilitycount":
        {
            "deviceOfflineCount": 0,
            "deviceOnlineCount": 0,
            "unknownCount": 0
        },
        "statusCount":
        {
            "blacklistedCount": 0,
            "malfunctioningCount": 0,
            "unknownCount": 0,
            "workingCount": 0
        },
        "totalAlerts": 0,
        "unseenAlerts": 0
    }
}


Error Response

Code: 500
 

Code Block
themeConfluence
titlejson
{
    "message": "User not Authenticated",
    "code": "UNALLOWED_OPERATION"
}


 

2.2.2 Get Activity Logs


TitleGet Activity Logs
URL/getActivityLogs
MethodPOST
URL Params-
Content-Type
  • application/json
Data Params
  • activityLogSearchCriteria :ActivityLogSearchCriteria required
    • startDate   : optional
    • endDate  : optional
    • "sourceModuleEnum" : must be "MDD"   : required 
    • "severityEnum" : could be EMERGENCY, ALERT, CRITICAL, ERROR, WARNING, NOTICE, INFORMATIONAL, DEBUG : required
       
Sample Request


Code Block
themeConfluence
titlejson
{
  "startDate" : "2016-03-01T12:00:00+01:00",
  "endDate" : "2016-03-01T12:00:00+01:00",
  "sourceModuleEnum" : "MDD",
  "severityEnum" : "CRITICAL",
}


Accept
  • application/json
Success Response
  • Code: 200 
  • Content:
     
Code Block
themeConfluence
titlejson
[
    {
        "alerts":
        [
            {
                "alertDetail": null,
                "alertId": 220,
                "alertMessage": " OLD Status : 3 NEW status 3",
                "alertSeverity": "ALERT",
                "alertSourceType": "DEVICE_BEHAVIOR_MONITOR",
                "alertTime": 1431417153423,
                "availability": null,
                "dataModelId": "GPS",
                "dataTypeId": "speed",
                "deviceId": "device1",
                "deviceTemplateId": "capteur_template",
                "enterpriseId": "QMIC1",
                "seen": true,
                "status": "UNKNOWN"
            },
            {
                "alertDetail": null,
                "alertId": 219,
                "alertMessage": " OLD Status : 3 NEW status 3",
                "alertSeverity": "ALERT",
                "alertSourceType": "DEVICE_BEHAVIOR_MONITOR",
                "alertTime": 1431417153420,
                "availability": null,
                "dataModelId": "GPS",
                "dataTypeId": "speed",
                "deviceId": "device2",
                "deviceTemplateId": "capteur_template",
                "enterpriseId": "QMIC1",
                "seen": true,
                "status": "UNKNOWN"
            }
]


Error Response
  • Code: 500
     

    Code Block
    themeConfluence
    titlejson
    {
        "message": "The entity must not be null",
        "code": "TECHNICAL_PROBLEM"
    }


 

 

2.2.3 Get Data


TitleGet Data
URL/getData
MethodPOST
URL Params-
Content-Type
  • application/json
Data Params
  • "dataSearchCriteria" : DataSearchCriteria required
  • "fromDate"  : optional 
  • " toDate"      : optional 
  • "dataModelName" : optional  
  • "dataTypeName" : optional 
  • "deviceName" : optional 
  • "maxDataRecords" : required
  • "operatorEnum": optional 
      • could be [ CONTAINS, EQUAL, DIFFERENT, GREATER_THAN, GREATER_OR_EQUAL_TO, LESS_OR_EQUAL_TO, LESS_THAN ]
  • "thresholdValue" : optional  
Sample Request


Code Block
themeConfluence
titlejson
{
  "fromDate" : "2016-03-01T12:00:00+01:00",
  "toDate" : "2016-03-01T12:00:00+01:00",
  "dataModelName" : "model1",
  "dataTypeName" : "type1",
  "deviceName" : "device1",
  "maxDataRecords" : "100",
  "operatorEnum" : "GREATER_THAN",
  "thresholdValue" : "0",
}


Accept
  • application/json
Success Response
  • Code: 200 
  • Content:
     
Code Block
themeConfluence
titlejson
{ 			"altitudeInMeters" : 0,
            "booleanValue" : ,
            "dataModelId" : "TH_DM",
            "dataSource" : "GENERIC_MQTT_M_2_M_DEVICES",
            "dataTime" : "2016-07-31T13:36:58+03:00",
            "dataTypeId" : "temp",
            "deviceId" : "test_device",
            "doubleValue" : "1",
            "latitude" : "0",
            "longitude" : "0",
            "receiveTime" : "2016-07-31T13:36:58.676+03:00",
            "storeTime" : "2016-07-31T13:36:58.684+03:00",
            "stringValue" : ""
}


Error Response
  • Code: 500
     

    Code Block
    themeConfluence
    titlejson
    {
        "message": "The entity must not be null",
        "code": "TECHNICAL_PROBLEM"
    }


2.3 Device Services

2.3.1 Get Devices

 

TitlegetDevices
URL/getDevices
MethodGET
URL Params
  • deviceStatusEnum : List :optional
    • WORKING

    • MALFUNCTIONING

    • BLACKLISTED

    • UNKNOWN

  • deviceAvailibiltyEnum : List :optional
    • OFFLINE

    • ONLINE

    • UNKNOWN

  • deviceName : optional
Content-Type

-

Data Params

-

Sample Request

/getDevices?deviceStatusEnum=WORKING&deviceStatusEnum=MALFUNCTIONING&deviceAvailibiltyEnum=ONLINE&deviceName =dv1

Accept
  • application/json
Success Response
  • Code: 200 
  • Content:
     
Code Block
themeConfluence
titlejson
[
    {
        "deviceStatusEnum": null,
        "deviceAvailibiltyEnum": "OFFLINE",
        "deviceHeartbeatProfile":
        {
            "intelligenceAlgo": "PERIODIC",
            "numberPackets": 1,
            "timeMeasure": "MINUTE",
            "timePeriod": 1
        },
        "deviceName": "device2",
        "deviceTemplateId": "capteur_template",
        "deviceTypeEnum": null,
        "latestLocation":
        {
            "altitudeInMeters": 0,
            "description": null,
            "latitude": 25.3139252,
            "locationName": null,
            "longitude": 51.43558502
        },
        "latestIp": null,
        "latestConnectionTime": 1428820905000,
        "alertsCount": 99,
        "description": "",
        "serialNumber": "",
        "firmwareVersion": "",
        "deviceManufacture": null,
        "deviceModel": null,
        "simCard":
        [
            {
                "iccid": null,
                "phoneNumber": 0,
                "pin": null
            }
        ],
        "ipAddresses": null,
        "timeZone": null,
        "locationTimeStamp": null,
        "enterpriseId": "QMIC1",
        "mqttLogin": "Ahmed",
        "mqttPassword": null,
        "modelTypeStatus":
        {
            "entry":
            [
                {
                    "key":
                    {
                        "dataModelId": "GPS",
                        "dataTypeId": "speed"
                    },
                    "value":
                    {
                        "dataModelId": "GPS",
                        "dataTypeId": "speed",
                        "status": "UNKNOWN",
                        "behaviorTime": 1431417153370,
                        "location": null,
                        "raison": null,
                        "startTime": null,
                        "endTime": null
                    }
                }
            ]
        },
        "availabilityDetails":
        {
            "availability": "OFFLINE",
            "endTime": null,
            "location": null,
            "raison": null,
            "behaviorTime": 1431326913693,
            "startTime": null
        }
    }
]


Error Response

Code: 500
 

Code Block
themeConfluence
titlejson
{
    "message": "User not Authenticated",
    "code": "UNALLOWED_OPERATION"
}


 

2.3.2 Change Device Status

 

TitlechangeDeviceStatus
URL/changeDeviceStatus
MethodPOST
URL Params-
Content-Type
  • application/json
Data Params
  • alertCount : BigInteger: optional

  • availability: String : optional

    • OFFLINE

    • ONLINE

    • UNKNOWN

  • behaviorTime: String : optional

    • Pattern : yyyy-MM-dd HH:mm:ss.SSS
  • dataModelId: String : optional

  • dataTypeId: String : optional

  • String deviceId: String : required

  • deviceTemplateId: String : required

  • endTime: String : optional

    • Pattern : yyyy-MM-dd HH:mm:ss.SSS
  • gpsAltitude: Double: optional

  • gpsLatitude: Double: optional

  • gpsLongitude: Double: optional

  • raison: String : optional

  • startTime: String : optional

  • status: String : required

Sample Request


Code Block
themeConfluence
titlejson
[
	{
		"deviceId": "device1",
		"deviceTemplateId": "capteur_template",
		"status": "MALFUNCTIONING"
	}
]


Accept
  • application/json
Success Response
  • Code: 200 
  • Content:
     
Code Block
themeConfluence
titlejson
{
  "status": 200,
  "message": "Success"
}


Error Response
  • Code: 500
     

    Code Block
    themeConfluence
    titlejson
    {
      "message": "status",
      "code": "PARAMETER_MANDATORY"
    }


 

2.3.3 Update Device

 

TitleupdateDevice
URL/updateDevice
MethodPOST
URL Params-
Content-Type
  • application/json
Data Params
  • deviceStatusEnum: String :   optional  
    • WORKING
    • MALFUNCTIONING
    • BLACKLISTED
    • UNKNOWN;
  • deviceAvailibiltyEnum: String : optional  

    • OFFLINE
    • ONLINE
    • UNKNOWN
  • deviceHeartbeatProfile : DeviceHeartbeatProfile

      • intelligenceAlgo : optional 
      • numberPackets : optional 
      • timeMeasure : optional 
      • timePeriod : optional   
  • deviceName: String :required 

  • deviceTemplateId: String : required
  • deviceTypeEnum: String : optional
    • Could be :
      • FM_DEVICE

      • RFID

      • SENSOR

      • GATEWAY

      • PHONE

  • latestLocation: Location :optional   
      • "altitudeInMeters" 
      • "description" 
      • "latitude" 
      • "locationName" 
      • "longitude" 
  • latestIp: String : optional   
  • latestConnectionTime : Date (timestamp) : optional   
  • alertsCount : Integer : optional   
  • description:String : optional 
  • serrialNumber : String : optional 
  • firmwareVersion : String : optional 
  • deviceManufacture:String : optional 
  • deviceModel : String : optional 
  • simCard : ArrayList<SimCard> : optional 
  • ipAddresses : String : optional 
  • timeZone : String,
  • locationTimeStamp : Date : optional 
  • mqttLogin : String : optional 
  • mqttPassword : String : optional 
Sample Request


Code Block
themeConfluence
titlejson
{
  "deviceStatusEnum" : "MALFUNCTIONING",
  "deviceAvailibiltyEnum" : "ONLINE",
  "deviceHeartbeatProfile" : {
    "intelligenceAlgo" : null,
    "numberPackets" : 0,
    "timeMeasure" : null,
    "timePeriod" : null
  },
  "deviceName" : "testDevice",
  "deviceTemplateId" : "deviceTemplateId",
  "deviceTypeEnum" : "PHONE",
  "latestLocation" : {
    "altitudeInMeters" : null,
    "description" : null,
    "latitude" : null,
    "locationName" : null,
    "longitude" : null
  },
  "latestIp" : "latestIp",
  "latestConnectionTime" : 1433060399913,
  "alertsCount" : 1,
  "description" : "device desc",
  "serialNumber" : "32151212321",
  "firmwareVersion" : "321354444",
  "deviceManufacture" : "deviceManufacture",
  "deviceModel" : "deviceModel",
  "simCard" : [ ],
  "ipAddresses" : null,
  "timeZone" : "GMT",
  "locationTimeStamp" : 1433060399913,
  "mqttLogin" : "111",
  "mqttPassword" : "9999"
}


Accept
  • application/json
Success Response
  • Code: 200 
  • Content:
     
Code Block
themeConfluence
titlejson
{
  "status": 200,
  "message": "Success"
}


Error Response
  • Code: 500
     

    Code Block
    themeConfluence
    titlejson
    {
        "message": "Error while updating the device :Error while updating the device :Error while updating Device The give Device to update don't exists",
        "code": "TECHNICAL_PROBLEM"
    }


 

2.3.4 Delete Device

 

TitledeleteDevice
URL/deleteDevice
MethodPOST
URL Params-
Content-Type
  • application/json
Data Params
  • deviceName: String : required
Sample Request


Code Block
themeConfluence
titlejson
{
  "deviceName" : "dv001"
}


Accept
  • application/json
Success Response
  • Code: 200 
  • Content:
     
Code Block
themeConfluence
titlejson
{
  "status": 200,
  "message": "Success"
}


Error Response
  • Code: 500
     

    Code Block
    themeConfluence
    titlejson
    {
        "message": "Error accured while removing devices: No devices found to remove",
        "code": "TECHNICAL_PROBLEM"
    }


 

2.3.5 Create Device

 

TitlecreateDevice
URL/createDevice
MethodPOST
URL Params-
Content-Type
  • application/json
Data Params
  • deviceStatusEnum: String :   optional  
    • WORKING
    • MALFUNCTIONING
    • BLACKLISTED
    • UNKNOWN;
  • deviceAvailibiltyEnum: String : optional  

    • OFFLINE
    • ONLINE
    • UNKNOWN
  • deviceHeartbeatProfile : DeviceHeartbeatProfile

      • intelligenceAlgo : mandatory
      • numberPackets : mandatory
      • timeMeasure : mandatory
      • timePeriod : mandatory
  • deviceName: String :required 

  • deviceTemplateId: String : required
  • deviceTypeEnum: String : optional
    • Could be :
      • FM_DEVICE

      • RFID

      • SENSOR

      • GATEWAY

      • PHONE

  • latestLocation: Location :optional   
      • "altitudeInMeters" 
      • "description" 
      • "latitude" 
      • "locationName" 
      • "longitude" 
  • latestIp: String : optional   
  • latestConnectionTime : Date (timestamp) : optional   
  • alertsCount : Integer : optional   
  • description:String : optional 
  • serrialNumber : String : optional 
  • firmwareVersion : String : optional 
  • deviceManufacture:String : optional 
  • deviceModel : String : optional 
  • simCard : ArrayList<SimCard> : optional 
  • ipAddresses : String : optional 
  • timeZone : String,
  • locationTimeStamp : Date : optional 
  • mqttLogin : String : optional 
  • mqttPassword : String : optional 
Sample Request


Code Block
themeConfluence
titlejson
{
  "deviceStatusEnum" :"MALFUNCTIONING",
  "deviceAvailibiltyEnum" : "ONLINE",
  "deviceHeartbeatProfile" : {
    "intelligenceAlgo" :"PERIODIC",
    "numberPackets" : 0,
    "timeMeasure" : "SECOND",
    "timePeriod" : 0
  },

  "deviceName" : "testDevice",
  "deviceTemplateId" : "temp",
  "deviceTypeEnum" : "PHONE",


  "latestLocation" : {


    "altitudeInMeters" : null,


    "description" : null,


    "latitude" : null,


    "locationName" : null,


    "longitude" : null


  },


  "latestIp" : "latestIp",


  "latestConnectionTime" : 1433060399913,


  "alertsCount" : 1,


  "description" : "device desc",


  "serialNumber" : "32151212321",


  "firmwareVersion" : "321354444",


  "deviceManufacture" :
"deviceManufacture",


  "deviceModel" : "deviceModel",


  "simCard" : [ ],


  "ipAddresses" : null,


  "timeZone" : "GMT",


  "locationTimeStamp" : 1433060399913,


  "mqttLogin" : "111",


  "mqttPassword" : "9999"


}


Accept
  • application/json
Success Response
  • Code: 200 
  • Content:
     
Code Block
themeConfluence
titlejson
{
  "status": 200,
  "message": "Success"
}


Error Response
  • Code: 500
     

    Code Block
    themeConfluence
    titlejson
    {
        "message": "The given Enterprise or Device Template did not exists",
        "code": "TECHNICAL_PROBLEM"
    }


 

2.3.6 Get Data Type

 

TitlegetDataType
URL/getDataType
MethodGET
URL Params
  • dataTypeId: String : required
Content-Type

-

Data Params

-

Sample Request

/getDataType?dataTypeId=speed

Accept
  • application/json
Success Response
  • Code: 200 
  • Content:
     
Code Block
themeConfluence
titlejson
{  "deviceStatusEnum" : "MALFUNCTIONING",  "deviceAvailibiltyEnum" : "ONLINE",  "deviceHeartbeatProfile" : {    "intelligenceAlgo" : "PERIODIC",    "numberPackets" : 0,    "timeMeasure" : "SECOND",    "timePeriod" : 0  },  "deviceName" : "testDevice",  "deviceTemplateId" : "temp",  "deviceTypeEnum" : "PHONE",  "latestLocation" : {    "altitudeInMeters" : null,    "description" : null,    "latitude" : null,    "locationName" : null,    "longitude" : null  },  "latestIp" : "latestIp",  "latestConnectionTime" : 1433060399913,  "alertsCount" : 1,  "description" : "device desc",  "serialNumber" : "32151212321",  "firmwareVersion" : "321354444",  "deviceManufacture" : "deviceManufacture",  "deviceModel" : "deviceModel",  "simCard" : [ ],  "ipAddresses" : null,  "timeZone" : "GMT",  "locationTimeStamp" : 1433060399913,  "mqttLogin" : "111",  "mqttPassword" : "9999"}


Error Response

Code: 500
 

Code Block
themeConfluence
titlejson
{
    "message": "User not Authenticated",
    "code": "UNALLOWED_OPERATION"
}


 

2.3.7 Create Data Type

 

TitlecreateDataType
URL/createDataType
MethodPOST
URL Params-
Content-Type
  • application/json
Data Params
  • dataType: DataTypeAccuracy : required
    • dataTypeName : required

    • dataTypeUnit" :List :
      • description : optional
      • unitName : optional
    • description : optional

    • filterExpression : optional

    • primitiveDataTypeEnum" : required

      • INTEGER

      • LONG

      • FLOAT

      • DOUBLE

      • SHORT

      • BOOLEAN

      • TEXT

      • TIMESTAMP

      • CHAR

    • accuracyProfile : optional  

      • accuracyLevel : optional
      • action : optional
      • algo : optional
      • timeMeasure : optional
      • timePeriod : optional
Sample Request


Code Block
themeConfluence
titlejson
{
  "dataTypeName" : "dt1",
  "dataTypeUnit" : {
    "description" : "desc",
    "unitName" : "unit"
  },
  "description" : null,
  "filterExpression" : "expression",
  "primitiveDataTypeEnum" : "DOUBLE",
  "accuracyProfile" : {
    "accuracyLevel" : 0.0,
    "action" : null,
    "algo" : null,
    "timeMeasure" : null,
    "timePeriod" : null
  }
}


Accept
  • application/json
Success Response
  • Code: 200 
  • Content:
     
Code Block
themeConfluence
titlejson
{
  "status": 200,
  "message": "Success"
}


Error Response
  • Code: 500
     

    Code Block
    themeConfluence
    titlejson
    {
        "message": "Error While creating DataType ERROR: duplicate key value violates unique constraint "uq_data_type_data_type_name"
      Detail: Key (data_type_name, end_date)=(dt1, 2060-01-01 00:00:00) already exists. code TECHNICAL_PROBLEM",
        "code": "TECHNICAL_PROBLEM"
    }


 

2.3.8 Update Data Type

 

TitleupdateDataType
URL/updateDataType
MethodPOST
URL Params-
Content-Type
  • application/json
Data Params
  • dataType: DataTypeAccuracy : required
    • dataTypeName : required

    • dataTypeUnit" :List :
      • description : optional
      • unitName : optional
    • description : optional

    • filterExpression : optional

    • primitiveDataTypeEnum" : required

      • INTEGER

      • LONG

      • FLOAT

      • DOUBLE

      • SHORT

      • BOOLEAN

      • TEXT

      • TIMESTAMP

      • CHAR

    • accuracyProfile : optional  

      • accuracyLevel : optional
      • action : optional
      • algo : optional
      • timeMeasure : optional
      • timePeriod : optional
Sample Request


Code Block
themeConfluence
titlejson
{
  "dataTypeName" : "dt1",
  "dataTypeUnit" : {
    "description" : "desc",
    "unitName" : "unit"
  },
  "description" : null,
  "filterExpression" : "expression",
  "primitiveDataTypeEnum" : "DOUBLE",
  "accuracyProfile" : {
    "accuracyLevel" : 0.0,
    "action" : null,
    "algo" : null,
    "timeMeasure" : null,
    "timePeriod" : null
  }
}


Accept
  • application/json
Success Response
  • Code: 200 
  • Content:
     
Code Block
themeConfluence
titlejson
{
  "status": 200,
  "message": "Success"
}


Error Response
  • Code: 500
     

    Code Block
    themeConfluence
    titlejson
    {
      "message": "Error While Getting DataType Data Type speesd don't exists code TECHNICAL_PROBLEM",
      "code": "TECHNICAL_PROBLEM"
    }


 

2.3.9 Get Data Model Names


TitlegetDataModelNames
URL/getDataModelNames
MethodGET
URL Params-
Content-Type

-

Data Params

-

Sample Request

-

Accept
  • application/json
Success Response
  • Code: 200 
  • Content:
     
Code Block
themeConfluence
titlejson
[
    "Test Data",
    "GPS"
]


Error Response
  • Code: 500
  • Content

Code Block
themeConfluence
titlejson
{
    "message": "User not Authenticated",
    "code": "UNALLOWED_OPERATION"
}


 

2.3.10 Get Data Type Names

 

TitlegetDataTypeNames
URL/getDataTypeNames
MethodPOST
URL Params-
Content-Type
  • application/json
Data Params
  • dataModelNames : List<String> : required
Sample Request


Code Block
themeConfluence
titlejson
[ "GPS","DM1" ]


Accept
  • application/json
Success Response
  • Code: 200 
  • Content:
     
Code Block
themeConfluence
titlejson
[
  "dt1",
  "speed"
]


Error Response

-

 

2.3.11 Get Data Model

 

TitlegetDataModel
URL/getDataModel
MethodPOST
URL Params-
Content-Type
  • application/json
Data Params
  • dataModelSearchCriteria: DataModelSearchCriteria : required
      • dataModelName :

        • isCaseSensitive : bool : optional

        • searchString : required

        • stringSearchTypeEnum : optional

          • Could be :

            • "EXACT"

            • "PARTIAL"

      • withDataTypes : bool : optional

      • withLtDataModelDataTypes : bool : optional

Sample Request


Code Block
themeConfluence
titlejson
{
  "dataModelName" : {
    "isCaseSensitive" : true,
    "searchString" : "GPS",
    "stringSearchTypeEnum" : "EXACT"
  },
  "withDataTypes" : true,
  "withLtDataModelDataTypes" : true
}



Accept
  • application/json
Error Response
  • Code: 500
  • Content

    Code Block
    themeConfluence
    titlejson
    {
        "message": "Unmarshalling Error: unexpected element (uri:"", local:"accuracyProfile"). 
    				Expected elements are <{}dataTypeAssign>,<{}enterpriseId>,<{http://service.enterprise.mdd.qmic.org/}
    				accuracyProfile>,<{}dataModelId>",
        "code": "TECHNICAL_PROBLEM"
    }


 

2.3.12 Create Data Model

 

TitlecreateDataModel
URL/createDataModel
MethodPOST
URL Params-
Content-Type
  • application/json
Data Params
  • createDataModelRequest: CreateDataModelRequest: required
    • dataModelName : String : required 
    • dataAccuracyProfile  : required

      • accuracyLevel : float
      • action : String
      • algo : String ( should = "EVENT_DRIVEN_AND_PERIODIC" )
      • timeMeasure : String 
        • Could be :
          • SECOND
          • MINUTE
          • HOUR 
          • DAY
          • WEEK
          • MONTH 
          • YEAR  
      • timePeriod : integer        
Sample Request


Code Block
themeConfluence
titlejson
{
  "dataModelName" : "GPS",
  "description" : "desc",
  "dataAccuracyProfile" : {
    "accuracyLevel" : 0.0,
    "action" : null,
    "algo" : null,
    "timeMeasure" : null,
    "timePeriod" : null
  },
  "dataModelTypes" : [ {
    "dataTypeName" : "dataType1",
    "typeEnum" : "FLOAT",
    "dataAccuracyProfile" : {
      "accuracyLevel" : 0.0,
      "action" : null,
      "algo" : null,
      "timeMeasure" : null,
      "timePeriod" : null
    },
    "valueFilter" : {
      "expression" : null,
      "action" : null
    },
    "timeMetadataFilter" : {
      "expression" : null,
      "action" : null
    },
    "locationMetadataFilter" : {
      "expression" : null,
      "action" : null
    },
    "storageOptions" : {
      "storageTypeEnum" : null,
      "frequency" : null,
      "measureEnum" : null,
      "ruleEnum" : null,
      "scopeEnum" : null,
      "recordsNumber" : null
    },
    "unit" : "unit1"
  } ]
}





Accept
  • application/json
Error Response
  • Code: 500
  • Content

    Code Block
    themeConfluence
    titlejson
    {
        "message": "Unmarshalling Error: unexpected element (uri:"", local:"accuracyProfile"). 
    				Expected elements are <{}dataTypeAssign>,<{}enterpriseId>,<{http://service.enterprise.mdd.qmic.org/}
    				accuracyProfile>,<{}dataModelId>",
        "code": "TECHNICAL_PROBLEM"
    }


 

2.3.13 Delete Data Model

 

TitledeleteDataModel
URL/deleteDataModel
MethodPOST
URL Params

-

Content-Type
  • application/json
Data Params
  • dataModelName : String
Sample Request

GPS : required 

Accept
  • application/json
Success Response
  • Code: 200 
  • Content:
     
Code Block
themeConfluence
titlejson
{
  "status": 200,
  "message": "Success"
}


Error Response

Code: 500
 

Code Block
themeConfluence
titlejson
{
    "message": "Data Model GPS is still asigned to other device templates",
    "code": "TECHNICAL_PROBLEM"
}


 

2.3.14 Get Device Names


TitlegetDeviceNames
URL/getDeviceNames
MethodGET
URL Params-
Content-Type

-

Data Params

-

Sample Request

-

Accept
  • application/json
Success Response
  • Code: 200 
  • Content:
     
Code Block
themeConfluence
titlejson
[
    "DD",
    "ddd",
    "DDD",
    "device1",
    "device1",
    "device2",
    "device3",
    "device4",
    "pp"
]


Error Response

-

 

2.3.15 Get Device Template

 

TitlegetDeviceTemplate
URL/getDeviceTemplate
MethodGET
URL Params
  • deviceSource: String :  required 
    • Could be :
      • GENERIC_MQTT_M_2_M_DEVICES
      • COAP
  • deviceTemplateName String :optional
Content-Type

-

Data Params

-

Sample Request

/getDeviceTemplate?deviceSource=GENERIC_MQTT_M_2_M_DEVICES&deviceTemplateName=test

Accept
  • application/json
Success Response
  • Code: 200 
  • Content:
Error Response

Code: 500
 

Code Block
themeConfluence
titlejson
{
     "message":"Error while getting Device Templates",
     "code":"TECHNICAL_PROBLEM"
}


 

2.3.16 Update Device Template


TitleupdateDeviceTemplate
URL/updateDeviceTemplate
MethodPOST
URL Params-
Content-Type
  • application/json
Data Params
  • deviceTemplateDetails  : DeviceTemplateDetailsUpdate required
    • deviceTemplateName : required

    • description : optional

    • dataSourceEnum: required

    • location : optional

      • altitudeInMeters

      • description : optional

      • latitude : optional

      • locationName : optional

      • longitude : optional

    • timeZone : required

    • deviceHeartbeatProfile : required

      • intelligenceAlgo : required

      • numberPackets : required

      • timeMeasure : required

      • timePeriod : required

    • "login" : required

    • "password" : required

Sample Request


Code Block
themeConfluence
titlejson
{
  "deviceTemplateName" : "dtn1",
  "description" : "testdt",
  "dataSourceEnum" : "GENERIC_MQTT_M_2_M_DEVICES",
  "location" : {
    "altitudeInMeters" : null,
    "description" : null,
    "latitude" : null,
    "locationName" : null,
    "longitude" : null
  },
  "timeZone" : "0",
  "deviceHeartbeatProfile" : {
    "intelligenceAlgo" : "PERIODIC",
    "numberPackets" : 1000,
    "timeMeasure" : "HOUR",
    "timePeriod" : 100
  },
  "login" : null,
  "password" : null
}


Accept
  • application/json
Success Response
  • Code: 200 
  • Content:
     
Code Block
themeConfluence
titlejson
{
    "deviceTemplateName": "dtn1",
    "description": "testdt",
    "dataSourceEnum": "GENERIC_MQTT_M_2_M_DEVICES",
    "location": null,
    "dataModelNames":
    [
    ],
    "timeZone": "0",
    "deviceHeartbeatProfile":
    {
        "intelligenceAlgo": "PERIODIC",
        "numberPackets": 1000,
        "timeMeasure": "HOUR",
        "timePeriod": 100
    },
    "login": null,
    "password": null
}


Error Response
  • Code: 500
     

    Code Block
    themeConfluence
    titlejson
    {
        "message": "Error in updating DeviceConfigurationTemplate, nothing updated. Please check the Ids",
        "code": "TECHNICAL_PROBLEM"
    }


 

2.3.17 Create Device Template


TitlecreateDeviceTemplate
URL/createDeviceTemplate
MethodPOST
URL Params-
Content-Type
  • application/json
Data Params
  • deviceTemplateDetails  : DeviceTemplateDetailsUpdate required
    • deviceTemplateName : required

    • description : optional

    • dataSourceEnum: required

    • location : optional

      • altitudeInMeters

      • description : optional

      • latitude : optional

      • locationName : optional

      • longitude : optional

    • timeZone : required

    • deviceHeartbeatProfile : required

      • intelligenceAlgo : required

      • numberPackets : required

      • timeMeasure : required

      • timePeriod : required

    • "login" : required

    • "password" : required

 
Sample Request


Code Block
themeConfluence
titlejson
{
  "deviceTemplateName" : "dtn1",
  "description" : "testdt",
  "dataSourceEnum" : "GENERIC_MQTT_M_2_M_DEVICES",
  "location" : {
    "altitudeInMeters" : null,
    "description" : null,
    "latitude" : null,
    "locationName" : null,
    "longitude" : null
  },
  "timeZone" : "0",
  "deviceHeartbeatProfile" : {
    "intelligenceAlgo" : "PERIODIC",
    "numberPackets" : 1000,
    "timeMeasure" : "HOUR",
    "timePeriod" : 100
  },
  "login" : null,
  "password" : null
}


Accept
  • application/json
Success Response
  • Code: 200 
  • Content:
     
Code Block
themeConfluence
titlejson
{
    "deviceTemplateName": "dtn1",
    "description": "testdt",
    "dataSourceEnum": "GENERIC_MQTT_M_2_M_DEVICES",
    "location": null,
    "dataModelNames":
    [
    ],
    "timeZone": "0",
    "deviceHeartbeatProfile":
    {
        "intelligenceAlgo": "PERIODIC",
        "numberPackets": 1000,
        "timeMeasure": "HOUR",
        "timePeriod": 100
    },
    "login": null,
    "password": null
}


Error Response
  • Code: 500
     

    Code Block
    themeConfluence
    titlejson
    {
        "message": "Exception occurred in createDeviceTemplate : Device Template dtn1 already exists",
        "code": "TECHNICAL_PROBLEM"
    }


 

2.3.18 Delete Device Template


TitledeleteDeviceTemplate
URL/deleteDeviceTemplate
MethodPOST
URL Params-
Content-Type
  • application/json
Data Params
  • deviceTemplateName  : String required
Sample Request

dtn01

Accept
  • application/json
Success Response
  • Code: 200 
  • Content:
     
Code Block
themeConfluence
titlejson
{
  "status": 200,
  "message": "Success"
}


Error Response
  • Code: 500
     

    Code Block
    themeConfluence
    titlejson
    {
        "message": "The given Device Template ss don't exists",
        "code": "TECHNICAL_PROBLEM"
    }


 

2.3.19 Get Device Behavior


TitlegetDeviceBehavior
URL/getDeviceBehavior
MethodPOST
URL Params-
Content-Type
  • application/json
Data Params
  • behaviorCriteria  : BehaviorSearchCriteria required

    • availabilities : optional

    • deviceIds : optional

    • deviceTemplateIds : optional

    • endTime : required

    • startTime : required

    • status : optional

      • deviceStatusEnum : List :optional :

          • Could be :

            • WORKING

            • MALFUNCTIONING

            • BLACKLISTED

            • UNKNOWN

Sample Request


Code Block
themeConfluence
titlejson
{
  "availabilities" : ["ONLINE"],
  "deviceIds" : null,
  "deviceTemplateIds" : null,
  "endTime" : 1451595600000,
  "startTime" : 946674000000,
  "status" : [ ]
}




Accept
  • application/json
Success Response
  • Code: 200 
  • Content:
     
Code Block
themeConfluence
titlejson
[
    {
        "behaviors":
        [
            {
                "alertCount": null,
                "availability": "ONLINE",
                "behaviorTime": 1428573797236,
                "dataModelId": null,
                "dataTypeId": null,
                "deviceId": "device2",
                "deviceTemplateId": "capteur_template",
                "endTime": null,
                "enterpriseId": "QMIC1",
                "gpsAltitude": null,
                "gpsLatitude": null,
                "gpsLongitude": null,
                "raison": null,
                "startTime": null,
                "status": null
            }
            {
                "alertCount": null,
                "availability": "ONLINE",
                "behaviorTime": 1428577517280,
                "dataModelId": null,
                "dataTypeId": null,
                "deviceId": "device1",
                "deviceTemplateId": "capteur_template",
                "endTime": null,
                "enterpriseId": "QMIC1",
                "gpsAltitude": null,
                "gpsLatitude": null,
                "gpsLongitude": null,
                "raison": null,
                "startTime": null,
                "status": null
            }
        ]
    }
]





Error Response
  • Code: 500
     

    Code Block
    themeConfluence
    titlejson
    {
        "message": "Error While retrieving Device Behaviors",
        "code": "TECHNICAL_PROBLEM"
    }


 

2.3.20 Get Latest Device Behavior


TitlegetLatestDeviceBehavior
URL/getLatestDeviceBehavior
MethodPOST
URL Params-
Content-Type
  • application/json
Data Params
  • deviceBehaviorRequest  : LatestDeviceBehaviorRequest : required
    • "deviceIds" : optional

    • "statusFilter" : optional
    • "availabilityFilter" : optional

Sample Request


Code Block
themeConfluence
titlejson
{
  "deviceIds" : [ "device1" ],
  "statusFilter" : [ "MALFUNCTIONING", "WORKING" ],
  "availabilityFilter" : [ "ONLINE", "OFFLINE" ]
}


Accept
  • application/json
Success Response
  • Code: 200 
  • Content:
     
Code Block
themeConfluence
titlejson
[
    {
        "behaviors":
        [
            {
                "alertCount": null,
                "availability": "ONLINE",
                "behaviorTime": 1428573797236,
                "dataModelId": null,
                "dataTypeId": null,
                "deviceId": "device2",
                "deviceTemplateId": "capteur_template",
                "endTime": null,
                "enterpriseId": "QMIC1",
                "gpsAltitude": null,
                "gpsLatitude": null,
                "gpsLongitude": null,
                "raison": null,
                "startTime": null,
                "status": null
            }
            {
                "alertCount": null,
                "availability": "ONLINE",
                "behaviorTime": 1428577517280,
                "dataModelId": null,
                "dataTypeId": null,
                "deviceId": "device1",
                "deviceTemplateId": "capteur_template",
                "endTime": null,
                "enterpriseId": "QMIC1",
                "gpsAltitude": null,
                "gpsLatitude": null,
                "gpsLongitude": null,
                "raison": null,
                "startTime": null,
                "status": null
            }
        ]
    }
]


Error Response
  • Code: 500
     

    Code Block
    themeConfluence
    titlejson
    {
        "message": "Error While retrieving Device Behaviors",
        "code": "TECHNICAL_PROBLEM"
    }


 

2.3.21 Get Device Template Names

 

TitlegetDeviceTemplateNames
URL/getDeviceTemplateNames
MethodGET
URL Params

-

Content-Type

-

Data Params

-

Sample Request

/getDeviceTemplateNames

Accept
  • application/json
Success Response
  • Code: 200 
  • Content:
     
Code Block
themeConfluence
titlejson
[
  "capteur_template",
  "tp2"
]


Error Response-

 

2.3.22 Update Data Model


TitleupdateDataModel
URL/updateDataModel
MethodPOST
URL Params-
Content-Type
  • application/json
Data Params
  • requestData  : UpdateDataModelRequest : required
Sample Request


Code Block
themeConfluence
titlejson
{
  "oldDataModelDetails" : {
    "dataModelName" : "GPS",
    "description" : "",
    "dataModelTypeDetails" : [ ],
    "dataAccuracyProfile" : {
      "accuracyLevel" : 0.0,
      "action" : null,
      "algo" : null,
      "timeMeasure" : null,
      "timePeriod" : null
    }
  },
  "newDataModelDetails" : {
    "dataModelName" : "GPS",
    "description" : "",
    "dataModelTypeDetails" : [ ],
    "dataAccuracyProfile" : {
      "accuracyLevel" : 0.0,
      "action" : null,
      "algo" : null,
      "timeMeasure" : null,
      "timePeriod" : null
    }
  }
}


Accept
  • application/json
Success Response
  • Code: 200 
  • Content:
     
Code Block
themeConfluence
titlejson
{
  "status": 200,
  "message": "Success"
}


Error Response
  • Code: 500
     

    Code Block
    themeConfluence
    titlejson
    {
      "message": "DataModel Name in newDataModel is different from oldDataModel ",
      "code": "INVALID_PARAMETER"
    }



2.3.23 Create Application


TitleCreateApplication
URL/createApplication
MethodPOST
URL Params-
Content-Type
  • application/json
Data Params
  • name: String :required
  • description:String : optional 
  • password :String : optional 
  • applicationAcls : List : ApplicationAcl : optional
Sample Request


Code Block
themeConfluence
titlejson
{
  "name" : "app22",
  "description" : "desc",
  "password" : "pass22",
  "applicationAcls" : [ {
    "accessType" : 1,
    "dataModel" : "+",
    "dataType" : "+",
    "device" : "+",
    "deviceTemplate" : "+"
  } ]
}


Accept
  • application/json
Success Response
  • Code: 200 
  • Content:
     
Code Block
themeConfluence
titlejson
{
    "name": "app22",
    "description": "desc",
    "password": "YES",
    "applicationAcls":
    [
        {
            "accessType": 1,
            "dataModel": "+",
            "dataType": "+",
            "device": "+",
            "deviceTemplate": "+"
        }
    ]
}


Error Response
  • Code: 500
     

    Code Block
    themeConfluence
    titlejson
    {
        "message": "Unexpected Error While createApplication",
        "code": "TECHNICAL_PROBLEM"
    }


 

2.3.24 Update Application


TitleUpdateApplication
URL/updateApplication
MethodPOST
URL Params-
Content-Type
  • application/json
Data Params
  • name: String :required
  • description:String : optional 
  • password :String : optional 
  • applicationAcls : List : ApplicationAcl : optional
Sample Request


Code Block
themeConfluence
titlejson
{
  "name" : "app22",
  "description" : "desc",
  "password" : "pass22",
  "applicationAcls" : [ {
    "accessType" : 1,
    "dataModel" : "+",
    "dataType" : "+",
    "device" : "+",
    "deviceTemplate" : "+"
  } ]
}


Accept
  • application/json
Success Response
  • Code: 200 
  • Content:
     
Code Block
themeConfluence
titlejson
{
    "name": "app22",
    "description": "desc",
    "password": "YES",
    "applicationAcls":
    [
        {
            "accessType": 1,
            "dataModel": "+",
            "dataType": "+",
            "device": "+",
            "deviceTemplate": "+"
        }
    ]
}


Error Response
  • Code: 500
     

    Code Block
    themeConfluence
    titlejson
    {
        "message": "Unexpected Error While updateApplication",
        "code": "TECHNICAL_PROBLEM"
    }


 

2.3.25 Delete Application


TitleDeleteApplication
URL/deleteApplication
MethodPOST
URL Params-
Content-Type
  • application/json
Data Params
  • name: String :required
Sample Request


Code Block
themeConfluence
titlejson
{
  "name" : "app22"
}


Accept
  • application/json
Success Response
  • Code: 200 
  • Content:
     
Code Block
themeConfluence
titlejson
{
    "status": 200,
    "message": "Success"
}


Error Response
  • Code: 500

 

2.3.26 Get Application Names


TitleGetApplicationNames
URL/getApplicationNames
MethodGET
URL Params-
Content-Type

-

Data Params

-

Sample Request
  • /getApplicationNames
Accept
  • application/json
Success Response
  • Code: 200 
  • Content:
     
Code Block
themeConfluence
titlejson
[
  "app10",
  "app13",
  "app15",
  "app1x5",
  "app22",
  "app3",
  "app7",
  "app8",
  "app9"
]


Error Response
  • Code: 500

 

2.3.27 Get Applications


TitleGetApplications
URL/getApplications
MethodPOST
URL Params-
Content-Type
  • application/json
Data Params
  • applicationName: StringSearchCriteria :required

    • isCaseSensitive : optional

    • searchString : required

    • stringSearchTypeEnum : optional

Sample Request
  • {
    "applicationName" : {
    "isCaseSensitive" : false,
    "searchString" : "app1",
    "stringSearchTypeEnum" : "PARTIAL"
    }
    }

Accept
  • application/json
Success Response
  • Code: 200 
  • Content:
     
Code Block
themeConfluence
titlejson
[
  {
    "name": "app10",
    "description": "fdff",
    "password": "NO",
    "applicationAcls": [
      {
        "accessType": 1,
        "dataModel": "GPS",
        "dataType": "speed",
        "device": "+",
        "deviceTemplate": "capteur_template"
      }
    ]
  },
  {
    "name": "app13",
    "description": "desc",
    "password": "NO",
    "applicationAcls": [
      {
        "accessType": 1,
        "dataModel": "+",
        "dataType": "+",
        "device": "+",
        "deviceTemplate": "+"
      }
    ]
  },
  {
    "name": "app15",
    "description": "desc",
    "password": "NO",
    "applicationAcls": [
      {
        "accessType": 1,
        "dataModel": "+",
        "dataType": "+",
        "device": "+",
        "deviceTemplate": "+"
      }
    ]
  },
  {
    "name": "app1x5",
    "description": "desc",
    "password": "NO",
    "applicationAcls": [
      {
        "accessType": 1,
        "dataModel": "+",
        "dataType": "+",
        "device": "+",
        "deviceTemplate": "+"
      }
    ]
  }
]


Error Response
  • Code: 500

 

2.4 Holder Services

2.4.1 Create Holder

 

TitlecreateHolder
URL/createHolder
MethodPOST
URL Params-
Content-Type
  • application/json
Data Params
  • holderId : String :required

  • description: optional

  • contactOwner: optional

  • deviceAssignment: optional

  • location : Location : optional
Sample Request


Code Block
themeConfluence
titlejson
{ 
 "holderId":"holder0101",
 "description":"holder1-desc",
 "contactOwner":{ 
 "drivingLicense":"drv23",
 "firstName":"Ahmed",
 "idCard":"28578800000",
 "lastName":"Khemiri",
 "passport":"R312852"
 },
 "deviceAssignment":[ 
 "device1",
 "device2"
 ],
 "location":{ 
 "altitudeInMeters":366.0,
 "latitude":55.555,
 "longitude":47.6656
 }
}


Accept
  • application/json
Success Response
  • Code: 200 
  • Content:
     
Code Block
themeConfluence
titlejson
{
"contactOwner": {
"addresses": null,
"emails": null,
"languages": null,
"mailingAddresses": null,
"phones": null,
"contactOwner": {
"addresses": null,
"emails": null,
"languages": null,
"mailingAddresses": null,
"phones": null,
"contactOwner": null,
"description": null,
"deviceAssignment": null,
"holderAssignment": null,
"holderId": null,
"holderType": null,
"location": null,
"drivingLicense": null,
"firstName": null,
"fullName": null,
"idCard": null,
"lastName": null,
"passport": null,
"personTitle": null,
"photography": null,
"personId": 0
}
,
"description": null,
"deviceAssignment": null,
"holderAssignment": null,
"holderId": null,
"holderType": null,
"location": null,
"drivingLicense": null,
"firstName": "Ahmed",
"fullName": "Ahmed Khemiri",
"idCard": null,
"lastName": "Khemiri",
"passport": null,
"personTitle": null,
"photography": null,
"personId": 13
}
,
"description": "holder2-desc",
"deviceAssignment": null,
"holderAssignment": null,
"holderId": "holder0202",
"holderType": "GENERIC",
"location": {
"altitudeInMeters": 366,
"description": null,
"latitude": 55.555,
"locationName": "holder_holder0202_loc",
"longitude": 47.6656
}

}



Error Response

Error code : 500

Code Block
themeConfluence
titlejson
{
"message": "holderId",
"code": "Internal error"
}


 

2.4.2 Create Person

 

TitlecreatePerson
URL/createPerson
MethodPOST
URL Params-
Content-Type
  • application/json
Data Params
  • holderId : String :required

  • firstName: String : required
  • lastName : String : required
  • description: optional

  • contactOwner: optional

  • deviceAssignment: optional

  • location : Location : optional
Sample Request

{

"description":"person description",
"holderId":"person-holder-9252",
"drivingLicense":"drv25",
"firstName":"Youssef",
"idCard":"15278801111",
"lastName":"Khemiri",
"passport":"V612587"
}

Accept
  • application/json
Success Response
  • Code: 200 
  • Content:
     
Code Block
themeConfluence
titlejson
14


Error Response

Error code : 500

Code Block
themeConfluence
titlejson
{
"message": "holderId",
"code": "Internal error"
}


 

2.4.3 Create Vehicle

 

TitlecreateVehicle
URL/createVehicle
MethodPOST
URL Params-
Content-Type
  • application/json
Data Params
  • holderId : String :required

  • plateNumber: String : required
  • type: String : required
  • color : String : optional
  • services : Services : optional
  • description: optional

  • contactOwner: optional

  • deviceAssignment: optional

  • location : Location : optional
Sample Request


Code Block
themeConfluence
titlejson
{ 
 "holderId":"vehicle-holder-0101",
 "description":"vehicle description",
 "type":"SEDAN",
 "color":"BLUE",
 "plateNumber":"plate-0202",
 "serialNumber":"serial-0202",
 "deviceAssignment":[ 
 "device1",
 "device2"
 ],
 "services":[ 
 { 
 "nextService":20000,
 "serviceDate":"2017-01-31",
 "serviceValue":10000
 },
 { 
 "nextService":30000,
 "serviceDate":"2017-06-25",
 "serviceValue":20000
 }
 ]
}


Accept
  • application/json
Success Response
  • Code: 200 
  • Content:
     
Code Block
themeConfluence
titlejson
{
"color": "BLUE",
"plateNumber": "plate-0202",
"serialNumber": "serial-0202",
"services": null,
"type": "SEDAN",
"vehicleId": 5,
"contactOwner": null,
"description": "vehicle description",
"deviceAssignment": null,
"holderAssignment": null,
"holderId": "vehicle-holder-0101",
"holderType": "VEHICLE",
"location": null
}



Error Response

Error code : 500

Code Block
themeConfluence
titlejson
{
"message": "holderId",
"code": "Internal error"
}


 

2.4.4 Create Area

 

TitlecreateArea
URL/createArea
MethodPOST
URL Params-
Content-Type
  • application/json
Data Params
  • holderId : String :required

  • adress: String : required
  • areaSize: Integer : optional
  • description: optional

Sample Request


Code Block
themeConfluence
titlejson
{
   "holderId":"area-holder-010656561",
   "description":"area description",
   "adress":"Tunis Tunisia",
   "areaSize":3000
}


Accept
  • application/json
Success Response
  • Code: 200 
  • Content:
     
Code Block
themeConfluence
titlejson
{
"adress": "Tunis Tunisia",
"areaId": 1,
"areaSize": 3000,
"contactOwner": null,
"description": "area description",
"deviceAssignment": null,
"holderAssignment": null,
"holderId": "area-holder-010656561",
"holderType": "AREA",
"location": null
}



Error Response

Error code : 500

Code Block
themeConfluence
titlejson
{
"message": "holderId",
"code": "Internal error"
}


 

2.4.5 Create Building

 

TitlecreateBuilding
URL/createBuilding
MethodPOST
URL Params-
Content-Type
  • application/json
Data Params
  • holderId : String :required

  • adress: String : required
  • floorNumber: String : optional
  • officeNumber: String : optional
  • planPhotography: String : optional
  • description: optional

  • contactOwner: optional

  • deviceAssignment: optional

  • location : Location : optional
Sample Request


Code Block
themeConfluence
titlejson
{  
   "description":"building description",
   "holderId":"building-holder-0266662",
   "adress":"doha Qatar",
   "floorNumber":3,
   "officeNumber":3,
   "planPhotography":"",
   "location":{  
      "altitudeInMeters":366.0,
      "latitude":55.555,
      "longitude":47.6656
   }
}


Accept
  • application/json
Success Response
  • Code: 200 
  • Content:
     
Code Block
themeConfluence
titlejson
{
"adress": "doha Qatar",
"buildingId": 1,
"floorNumber": 3,
"officeNumber": 3,
"planPhotography": "",
"contactOwner": null,
"description": "building description",
"deviceAssignment": null,
"holderAssignment": null,
"holderId": "building-holder-0266662",
"holderType": "BUILDING",
"location": {
"altitudeInMeters": 366,
"description": null,
"latitude": 55.555,
"locationName": "holder_building-holder-0266662_loc",
"longitude": 47.6656
}
}


Error Response

Error code : 500

Code Block
themeConfluence
titlejson
{
"message": "holderId",
"code": "Internal error"
}


 

2.4.6 Get Vehicle

 

TitlegetVehicle
URL/getVehicle
MethodPOST
URL Params-
Content-Type
  • application/json
Data Params
  • holderId : StringSearchCriteria : optional

    • stringSearchTypeEnum : StringSearchTypeEnum

      • EXACT
      • PARTIAL
    • searchString : String

    • isCaseSensitive : Boolean

  • description : StringSearchCriteria : optional

  • deviceAssignment : List<String> : optional

  • vehicleId : Long : optional

  • plateNumber : StringSearchCriteria : optional

  • serialNumber : StringSearchCriteria : optional

  • color : ColorEnum : optional

    • YELLOW

    • GREEN

    • BLUE

    • INDIGO

    • VIOLET

    • PURPLE

    • BLACK

    • WHITE

    • SILVER

    • RED

    • ORANGE

Sample Request


Code Block
themeConfluence
titlejson
{
   "deviceAssignment":[
      "device1"
   ],
   "plateNumber":{
      "isCaseSensitive":false,
      "searchString":"plate",
      "stringSearchTypeEnum":"PARTIAL"
   }
}


Accept
  • application/json
Success Response
  • Code: 200 
  • Content:
     
Code Block
themeConfluence
titlejson
{
"color": "BLUE",
"plateNumber": "plate-0202",
"serialNumber": "serial-0202",
"services": null,
"type": "SEDAN",
"vehicleId": 5,
"contactOwner": null,
"description": "vehicle description",
"deviceAssignment": null,
"holderAssignment": null,
"holderId": "vehicle-holder-0101",
"holderType": null,
"location": null
}



Error Response

Error code : 500

 

2.4.7 Get Building

 

TitlegetBuilding
URL/getBuilding
MethodPOST
URL Params-
Content-Type
  • application/json
Data Params
  • holderId : StringSearchCriteria : optional

    • stringSearchTypeEnum : StringSearchTypeEnum

      • EXACT
      • PARTIAL
    • searchString : String

    • isCaseSensitive : Boolean

  • description : StringSearchCriteria : optional

  • deviceAssignment : List<String> : optional

  • adress : StringSearchCriteria: optional

  • floorNumber : Integer : optional
  • officeNumber : Integer : optional
Sample Request


Code Block
themeConfluence
titlejson
{
   "deviceAssignment":[
      "device1"
   ],
   "adress":{
      "isCaseSensitive":false,
      "searchString":"doha",
      "stringSearchTypeEnum":"PARTIAL"
   }
}


Accept
  • application/json
Success Response
  • Code: 200 
  • Content:
     
Code Block
themeConfluence
titlejson
{
   "adress":"doha Qatar",
   "buildingId":1,
   "floorNumber":3,
   "officeNumber":3,
   "planPhotography":"",
   "contactOwner":null,
   "description":"building description",
   "deviceAssignment":null,
   "holderAssignment":null,
   "holderId":"building-holder-0266662",
   "holderType":null,
   "location":{
      "altitudeInMeters":366,
      "description":null,
      "latitude":55.555,
      "locationName":"holder_building-holder-0266662_loc",
      "longitude":47.6656
   }
}



Error Response

Error code : 500

 

2.4.8 Get Area

 

TitlegetArea
URL/getArea
MethodPOST
URL Params-
Content-Type
  • application/json
Data Params
  • holderId : StringSearchCriteria : optional

    • stringSearchTypeEnum : StringSearchTypeEnum

      • EXACT
      • PARTIAL
    • searchString : String

    • isCaseSensitive : Boolean

  • description : StringSearchCriteria : optional

  • areaId: Long : optional

  • areaSize : Integer: optional

  • adress: StringSearchCriteria : optional
Sample Request


Code Block
themeConfluence
titlejson
{
   "adress":{
      "isCaseSensitive":false,
      "searchString":"Tunis",
      "stringSearchTypeEnum":"PARTIAL"
   }
}


Accept
  • application/json
Success Response
  • Code: 200 
  • Content:
     
Code Block
themeConfluence
titlejson
{
   "adress":"Tunis Tunisia",
   "areaId":1,
   "areaSize":3000,
   "contactOwner":null,
   "description":"area description",
   "deviceAssignment":null,
   "holderAssignment":null,
   "holderId":"area-holder-010656561",
   "holderType":null,
   "location":null
}


Error Response

Error code : 500

 

2.4.9 Delete Holder

 

TitledeleteHolder
URL/deleteHolder
MethodPOST
URL Params-
Content-Type
  • application/json
Data Params
  • holderId : String : required

Sample Request


Code Block
themeConfluence
titlejson
holder-0101


Accept
  • application/json
Success Response
  • Code: 200 
  • Content:
     
Code Block
themeConfluence
titlejson
{
"status": 200,
"message": "Success"
}


Error Response

Error code : 500

 

2.4.10 Delete Vehicle

 

TitledeleteVehicle
URL/deleteVehicle
MethodPOST
URL Params-
Content-Type
  • application/json
Data Params
  • holderId : String : required

Sample Request


Code Block
themeConfluence
titlejson
holder-vehicle-0101


Accept
  • application/json
Success Response
  • Code: 200 
  • Content:
     
Code Block
themeConfluence
titlejson
{
"status": 200,
"message": "Success"
}


Error Response

Error code : 500

 

2.4.11 Delete Building

 

TitledeleteBuilding
URL/deleteBuilding
MethodPOST
URL Params-
Content-Type
  • application/json
Data Params
  • holderId : String : required

Sample Request


Code Block
themeConfluence
titlejson
holder-building-0101


Accept
  • application/json
Success Response
  • Code: 200 
  • Content:
     
Code Block
themeConfluence
titlejson
{
"status": 200,
"message": "Success"
}


Error Response

Error code : 500

 

2.4.12 Delete Area

 

TitledeleteArea
URL/deleteArea
MethodPOST
URL Params-
Content-Type
  • application/json
Data Params
  • holderId : String : required

Sample Request


Code Block
themeConfluence
titlejson
holder-area-0101


Accept
  • application/json
Success Response
  • Code: 200 
  • Content:
     
Code Block
themeConfluence
titlejson
{
"status": 200,
"message": "Success"
}


Error Response

Error code : 500

 

2.4.13 Delete Person

 

TitledeletePerson
URL/deletePerson
MethodPOST
URL Params-
Content-Type
  • application/json
Data Params
  • holderId : String : required

Sample Request


Code Block
themeConfluence
titlejson
holder-person-0101


Accept
  • application/json
Success Response
  • Code: 200 
  • Content:
     
Code Block
themeConfluence
titlejson
{
"status": 200,
"message": "Success"
}


Error Response

Error code : 500

 

2.4.14 Update Holder

 

TitleupdateHolder
URL/updateHolder
MethodPOST
URL Params-
Content-Type
  • application/json
Data Params
  • holderId : String : required

  • deviceToAdd : List<String> : optional

  • holderToAdd : List<HoldersAssignment> : optional
  • deviceToRemove: List<String> : optional
  • holderToRemove : List<String> : optional
Sample Request


Code Block
themeConfluence
titlejson
{
  "holder": {
    "contactOwner": null,
    "description": "new holder",
    "holderId": "holder2",
    "holderSurId": null,
    "holderType": null,
    "location": null,
    "locationSurId": null,
    "personSurId": null
  },
  "deviceToAdd": [
    "device1",
    "device2"
  ],
  "deviceToRemove": [
    "device3"
  ],
  "holderToAdd": [
    {
      "holderName": "holder1",
      "holderType": "AREA",
      "relationName": "relation1"
    }
  ],
  "holderToRemove": [
    "holder1"
  ]
}


Accept
  • application/json
Success Response
  • Code: 200 
  • Content:
     
Code Block
themeConfluence
titlejson
{
"status": 200,
"message": "Success"
}


Error Response

Error code : 500


 

2.4.15 Update Vehicle

 

TitleupdateVehicle
URL/updateVehicle
MethodPOST
URL Params-
Content-Type
  • application/json
Data Params
  • holderId : String : required

  • plateNumber : String : required
  • type : String : required
  • deviceToAdd : List<String> : optional

  • holderToAdd : List<HoldersAssignment> : optional
  • deviceToRemove: List<String> : optional
  • holderToRemove : List<String> : optional
Sample Request


Code Block
themeConfluence
titlejson
{
  "holder": {
    "description": "new holder",
    "deviceAssignment": [
      
    ],
    "holderAssignment": [
      
    ],
    "holderId": "holder2",
    "plateNumber": "20215",
    "serialNumber": null,
    "type": "SEDAN"
  },
  "deviceToAdd": [
    "device1",
    "device2"
  ],
  "deviceToRemove": [
    "device3"
  ],
  "holderToAdd": [
    {
      "holderName": "holder1",
      "holderType": "AREA",
      "relationName": "relation1"
    }
  ],
  "holderToRemove": [
    "holder1"
  ]
}


Accept
  • application/json
Success Response
  • Code: 200 
  • Content:
     
Code Block
themeConfluence
titlejson
{
"status": 200,
"message": "Success"
}


Error Response

Error code : 500


 

2.4.16 Update Building

 

TitleupdateBuilding
URL/updateBuilding
MethodPOST
URL Params-
Content-Type
  • application/json
Data Params
  • holderId : String : required

  • adress: String : required
  • deviceToAdd : List<String> : optional
  • holderToAdd : List<HoldersAssignment> : optional
  • deviceToRemove: List<String> : optional
  • holderToRemove : List<String> : optional
Sample Request


Code Block
themeConfluence
titlejson
{
  "holder": {
    "description": "new holder",
    "deviceAssignment": [
      
    ],
    "holderAssignment": [
      
    ],
    "holderId": "holder2",
    "adress": "new adress"
  },
  "deviceToAdd": [
    "device1",
    "device2"
  ],
  "deviceToRemove": [
    "device3"
  ],
  "holderToAdd": [
    {
      "holderName": "holder1",
      "holderType": "AREA",
      "relationName": "relation1"
    }
  ],
  "holderToRemove": [
    "holder1"
  ]
}


Accept
  • application/json
Success Response
  • Code: 200 
  • Content:
     
Code Block
themeConfluence
titlejson
{
"status": 200,
"message": "Success"
}


Error Response

Error code : 500

 

2.4.17 Update Area

 

TitleupdateArea
URL/updateArea
MethodPOST
URL Params-
Content-Type
  • application/json
Data Params
  • holderId : String : required

  • adress: String : required
  • deviceToAdd : List<String> : optional
  • holderToAdd : List<HoldersAssignment> : optional
  • deviceToRemove: List<String> : optional
  • holderToRemove : List<String> : optional
Sample Request


Code Block
themeConfluence
titlejson
{
  "holder": {
    "description": "new holder",
    "deviceAssignment": [
      
    ],
    "holderAssignment": [
      
    ],
    "holderId": "holder2",
    "adress": "new adress"
  },
  "deviceToAdd": [
    "device1",
    "device2"
  ],
  "deviceToRemove": [
    "device3"
  ],
  "holderToAdd": [
    {
      "holderName": "holder1",
      "holderType": "AREA",
      "relationName": "relation1"
    }
  ],
  "holderToRemove": [
    "holder1"
  ]
}


Accept
  • application/json
Success Response
  • Code: 200 
  • Content:
     
Code Block
themeConfluence
titlejson
{
"status": 200,
"message": "Success"
}


Error Response

Error code : 500

 

2.4.18 Update Person

 

TitleupdatePerson
URL/updatePerson
MethodPOST
URL Params-
Content-Type
  • application/json
Data Params
  • holderId : String : required

  • firstName: String : required
  • lastName: String : required
  • deviceToAdd : List<String> : optional
  • holderToAdd : List<HoldersAssignment> : optional
  • deviceToRemove: List<String> : optional
  • holderToRemove : List<String> : optional
Sample Request


Code Block
themeConfluence
titlejson
{
  "holder": {
    "description": "new holder",
    "deviceAssignment": [
      
    ],
    "holderAssignment": [
      
    ],
    "holderId": "holder2",
    "firstName": "new name",
    "lastName": "last name"
  },
  "deviceToAdd": [
    "device1",
    "device2"
  ],
  "deviceToRemove": [
    "device3"
  ],
  "holderToAdd": [
    {
      "holderName": "holder1",
      "holderType": "AREA",
      "relationName": "relation1"
    }
  ],
  "holderToRemove": [
    "holder1"
  ]
}


Accept
  • application/json
Success Response

 

  • Code: 200 
  • Content:

    Code Block
    themeConfluence
    titlejson
    {
    "status": 200,
    "message": "Success"
    }


 

Error Response

Error code : 500

 

2.4.19 Create Holders Relation

 

TitlecreateHoldersRelation
URL/createHoldersRelation
MethodPOST
URL Params-
Content-Type
  • application/json
Data Params
  • name: String : required
  • holderType: String : required
  • holdedType: String : required
  • holdedRoleName: String : optional
  • holderRoleName: String : optional
  • description: String : optional
Sample Request


Code Block
themeConfluence
titlejson
{
  "description": "relation description",
  "holdedRoleName": "holded Role Name",
  "holdedType": "BUILDING",
  "holderRoleName": "holder Role Name",
  "holderType": "AREA",
  "name": "depends on relation"
}


Accept
  • application/json
Success Response
  • Code: 200 
  • Content:

     

    Code Block
    themeConfluence
    titlejson
    {
    "description": "relation description",
    "holdedRoleName": "holded Role Name",
    "holdedType": "BUILDING",
    "holderRoleName": "holder Role Name",
    "holderType": "AREA",
    "name": "depends on relation"
    }


Error Response

Error code : 500

 

2.4.20 Update Holders Relation

 

TitleupdateHoldersRelation
URL/updateHoldersRelation
MethodPOST
URL Params-
Content-Type
  • application/json
Data Params
  • name: String : required
  • holderType: String : required
  • holdedType: String : required
  • holdedRoleName: String : optional
  • holderRoleName: String : optional
  • description: String : optional
Sample Request


Code Block
themeConfluence
titlejson
{
  "description": "relation description",
  "holdedRoleName": "holded Role Name",
  "holdedType": "AREA",
  "holderRoleName": "holder Role Name",
  "holderType": "AREA",
  "name": "depends on relation"
}


Accept
  • application/json
Success Response
  • Code: 200 
  • Content:

     

    Code Block
    themeConfluence
    titlejson
    {
    "status": 200,
    "message": "Success"
    }


Error Response

Error code : 500

 

2.4.21 Get Holders Relation By Name

 

TitlegetHoldersRelationByName
URL/getHoldersRelationByName
MethodGET
URL Params
  • relationName: required
Content-Type
  • application/json
Data Params
-
Sample Request

/getHoldersRelationByName/depends%20on%20relation

Accept
  • application/json
Success Response
  • Code: 200 
  • Content:

     

    Code Block
    themeConfluence
    titlejson
    [
      {
        "description": "relation description",
        "holdedRoleName": "holded Role Name",
        "holdedType": "AREA",
        "holderRoleName": "holder Role Name",
        "holderType": "AREA",
        "name": "depends on relation"
      }
    ]


Error Response

Error code : 500

 

2.4.22 Delete Holders Relation

 

TitledeleteHoldersRelation
URL/deleteHoldersRelation
MethodPOST
URL Params-
Content-Type
  • application/json
Data Params
  • name: String : required
Sample Request


Code Block
themeConfluence
titlejson
depends on relation


Accept
  • application/json
Success Response
  • Code: 200 
  • Content:

     

    Code Block
    themeConfluence
    titlejson
    true


Error Response

Error code : 500


{

  "deviceStatusEnum" : "MALFUNCTIONING",

  "deviceAvailibiltyEnum" : "ONLINE",

  "deviceHeartbeatProfile" : {

    "intelligenceAlgo" : "PERIODIC",

    "numberPackets" : 0,

    "timeMeasure" : "SECOND",

    "timePeriod" : 0

  },

  "deviceName" : "testDevice",

  "deviceTemplateId" : "temp",

  "deviceTypeEnum" : "PHONE",

  "latestLocation" : {

    "altitudeInMeters" : null,

    "description" : null,

    "latitude" : null,

    "locationName" : null,

    "longitude" : null

  },

  "latestIp" : "latestIp",

  "latestConnectionTime" : 1433060399913,

  "alertsCount" : 1,

  "description" : "device desc",

  "serialNumber" : "32151212321",

  "firmwareVersion" : "321354444",

  "deviceManufacture" : "deviceManufacture",

  "deviceModel" : "deviceModel",

  "simCard" : [ ],

  "ipAddresses" : null,

  "timeZone" : "GMT",

  "locationTimeStamp" : 1433060399913,

  "mqttLogin" : "111",

  "mqttPassword" : "9999"

}