Robot API

RESTful API for robot
Robot API

Describes RESTful API for operation with a Robot

GET /robot/{id}
POST /robot/
PUT /robot/{id}
DELETE /robot/{id}
Get Robot by id
GET /robot/{id}

Path variables

id
string required

It identifies the Robot and should be GUID in uppercase without brackets and without hyphens

Responses

200 OK
Body
Ger Robot by id

id = “68215FEBA95140EEA53F848A0413C402”

GET /robot/68215FEBA95140EEA53F848A0413C402 HTTP/1.1 

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "name": "Dog",
    "legSequence": [0,3,2,1],
    "id": "68215FEBA95140EEA53F848A0413C402"
}
Post Robot
POST /robot/

Request body

Examples

A new Robot with id “68215FEBA95140EEA53F848A0413C402” will be saved to database

{
    "name": "Dog",
    "legSequence": [0,3,2,1],
    "id": "68215FEBA95140EEA53F848A0413C402"
}

Responses

204 No Content
Post Robot

New Robot with id = “68215FEBA95140EEA53F848A0413C402” will be posted into database

POST /robot/ HTTP/1.1 

Content-Type: application/json

{
    "name": "Dog",
    "legSequence": [0,3,2,1],
    "id": "68215FEBA95140EEA53F848A0413C402"
}

HTTP/1.1 204 No Content 
Update Robot
PUT /robot/{id}

Path variables

id
string required

It identifies the Robot and should be GUID in uppercase without brackets and without hyphens

Request body

Responses

204 No Content
Update Robot

This request updates a Robot with id = “68215FEBA95140EEA53F848A0413C402”

PUT /robot/68215FEBA95140EEA53F848A0413C402 HTTP/1.1 

Content-Type: application/json

{
    "id": "68215FEBA95140EEA53F848A0413C402",
    "name": "Dog",
    "legSequence": [0,3,2,1]
}

HTTP/1.1 204 No Content 
Delete Robot
DELETE /robot/{id}

Path variables

id
string required

It identifies the Robot and should be GUID in uppercase without brackets and without hyphens

Responses

204 No Content
Delete Robot

The request deletes a Robot with id = “68215FEBA95140EEA53F848A0413C402”

DELETE /robot/68215FEBA95140EEA53F848A0413C402 HTTP/1.1 

HTTP/1.1 204 No Content 
Robot activity API

You can move Robot’s legs, that will change a Robot position. Also you can reset a Robot’s position and get Robot’s state. This section describes RESTful API for those operations.

GET /robot/{id}/state
Get Robot state
GET /robot/{id}/state

Error codes: аукпкпрвар арыарыры парпарп ыпыпыпыпыпр ырыпрыпрпыпыпр ыпрыыарыарыпыар

Path variables

id
string required

It identifies the Robot and should be GUID in uppercase without brackets and without hyphens

JSON objects
Robot

The Robot json object. Used in CRUD operation with a Robot.

Object
Example:
{
    "name": "Dog",
    "legSequence": [0,3,2,1],
    "id": "68215FEBA95140EEA53F848A0413C402"
}
id
string required

It identifies the Robot and should be GUID in uppercase without brackets and without hyphens

Example:
68215FEBA95140EEA53F848A0413C402
name
string required

This is a humanreadable name of the Robot

Example:
Dog
legSequence
unknown required

Legs sequence for Robot moving. That should be a json array

Example:
[0, 3, 2, 1]