API examples
parent
5d96d0810e
commit
d6ce043a56
568
api_docs.md
568
api_docs.md
|
@ -4,7 +4,11 @@
|
||||||
### Request
|
### Request
|
||||||
|
|
||||||
```
|
```
|
||||||
{"format"=>"json", "controller"=>"api/devices", "action"=>"index"}
|
{
|
||||||
|
"format": "json",
|
||||||
|
"controller": "api/devices",
|
||||||
|
"action": "index"
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Response
|
### Response
|
||||||
|
@ -12,10 +16,10 @@
|
||||||
```
|
```
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"_id": "557828fa766f6c33e41e0000",
|
"_id": "557829b2766f6c350d200000",
|
||||||
"name": "orval.schumm",
|
"name": "makayla_yost",
|
||||||
"uuid": "24f8a32f-975a-47b4-be52-c4e4be9d5596",
|
"uuid": "7b1ebadd-aa1f-4e07-9829-f81f7ebc5108",
|
||||||
"token": "iZD3dj_kl7YG5OQt7Qeg3w"
|
"token": "qj5UVWLDFa4m_WbNi6f61g"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
```
|
```
|
||||||
|
@ -27,14 +31,21 @@
|
||||||
### Request
|
### Request
|
||||||
|
|
||||||
```
|
```
|
||||||
{"user_id"=>"557828ff766f6c33e49e0000", "name"=>"Frank", "uuid"=>"123", "token"=>"321", "controller"=>"api/devices", "action"=>"create"}
|
{
|
||||||
|
"user_id": "557829b5766f6c350d7b0000",
|
||||||
|
"name": "Frank",
|
||||||
|
"uuid": "123",
|
||||||
|
"token": "321",
|
||||||
|
"controller": "api/devices",
|
||||||
|
"action": "create"
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Response
|
### Response
|
||||||
|
|
||||||
```
|
```
|
||||||
{
|
{
|
||||||
"_id": "557828ff766f6c33e4a00000",
|
"_id": "557829b5766f6c350d7d0000",
|
||||||
"name": "Frank",
|
"name": "Frank",
|
||||||
"uuid": "123",
|
"uuid": "123",
|
||||||
"token": "321"
|
"token": "321"
|
||||||
|
@ -42,34 +53,19 @@
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
# PUT /api/devices/557828fc766f6c33e4810000
|
# DELETE /api/devices/557829b2766f6c350d220000
|
||||||
|
|
||||||
### Request
|
### Request
|
||||||
|
|
||||||
```
|
|
||||||
{"name"=>"Dimitri Altenwerth", "id"=>"557828fc766f6c33e4810000", "controller"=>"api/devices", "action"=>"update"}
|
|
||||||
```
|
|
||||||
|
|
||||||
### Response
|
|
||||||
|
|
||||||
```
|
```
|
||||||
{
|
{
|
||||||
"_id": "557828fc766f6c33e4810000",
|
"fromat": "json",
|
||||||
"name": "Dimitri Altenwerth",
|
"id": "557829b2766f6c350d220000",
|
||||||
"uuid": "24f8a32f-975a-47b4-be52-c4e4be9d5596",
|
"controller": "api/devices",
|
||||||
"token": "iZD3dj_kl7YG5OQt7Qeg3w"
|
"action": "destroy"
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
# DELETE /api/devices/557828ff766f6c33e49d0000
|
|
||||||
|
|
||||||
### Request
|
|
||||||
|
|
||||||
```
|
|
||||||
{"fromat"=>"json", "id"=>"557828ff766f6c33e49d0000", "controller"=>"api/devices", "action"=>"destroy"}
|
|
||||||
```
|
|
||||||
|
|
||||||
### Response
|
### Response
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -77,12 +73,40 @@
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
# POST /api/schedules
|
# PUT /api/devices/557829b5766f6c350d800000
|
||||||
|
|
||||||
### Request
|
### Request
|
||||||
|
|
||||||
```
|
```
|
||||||
{"sequence_id"=>"557828fa766f6c33e40a0000", "start_time"=>"2015-02-17T15:16:17.000Z", "end_time"=>"2099-02-17T18:19:20.000Z", "repeat"=>"4", "time_unit"=>"minutely", "controller"=>"api/schedules", "action"=>"create"}
|
{
|
||||||
|
"name": "Dr. Amina Rau",
|
||||||
|
"id": "557829b5766f6c350d800000",
|
||||||
|
"controller": "api/devices",
|
||||||
|
"action": "update"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Response
|
||||||
|
|
||||||
|
```
|
||||||
|
{
|
||||||
|
"_id": "557829b5766f6c350d800000",
|
||||||
|
"name": "Dr. Amina Rau",
|
||||||
|
"uuid": "7b1ebadd-aa1f-4e07-9829-f81f7ebc5108",
|
||||||
|
"token": "qj5UVWLDFa4m_WbNi6f61g"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
# GET /api/schedules
|
||||||
|
|
||||||
|
### Request
|
||||||
|
|
||||||
|
```
|
||||||
|
{
|
||||||
|
"controller": "api/schedules",
|
||||||
|
"action": "index"
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Response
|
### Response
|
||||||
|
@ -98,7 +122,10 @@ Too big to display.
|
||||||
### Request
|
### Request
|
||||||
|
|
||||||
```
|
```
|
||||||
{"controller"=>"api/schedules", "action"=>"index"}
|
{
|
||||||
|
"controller": "api/schedules",
|
||||||
|
"action": "index"
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Response
|
### Response
|
||||||
|
@ -111,13 +138,20 @@ Too big to display.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# POST /api/schedules
|
||||||
# GET /api/schedules
|
|
||||||
|
|
||||||
### Request
|
### Request
|
||||||
|
|
||||||
```
|
```
|
||||||
{"controller"=>"api/schedules", "action"=>"index"}
|
{
|
||||||
|
"sequence_id": "557829b5766f6c350d980000",
|
||||||
|
"start_time": "2015-02-17T15:16:17.000Z",
|
||||||
|
"end_time": "2099-02-17T18:19:20.000Z",
|
||||||
|
"repeat": "4",
|
||||||
|
"time_unit": "minutely",
|
||||||
|
"controller": "api/schedules",
|
||||||
|
"action": "create"
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Response
|
### Response
|
||||||
|
@ -127,12 +161,52 @@ Too big to display.
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
# DELETE /api/schedules/557828fb766f6c33e4210000
|
|
||||||
|
# PATCH /api/schedules/557829b5766f6c350d6f0000
|
||||||
|
|
||||||
### Request
|
### Request
|
||||||
|
|
||||||
```
|
```
|
||||||
{"id"=>"557828fb766f6c33e4210000", "controller"=>"api/schedules", "action"=>"destroy"}
|
{
|
||||||
|
"schedule": {
|
||||||
|
"repeat": "66"
|
||||||
|
},
|
||||||
|
"id": "557829b5766f6c350d6f0000",
|
||||||
|
"controller": "api/schedules",
|
||||||
|
"action": "update"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Response
|
||||||
|
|
||||||
|
```
|
||||||
|
{
|
||||||
|
"_id": "557829b5766f6c350d6f0000",
|
||||||
|
"start_time": "2015-06-09T05:01:00.000Z",
|
||||||
|
"end_time": "2015-06-12T00:01:00.000Z",
|
||||||
|
"next_time": "2015-06-11T05:01:00.000Z",
|
||||||
|
"repeat": 66,
|
||||||
|
"time_unit": "daily",
|
||||||
|
"sequence_id": "557829b5766f6c350d720000",
|
||||||
|
"sequence_name": "Reactive systemic project",
|
||||||
|
"calendar": [
|
||||||
|
"2015-06-09T05:01:00.000Z"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# DELETE /api/schedules/557829b6766f6c350dad0000
|
||||||
|
|
||||||
|
### Request
|
||||||
|
|
||||||
|
```
|
||||||
|
{
|
||||||
|
"id": "557829b6766f6c350dad0000",
|
||||||
|
"controller": "api/schedules",
|
||||||
|
"action": "destroy"
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Response
|
### Response
|
||||||
|
@ -143,29 +217,38 @@ Too big to display.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# PATCH /api/schedules/557828ff766f6c33e4900000
|
# POST /api/sequences
|
||||||
|
|
||||||
### Request
|
### Request
|
||||||
|
|
||||||
```
|
```
|
||||||
{"schedule"=>{"repeat"=>"66"}, "id"=>"557828ff766f6c33e4900000", "controller"=>"api/schedules", "action"=>"update"}
|
{
|
||||||
|
"name": "Scare Birds",
|
||||||
|
"steps": [
|
||||||
|
{
|
||||||
|
"message_type": "move_relative",
|
||||||
|
"command": {
|
||||||
|
"action": "MOVE RELATIVE",
|
||||||
|
"x": "1",
|
||||||
|
"y": "2",
|
||||||
|
"z": "3",
|
||||||
|
"speed": "100",
|
||||||
|
"delay": "0"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"controller": "api/sequences",
|
||||||
|
"action": "create"
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Response
|
### Response
|
||||||
|
|
||||||
```
|
```
|
||||||
{
|
{
|
||||||
"_id": "557828ff766f6c33e4900000",
|
"_id": "557829b2766f6c350d250000",
|
||||||
"start_time": "2015-06-09T05:01:00.000Z",
|
"name": "Scare Birds",
|
||||||
"end_time": "2015-06-12T00:01:00.000Z",
|
"color": "purple"
|
||||||
"next_time": "2015-06-11T05:01:00.000Z",
|
|
||||||
"repeat": 66,
|
|
||||||
"time_unit": "daily",
|
|
||||||
"sequence_id": "557828ff766f6c33e4930000",
|
|
||||||
"sequence_name": "Fully-configurable methodical hardware",
|
|
||||||
"calendar": [
|
|
||||||
"2015-06-09T05:01:00.000Z"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -176,7 +259,10 @@ Too big to display.
|
||||||
### Request
|
### Request
|
||||||
|
|
||||||
```
|
```
|
||||||
{"controller"=>"api/sequences", "action"=>"index"}
|
{
|
||||||
|
"controller": "api/sequences",
|
||||||
|
"action": "index"
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Response
|
### Response
|
||||||
|
@ -184,190 +270,37 @@ Too big to display.
|
||||||
```
|
```
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"_id": "557828fb766f6c33e43c0000",
|
"_id": "557829b2766f6c350d640000",
|
||||||
"name": "Decentralized content-based hub",
|
"name": "Multi-tiered responsive strategy",
|
||||||
"color": "gray"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"_id": "557828fb766f6c33e43e0000",
|
|
||||||
"name": "Innovative zero tolerance superstructure",
|
|
||||||
"color": "pink"
|
"color": "pink"
|
||||||
}
|
|
||||||
]
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
# POST /api/sequences
|
|
||||||
|
|
||||||
### Request
|
|
||||||
|
|
||||||
```
|
|
||||||
{"name"=>"Scare Birds", "steps"=>[{"message_type"=>"move_relative", "command"=>{"action"=>"MOVE RELATIVE", "x"=>"1", "y"=>"2", "z"=>"3", "speed"=>"100", "delay"=>"0"}}], "controller"=>"api/sequences", "action"=>"create"}
|
|
||||||
```
|
|
||||||
|
|
||||||
### Response
|
|
||||||
|
|
||||||
```
|
|
||||||
{
|
|
||||||
"_id": "557828fc766f6c33e46e0000",
|
|
||||||
"name": "Scare Birds",
|
|
||||||
"color": "yellow"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# POST /api/sequences/557828fb766f6c33e42f0000/steps
|
|
||||||
|
|
||||||
### Request
|
|
||||||
|
|
||||||
```
|
|
||||||
{"name"=>"Scare Birds", "message_type"=>"move_relative", "command"=>{"action"=>"MOVE RELATIVE", "x"=>"1", "y"=>"2", "z"=>"3", "speed"=>"100", "delay"=>"0"}, "sequence_id"=>"557828fb766f6c33e42f0000", "controller"=>"api/steps", "action"=>"create"}
|
|
||||||
```
|
|
||||||
|
|
||||||
### Response
|
|
||||||
|
|
||||||
```
|
|
||||||
{
|
|
||||||
"_id": "557828fb766f6c33e4310000",
|
|
||||||
"message_type": "move_relative",
|
|
||||||
"command": {
|
|
||||||
"action": "MOVE RELATIVE",
|
|
||||||
"x": "1",
|
|
||||||
"y": "2",
|
|
||||||
"z": "3",
|
|
||||||
"speed": "100",
|
|
||||||
"delay": "0"
|
|
||||||
},
|
},
|
||||||
"sequence_id": "557828fb766f6c33e42f0000",
|
|
||||||
"position": 1
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
# DELETE /api/sequences/557828fc766f6c33e4590000/steps/557828fc766f6c33e45a0000
|
|
||||||
|
|
||||||
### Request
|
|
||||||
|
|
||||||
```
|
|
||||||
{"sequence_id"=>"557828fc766f6c33e4590000", "id"=>"557828fc766f6c33e45a0000", "controller"=>"api/steps", "action"=>"destroy"}
|
|
||||||
```
|
|
||||||
|
|
||||||
### Response
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# GET /api/sequences/557828fc766f6c33e46a0000/steps
|
|
||||||
|
|
||||||
### Request
|
|
||||||
|
|
||||||
```
|
|
||||||
{"sequence_id"=>"557828fc766f6c33e46a0000", "controller"=>"api/steps", "action"=>"index"}
|
|
||||||
```
|
|
||||||
|
|
||||||
### Response
|
|
||||||
|
|
||||||
```
|
|
||||||
[
|
|
||||||
{
|
{
|
||||||
"_id": "557828fc766f6c33e46b0000",
|
"_id": "557829b2766f6c350d660000",
|
||||||
"message_type": "single_command",
|
"name": "Reduced asymmetric budgetary management",
|
||||||
"command": {
|
"color": "purple"
|
||||||
"action": "MOVE RELATIVE",
|
|
||||||
"x": 1,
|
|
||||||
"y": 2,
|
|
||||||
"z": 3,
|
|
||||||
"speed": 100,
|
|
||||||
"delay": 0
|
|
||||||
},
|
|
||||||
"sequence_id": "557828fc766f6c33e46a0000",
|
|
||||||
"position": 1
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
# PATCH /api/sequences/557828fc766f6c33e4740000/steps/557828fc766f6c33e4750000
|
# GET /api/sequences/557829b1766f6c350d060000/steps/557829b1766f6c350d070000
|
||||||
|
|
||||||
### Request
|
### Request
|
||||||
|
|
||||||
```
|
|
||||||
{"step"=>{"message_type"=>"read_status"}, "id"=>"557828fc766f6c33e4750000", "sequence_id"=>"557828fc766f6c33e4740000", "controller"=>"api/steps", "action"=>"update"}
|
|
||||||
```
|
|
||||||
|
|
||||||
### Response
|
|
||||||
|
|
||||||
```
|
```
|
||||||
{
|
{
|
||||||
"_id": "557828fc766f6c33e4750000",
|
"sequence_id": "557829b1766f6c350d060000",
|
||||||
"message_type": "read_status",
|
"id": "557829b1766f6c350d070000",
|
||||||
"command": {
|
"controller": "api/steps",
|
||||||
"action": "MOVE RELATIVE",
|
"action": "show"
|
||||||
"x": 1,
|
|
||||||
"y": 2,
|
|
||||||
"z": 3,
|
|
||||||
"speed": 100,
|
|
||||||
"delay": 0
|
|
||||||
},
|
|
||||||
"sequence_id": "557828fc766f6c33e4740000",
|
|
||||||
"position": 1
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
# DELETE /api/sequences/557828fe766f6c33e4840000
|
|
||||||
|
|
||||||
### Request
|
|
||||||
|
|
||||||
```
|
|
||||||
{"id"=>"557828fe766f6c33e4840000", "controller"=>"api/sequences", "action"=>"destroy"}
|
|
||||||
```
|
|
||||||
|
|
||||||
### Response
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# PATCH /api/sequences/557828ff766f6c33e4ae0000
|
|
||||||
|
|
||||||
### Request
|
|
||||||
|
|
||||||
```
|
|
||||||
{"sequence"=>{"name"=>"Scare Birds", "steps"=>[{"message_type"=>"move_relative", "command"=>{"action"=>"MOVE RELATIVE", "x"=>"1", "y"=>"2", "z"=>"3", "speed"=>"100", "delay"=>"0"}}]}, "id"=>"557828ff766f6c33e4ae0000", "controller"=>"api/sequences", "action"=>"update"}
|
|
||||||
```
|
|
||||||
|
|
||||||
### Response
|
### Response
|
||||||
|
|
||||||
```
|
```
|
||||||
{
|
{
|
||||||
"_id": "557828ff766f6c33e4ae0000",
|
"_id": "557829b1766f6c350d070000",
|
||||||
"name": "Scare Birds",
|
|
||||||
"color": "yellow"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
# GET /api/sequences/557828ff766f6c33e4b20000/steps/557828ff766f6c33e4b30000
|
|
||||||
|
|
||||||
### Request
|
|
||||||
|
|
||||||
```
|
|
||||||
{"sequence_id"=>"557828ff766f6c33e4b20000", "id"=>"557828ff766f6c33e4b30000", "controller"=>"api/steps", "action"=>"show"}
|
|
||||||
```
|
|
||||||
|
|
||||||
### Response
|
|
||||||
|
|
||||||
```
|
|
||||||
{
|
|
||||||
"_id": "557828ff766f6c33e4b30000",
|
|
||||||
"message_type": "single_command",
|
"message_type": "single_command",
|
||||||
"command": {
|
"command": {
|
||||||
"action": "MOVE RELATIVE",
|
"action": "MOVE RELATIVE",
|
||||||
|
@ -377,27 +310,224 @@ Too big to display.
|
||||||
"speed": 100,
|
"speed": 100,
|
||||||
"delay": 0
|
"delay": 0
|
||||||
},
|
},
|
||||||
"sequence_id": "557828ff766f6c33e4b20000",
|
"sequence_id": "557829b1766f6c350d060000",
|
||||||
"position": 1
|
"position": 1
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
# GET /api/sequences/557828ff766f6c33e4b60000
|
# GET /api/sequences/557829b2766f6c350d120000
|
||||||
|
|
||||||
### Request
|
### Request
|
||||||
|
|
||||||
```
|
```
|
||||||
{"id"=>"557828ff766f6c33e4b60000", "controller"=>"api/sequences", "action"=>"show"}
|
{
|
||||||
|
"id": "557829b2766f6c350d120000",
|
||||||
|
"controller": "api/sequences",
|
||||||
|
"action": "show"
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Response
|
### Response
|
||||||
|
|
||||||
```
|
```
|
||||||
{
|
{
|
||||||
"_id": "557828ff766f6c33e4b60000",
|
"_id": "557829b2766f6c350d120000",
|
||||||
"name": "Secured exuding knowledge base",
|
"name": "Advanced neutral frame",
|
||||||
"color": "pink"
|
"color": "blue"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
# GET /api/sequences/557829b2766f6c350d370000/steps
|
||||||
|
|
||||||
|
### Request
|
||||||
|
|
||||||
|
```
|
||||||
|
{
|
||||||
|
"sequence_id": "557829b2766f6c350d370000",
|
||||||
|
"controller": "api/steps",
|
||||||
|
"action": "index"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Response
|
||||||
|
|
||||||
|
```
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"_id": "557829b2766f6c350d380000",
|
||||||
|
"message_type": "single_command",
|
||||||
|
"command": {
|
||||||
|
"action": "MOVE RELATIVE",
|
||||||
|
"x": 1,
|
||||||
|
"y": 2,
|
||||||
|
"z": 3,
|
||||||
|
"speed": 100,
|
||||||
|
"delay": 0
|
||||||
|
},
|
||||||
|
"sequence_id": "557829b2766f6c350d370000",
|
||||||
|
"position": 1
|
||||||
|
}
|
||||||
|
]
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
# DELETE /api/sequences/557829b2766f6c350d400000
|
||||||
|
|
||||||
|
### Request
|
||||||
|
|
||||||
|
```
|
||||||
|
{
|
||||||
|
"id": "557829b2766f6c350d400000",
|
||||||
|
"controller": "api/sequences",
|
||||||
|
"action": "destroy"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Response
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# DELETE /api/sequences/557829b2766f6c350d510000/steps/557829b2766f6c350d520000
|
||||||
|
|
||||||
|
### Request
|
||||||
|
|
||||||
|
```
|
||||||
|
{
|
||||||
|
"sequence_id": "557829b2766f6c350d510000",
|
||||||
|
"id": "557829b2766f6c350d520000",
|
||||||
|
"controller": "api/steps",
|
||||||
|
"action": "destroy"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Response
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# PATCH /api/sequences/557829b2766f6c350d600000/steps/557829b2766f6c350d610000
|
||||||
|
|
||||||
|
### Request
|
||||||
|
|
||||||
|
```
|
||||||
|
{
|
||||||
|
"step": {
|
||||||
|
"message_type": "read_status"
|
||||||
|
},
|
||||||
|
"id": "557829b2766f6c350d610000",
|
||||||
|
"sequence_id": "557829b2766f6c350d600000",
|
||||||
|
"controller": "api/steps",
|
||||||
|
"action": "update"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Response
|
||||||
|
|
||||||
|
```
|
||||||
|
{
|
||||||
|
"_id": "557829b2766f6c350d610000",
|
||||||
|
"message_type": "read_status",
|
||||||
|
"command": {
|
||||||
|
"action": "MOVE RELATIVE",
|
||||||
|
"x": 1,
|
||||||
|
"y": 2,
|
||||||
|
"z": 3,
|
||||||
|
"speed": 100,
|
||||||
|
"delay": 0
|
||||||
|
},
|
||||||
|
"sequence_id": "557829b2766f6c350d600000",
|
||||||
|
"position": 1
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
# POST /api/sequences/557829b5766f6c350d910000/steps
|
||||||
|
|
||||||
|
### Request
|
||||||
|
|
||||||
|
```
|
||||||
|
{
|
||||||
|
"name": "Scare Birds",
|
||||||
|
"message_type": "move_relative",
|
||||||
|
"command": {
|
||||||
|
"action": "MOVE RELATIVE",
|
||||||
|
"x": "1",
|
||||||
|
"y": "2",
|
||||||
|
"z": "3",
|
||||||
|
"speed": "100",
|
||||||
|
"delay": "0"
|
||||||
|
},
|
||||||
|
"sequence_id": "557829b5766f6c350d910000",
|
||||||
|
"controller": "api/steps",
|
||||||
|
"action": "create"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Response
|
||||||
|
|
||||||
|
```
|
||||||
|
{
|
||||||
|
"_id": "557829b5766f6c350d930000",
|
||||||
|
"message_type": "move_relative",
|
||||||
|
"command": {
|
||||||
|
"action": "MOVE RELATIVE",
|
||||||
|
"x": "1",
|
||||||
|
"y": "2",
|
||||||
|
"z": "3",
|
||||||
|
"speed": "100",
|
||||||
|
"delay": "0"
|
||||||
|
},
|
||||||
|
"sequence_id": "557829b5766f6c350d910000",
|
||||||
|
"position": 1
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
# PATCH /api/sequences/557829b6766f6c350d9f0000
|
||||||
|
|
||||||
|
### Request
|
||||||
|
|
||||||
|
```
|
||||||
|
{
|
||||||
|
"sequence": {
|
||||||
|
"name": "Scare Birds",
|
||||||
|
"steps": [
|
||||||
|
{
|
||||||
|
"message_type": "move_relative",
|
||||||
|
"command": {
|
||||||
|
"action": "MOVE RELATIVE",
|
||||||
|
"x": "1",
|
||||||
|
"y": "2",
|
||||||
|
"z": "3",
|
||||||
|
"speed": "100",
|
||||||
|
"delay": "0"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"id": "557829b6766f6c350d9f0000",
|
||||||
|
"controller": "api/sequences",
|
||||||
|
"action": "update"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Response
|
||||||
|
|
||||||
|
```
|
||||||
|
{
|
||||||
|
"_id": "557829b6766f6c350d9f0000",
|
||||||
|
"name": "Scare Birds",
|
||||||
|
"color": "orange"
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
### Request
|
### Request
|
||||||
|
|
||||||
```
|
```
|
||||||
<%= request.params %>
|
<%= JSON.pretty_generate(request.params) %>
|
||||||
```
|
```
|
||||||
|
|
||||||
### Response
|
### Response
|
||||||
|
|
Loading…
Reference in New Issue