Link Search Menu Expand Document

2. Create Zone Asset

Op name:

scgrids.createZoneUnit

This creates a Zone Unit/Asset like door or window

Endpoint:

Method: POST
Type: application/json
URL: /v1/actions

Headers:

Key Value Description
Authorization   (Required) The Acccess Token or HMAC Signature
x-sc-identity external (Required)

Query params:

Key Value Description
op scgrids.createZoneAsset (Required) Operation Name
org   (Required) Organisation ID
pid   (Required) Project ID

Body:

{
    "Name": "Door/Opening",
    "UnitID": "DOOR/CLOSING",
    "ImageURL": "https://dummyimage.com/5:5x250",
    "ZoneCategoryID": "CONFERENCE_ROOMS"
}

More example Requests/Responses:

I. Example Request: Create Zone Asset

Body:

{
    "Name": "Door/Opening",
    "UnitID": "DOOR/OPENING",
    "ImageURL": "https://dummyimage.com/5:5x250",
    "ZoneCategoryID": "CONFERENCE_ROOMS"
}
I. Example Response: Create Zone Asset
{
    "status": 201,
    "message": "Success",
    "data": {
        "Name": "Door/Opening",
        "ImageURL": "https://dummyimage.com/5:5x250",
        "ZoneCategoryID": "CONFERENCE_ROOMS",
        "UnitID": "DOOR/OPENING"
    }
}

Status Code: 201

Error codes:

400
Possible reasons:
1. Missing op/org/pid
2. Invalid characters/improper input body
3. Missing access_token in the header
4. Missing Name/ImageURL/UnitID/ZoneCategoryID
5. If the UnitID already exists



Table of contents