7 Scenes And Operations

Add scene to the Device

Method

POST

API

https://iotdev.dialog.lk/axt-iot-mbil-instance0001001/apkios/axtitomblebckenddev/scenedev/

Headers

IotMife-AccessToken : Generated At the step 4.2/4.3
X-Key **:** Generated At the step 4.4
Accept : application/json
Content-Type : application/json

Body

Note : change highlighted accordingly

{
    "name": "<Name of the SCENE>",
    "userId": 345,
    "featured": true,
    "icon": "home",
    "type": "device",
    "device": {
        "inDeviceId": "1274",
        "eventName": "eventOne",
        "stateName": "none",
        "alwaysOn": true,
        "effectiveDate": "",
        "expireDate": "",
        "evaluationCriteria": "greater_than",
        "evaluationValues": {
            "ev1Value1": 80
        }
    },
    "actions": [{
        "sequence": 1,
        "action": "callURL",
        "externalServiceData": {
            "callback": "<call back url>",
            "isInternal": "true"
        }
    }]
}

Response

{
    "id": 744,
    "name": "< Name of the SCENE >",
    "userId": 345,
    "featured": true,
    "icon": "home",
    "type": "device",
    "device": {
        "inDeviceId": 1274,
        "eventName": "eventOne",
        "stateName": "none",
        "alwaysOn": true,
        "effectiveDate": null,
        "expireDate": null,
        "evaluationCriteria": "greater_than",
        "evaluationValues": {
            "ev1Value1": "80"
        }
    },
    "actions": [{
        "sequence": 1,
        "action": "callURL",
        "externalServiceData": {
            "isInternal": "true",
            "callback": "<call back url>"
        }
    }]
}

Update a Scene

Method

PUT

API

https://iotdev.dialog.lk/axt-iot-mbil-instance0001001/apkios/axtitomblebckenddev/scenedev/123>

note : highlighted is the scene id

Headers

IotMife-AccessToken : Generated At the step 4.2/4.3
X-Key : Generated At the step 4.4
Accept : application/json
Content-Type : application/json

Body

Note : change highlighted accordingly

{
    "name": "<Name of the SCENE>",
    "userId": 345,
    "featured": true,
    "icon": "home",
    "type": "device",
    "device": {
        "inDeviceId": "1274",
        "eventName": "eventOne",
        "stateName": "none",
        "alwaysOn": true,
        "effectiveDate": "",
        "expireDate": "",
        "evaluationCriteria": "greater_than",
        "evaluationValues": {
            "ev1Value1": 80
        }
    },
    "actions": [{
        "sequence": 1,
        "action": "callURL",
        "externalServiceData": {
            "callback": "<call back url>",
            "isInternal": "true"
        }
    }]
}

Response

{

    "desc":"scene updated succefully"

}

Delete a scene

Method

DELETE

API

https://iotdev.dialog.lk/axt-iot-mbil-instance0001001/apkios/axtitomblebckenddev/scenedev/123>

note : highlighted is the scene id

Headers

IotMife-AccessToken : Generated At the step 4.2/4.3
X-Key               : Generated At the step 4.4
Accept              : application/json
Content-Type        : application/json

Response

{
    "desc":"successfully deleted the scene"
}

Get scenes by user id

Method

https://iotdev.dialog.lk/axt-iot-mbil-instance0001001/apkios/axtitomblebckenddev/scenedev/users/1234

Note: highlighted is the user id

Headers

IotMife-AccessToken : Generated At the step 4.2/4.3
X-Key               : Generated At the step 4.4
Accept              : application/json
Content-Type        : application/json

Response

[{
    "id": 744,
    "name": " < Name of the SCENE > ",
    "userId": 345,
    "featured": true,
    "icon": "home",
    "type": "device",
    "device": {
        "inDeviceId": 1274,
        "eventName": "eventOne",
        "stateName": "none",
        "alwaysOn": true,
        "effectiveDate": null,
        "expireDate": null,
        "evaluationCriteria": "greater_than",
        "evaluationValues": {
            "ev1Value1": "80"
        }
    },
    "actions": [{
        "sequence": 1,
        "action": "callURL",
        "externalServiceData": {
            "isInternal": "true",
            "callback": "<call back url>"
        }
    }]
}]
Last updated on 9th Mar 2018