Property API

A Property is a set of between 1 and 4 double values, which may or not be associated to objects. Properties can also support frames, just like objects, but cannot be locked and have no transformations.

Properties are meant to be interacted with by individual devices, and these changes will be streamed to other devices via the Events API. In addition, Create and Update messages sent to the HTTP API are converted to events and streamed out to registered devices.

Property Creation

POST /v1/property/

Create a new property.

Request Headers:
 
Status Codes:

http

POST /v1/property HTTP/1.1
Host: localhost:8768
Content-Type: application/json

{
  "properties":[
    {
            "key":"12345",
            "name":"testName",
            "parent":"testParent",
            "asset_sub_id":"testAssetSubId",
            "scene":"testScene",
            "actions": [
                    {
                            "name": "testAction",
                            "description": "this is a description",
                            "keyframes": [
                                    {
                                            "frame":1,
                                            "values":[
                                            {
                                                    "value":100.0,
                                                    "left_type":"vector",
                                                    "left_x":10.0,
                                                    "left_y":5.0,
                                                    "right_type":"free",
                                                    "right_x":4.0,
                                                    "right_y":3.0

                                            }
                                    ]
                                    }
                            ]
                    }
            ],
            "values":[
                    {
                            "value":100.0,
                            "left_type":"vector",
                            "left_x":10.0,
                            "left_y":5.0,
                            "right_type":"free",
                            "right_x":4.0,
                            "right_y":3.0

                    }
            ]
    }
  ]
}

curl

curl -i -X POST http://localhost:8768/v1/property -H 'Content-Type: application/json' --data-raw '{"properties": [{"name": "testName", "parent": "testParent", "scene": "testScene", "actions": [{"name": "testAction", "keyframes": [{"frame": 1, "values": [{"left_type": "vector", "value": 100.0, "left_x": 10.0, "left_y": 5.0, "right_x": 4.0, "right_y": 3.0, "right_type": "free"}]}], "description": "this is a description"}], "values": [{"left_type": "vector", "value": 100.0, "left_x": 10.0, "left_y": 5.0, "right_x": 4.0, "right_y": 3.0, "right_type": "free"}], "asset_sub_id": "testAssetSubId", "key": "12345"}]}'

response

HTTP/1.1 200 OK
Location: http://localhost:8768/v1/property
Content-Type: application/json

{
  "num_records": 1,
  "objects": [
    {
      "key": "jklmnop"
    }
  ]
}

Property Update

POST /v1/property/{property_key}

Update an existing property.

Request Headers:
 
Status Codes:

http

POST /v1/property/{key} HTTP/1.1
Host: localhost:8768
Content-Type: application/json

{
  "properties":[
    {
              "name":"anotherName",
            "parent":"anotherParent"
      }
  ]
}

curl

curl -i -X POST 'http://localhost:8768/v1/property/{key}' -H 'Content-Type: application/json' --data-raw '{"properties": [{"name": "anotherName", "parent": "anotherParent"}]}'

wget

wget -S -O- 'http://localhost:8768/v1/property/{key}' --header='Content-Type: application/json' --post-data='{"properties": [{"name": "anotherName", "parent": "anotherParent"}]}'

httpie

echo '{
  "properties": [
    {
      "name": "anotherName",
      "parent": "anotherParent"
    }
  ]
}' | http POST 'http://localhost:8768/v1/property/{key}' Content-Type:application/json

python-requests

requests.post('http://localhost:8768/v1/property/{key}', headers={'Content-Type': 'application/json'}, json={'properties': [{'name': 'anotherName', 'parent': 'anotherParent'}]})

response

HTTP/1.1 200 OK
Location: http://localhost:8768/v1/property/{key}
Content-Type: application/json

{
  "num_records":1,
  "properties":[{"key":"jklmnop"}]
}

Property Retrieval

GET /v1/property/(property_key)

Get property details in JSON Format.

Status Codes:

http

GET /v1/property/{key} HTTP/1.1
Host: localhost:8768

curl

curl -i 'http://localhost:8768/v1/property/{key}'

Property Deletion

DELETE /v1/property/(property_key)

Delete an property.

Status Codes:

http

DELETE /v1/property/{key} HTTP/1.1
Host: localhost:8768

curl

curl -i -X DELETE 'http://localhost:8768/v1/property/{key}'

wget

wget -S -O- --method=DELETE 'http://localhost:8768/v1/property/{key}'

httpie

http DELETE 'http://localhost:8768/v1/property/{key}'

python-requests

requests.delete('http://localhost:8768/v1/property/{key}')

Property Query

GET /v1/property/query

Query for properties which match the input JSON. This will only return as many records as specified in the field ‘num_records’.

Status Codes:

http

POST /v1/property/query HTTP/1.1
Host: localhost:8768
Content-Type: application/json

{
  "properties":[
    {
      "name":"test"
    }
  ]
}

curl

curl -i -X POST http://localhost:8768/v1/property/query -H 'Content-Type: application/json' --data-raw '{"properties": [{"name": "test"}]}'

Property Action Create

POST /v1/property/{key}/action

An action is a named set of keyframes, each holding the value of the property at that frame. This endpoint allows creation of a new action against an existing property.

Status Codes:

http

POST /v1/property/{key}/action HTTP/1.1
Host: localhost:8768
Content-Type: application/json

{
  "name": "testAction",
  "description": "this is a description",
  "keyframes": [
    {
      "frame": 1,
      "values": [
        {
          "value": 100,
          "left_type": "vector",
          "left_x": 10,
          "left_y": 5,
          "right_type": "free",
          "right_x": 4,
          "right_y": 3
        }
      ]
    }
  ]
}

curl

curl -i -X POST 'http://localhost:8768/v1/property/{key}/action' -H 'Content-Type: application/json' --data-raw '{"description": "this is a description", "keyframes": [{"frame": 1, "values": [{"left_type": "vector", "value": 100, "left_x": 10, "left_y": 5, "right_x": 4, "right_y": 3, "right_type": "free"}]}], "name": "testAction"}'

response

HTTP/1.1 200 OK
Location: http://localhost:8768/v1/property
Content-Type: application/json

{
  "num_records": 1,
  "objects": [
    {
      "key": "jklmnop"
    }
  ]
}

Property Action Update

POST /v1/property/{key}/action/{name}

This endpoint allows for updating fields within an action.

Status Codes:

http

POST /v1/property/{key}/action/{name} HTTP/1.1
Host: localhost:8768
Content-Type: application/json

{
  "name": "testAction",
  "description": "this is another description"
}

curl

curl -i -X POST 'http://localhost:8768/v1/property/{key}/action/{name}' -H 'Content-Type: application/json' --data-raw '{"description": "this is another description", "name": "testAction"}'

response

HTTP/1.1 200 OK
Location: http://localhost:8768/v1/property
Content-Type: application/json

{
  "num_records": 1,
  "objects": [
    {
      "key": "jklmnop"
    }
  ]
}

Property Action Delete

DELETE /v1/property/{key}/action/{name}

This endpoint allows for removing actions from an property.

Status Codes:

http

DELETE /v1/property/{key}/action/{name} HTTP/1.1
Host: localhost:8768

curl

curl -i -X DELETE 'http://localhost:8768/v1/property/{key}/action/{name}'

response

HTTP/1.1 200 OK
Location: http://localhost:8768/v1/property
Content-Type: application/json

{
  "num_records": 1,
  "objects": [
    {
      "key": "jklmnop"
    }
  ]
}

Property Frame Creation

POST /v1/property/{key}/action/{name}/keyframe

This endpoint allows for adding keyframes to existing actions.

Status Codes:

http

POST /v1/property/{key}/action/{name}/keyframe HTTP/1.1
Host: localhost:8768
Content-Type: application/json

{
  "frame": 1,
  "values": [
    {
      "value": 100,
      "left_type": "vector",
      "left_x": 10,
      "left_y": 5,
      "right_type": "free",
      "right_x": 4,
      "right_y": 3
    }
  ]
}

curl

curl -i -X POST 'http://localhost:8768/v1/property/{key}/action/{name}/keyframe' -H 'Content-Type: application/json' --data-raw '{"frame": 1, "values": [{"left_type": "vector", "value": 100, "left_x": 10, "left_y": 5, "right_x": 4, "right_y": 3, "right_type": "free"}]}'

response

HTTP/1.1 200 OK
Location: http://localhost:8768/v1/property
Content-Type: application/json

{
  "num_records": 1,
  "objects": [
    {
      "key": "jklmnop"
    }
  ]
}

Property Frame Update

POST /v1/property/{key}/action/{name}/keyframe/{frame}

This endpoint allows for updating elements within a keyframe.

Status Codes:

http

POST /v1/property/{key}/action/{name}/keyframe/{frame} HTTP/1.1
Host: localhost:8768
Content-Type: application/json

{
  "frame": 1,
  "values": [
    {
      "value": 100,
      "left_type": "vector",
      "left_x": 10,
      "left_y": 5,
      "right_type": "free",
      "right_x": 4,
      "right_y": 3
    }
  ]
}

curl

curl -i -X POST 'http://localhost:8768/v1/property/{key}/action/{name}/keyframe/{frame}' -H 'Content-Type: application/json' --data-raw '{"frame": 1, "values": [{"left_type": "vector", "value": 100, "left_x": 10, "left_y": 5, "right_x": 4, "right_y": 3, "right_type": "free"}]}'

response

HTTP/1.1 200 OK
Location: http://localhost:8768/v1/property
Content-Type: application/json

{
  "num_records": 1,
  "objects": [
    {
      "key": "jklmnop"
    }
  ]
}

Property Frame Delete

DELETE /v1/property/{key}/action/{name}/keyframe/{frame}

This endpoint removes a keyframe from an existing action.

Status Codes:

http

DELETE /v1/property/{key}/action/{name}/keyframe/{frame} HTTP/1.1
Host: localhost:8768

curl

curl -i -X DELETE 'http://localhost:8768/v1/property/{key}/action/{name}/keyframe/{frame}'

response

HTTP/1.1 200 OK
Location: http://localhost:8768/v1/property
Content-Type: application/json

{
  "num_records": 1,
  "objects": [
    {
      "key": "jklmnop"
    }
  ]
}