Appearance
OpenAPI 3.0 definition of Coderbot API v3 v1.0
Scroll down for example requests and responses.
Base URLs:
CoderBot configuration
api.loadSettings
Code samples
GET /settings
Load settings
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | ok | None |
api.saveSettings
Code samples
PUT /settings
Save settings
Body parameter
json
{}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | Settings | true | Save Settings |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | ok | None |
api.restoreSettings
Code samples
POST /settings/restore
Restore settings to default
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | ok | None |
Photos management
api.listPhotos
Code samples
GET /media
Get the list of all photos
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | ok | None |
api.takePhoto
Code samples
POST /media
take a new photo
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | ok | None |
api.getPhoto
Code samples
GET /media/{name}
Get photo by name
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
name | path | string | true | none |
Example responses
200 Response
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Image in JPEG format | string |
api.savePhoto
Code samples
PUT /media/{name}
Save photo by name
Body parameter
json
{
"name": "string",
"tag": "string"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
name | path | string | true | none |
body | body | Photo | true | Save Photo metadata |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | ok | None |
api.deletePhoto
Code samples
DELETE /media/{name}
Delete photo by name
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
name | path | string | true | none |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | ok | None |
Video management
api.streamVideo
Code samples
GET /video/stream
Stream video
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | ok | None |
api.recVideo
Code samples
POST /video/rec
Rec video
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | ok | None |
api.stopVideo
Code samples
POST /video/stop
Stop rec video
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | ok | None |
Program management
api.listPrograms
Code samples
GET /programs
Get the list of all the saved programs
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | ok | None |
api.loadProgram
Code samples
GET /programs/{name}
Get the program with the specified name
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
name | path | string | true | none |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | ok | None |
api.deleteProgram
Code samples
DELETE /programs/{name}
Delete a program
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
name | path | string | true | none |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | ok | None |
api.saveProgram
Code samples
PUT /programs/{name}
Save an existing program
Body parameter
json
{
"name": "string",
"code": "string",
"dom_code": "string",
"default": true,
"overwrite": true
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
name | path | string | true | none |
body | body | Program | true | Program object |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | ok | None |
400 | Bad Request | Failed to save the program | None |
api.runProgram
Code samples
POST /programs/{name}/run
Execute the given program
Body parameter
json
{
"name": "string",
"code": "string",
"dom_code": "string",
"default": true,
"overwrite": true
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
name | path | string | true | none |
body | body | Program | true | Program object |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | ok | None |
api.statusProgram
Code samples
GET /programs/{name}/status
Get the status of the given program
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
name | path | string | true | none |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | ok | None |
api.stopProgram
Code samples
PATCH /programs/{name}/stop
Stop the given program
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
name | path | string | true | none |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | ok | None |
Activity management
api.listActivities
Code samples
GET /activities
Get the list of all the saved activities
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | ok | None |
api.saveAsNewActivity
Code samples
POST /activities
Save a new activity
Body parameter
json
{
"name": "string",
"description": "string",
"default": true,
"stock": true
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | Activity | true | Create new Activity |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | ok | None |
400 | Bad Request | Failed to save the activity | None |
api.loadActivity
Code samples
GET /activities/{name}
Get the activity with the specified name
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
name | path | string | true | none |
default | query | string | false | none |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | ok | None |
api.saveActivity
Code samples
PUT /activities/{name}
Save the activity with the specified name
Body parameter
json
{
"name": "string",
"description": "string",
"default": true,
"stock": true
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
name | path | string | true | none |
body | body | Activity | true | Update Activity |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | ok | None |
api.deleteActivity
Code samples
DELETE /activities/{name}
Delete an activity
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
name | path | string | true | none |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | ok | None |
Music extensions
api.listMusicPackages
Code samples
GET /music/packages
List Music Packages
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | ok | None |
api.deleteMusicPackage
Code samples
DELETE /music/packages/{name}
Delete Music Package
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
name | path | string | true | none |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | ok | None |
400 | Bad Request | not found | None |
System operations
api.addMusicPackage
Code samples
POST /music/packages
Add Music Package
Body parameter
yaml
{}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | object | true | Add a Music Package |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | ok | None |
400 | Bad Request | upload failed | None |
api.get_status
Code samples
GET /system/status
Bot general informations, execution status and reset log file
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Bot status | None |
api.testCoderbot
Code samples
POST /system/test
Tests CoderBot components.
Body parameter
json
{
"tests": [
"string"
]
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | object | true | Performs onboard tests |
» tests | body | [string] | false | none |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Test ended. | None |
400 | Bad Request | Invalid input. | None |
api.get_info
Code samples
GET /system/info
Bot general informations and execution status
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Bot status | None |
api.halt
Code samples
POST /system/halt
Halt system (system shutdown)
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | accepted | None |
api.reset
Code samples
POST /system/reset
Reset all local configuration to factory state
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | none | None |
api.restart
Code samples
POST /system/restart
Restart backend
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | accepted | None |
api.reboot
Code samples
POST /system/reboot
Reboot all device
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | accepted | None |
Direct control
api.stop
Code samples
POST /control/stop
Stops the bot motors
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Successfully stopped the motors | None |
api.move
Code samples
POST /control/move
Moves the bot forward or backward.
Body parameter
json
{
"speed": -100,
"elapse": -1
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | any | true | Movement speed and duration or distance |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Sent command to the bot GPIO. | None |
api.turn
Code samples
POST /control/turn
Make a turn with the motors
Body parameter
json
{
"speed": -100,
"elapse": -1
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | any | true | Movement Speed and duration or distance |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Sent command to the bot GPIO. | None |
api.speak
Code samples
POST /control/speak
Pronounce a phrase
Body parameter
json
{
"text": "string",
"locale": "st"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | object | true | Movement Speed and duration |
» text | body | string | true | text to be "spoken" |
» locale | body | string | true | locale of text to be "spoken" |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | phrase received | None |
CNN Models
api.listCNNModels
Code samples
GET /cnnmodels
list of CNN Models
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | CNN Models as JSON Object | None |
api.trainCNNModel
Code samples
POST /cnnmodels
train new CNN Model
Body parameter
json
{}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | object | true | CNN Model parameters |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | CNN Models as JSON Object | None |
api.getCNNModel
Code samples
GET /cnnmodels/{name}
get CNN Model
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
name | path | string | true | none |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | CNN Model as JSON Object | None |
api.deleteCNNModel
Code samples
DELETE /cnnmodels/{name}
delete CNN Model
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
name | path | string | true | none |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | CNN Model deleted | None |
Schemas
MoveParamsElapse
json
{
"speed": -100,
"elapse": -1
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
speed | number | true | none | 0 to 100 represent a forward movement (100 being the maximum speed), while 0 to -100 is a backward movement (-100 being the maximu speed) |
elapse | number | true | none | Duration of the movement. 0 doesn't move the coderbot. |
MoveParamsDistance
json
{
"speed": -100,
"distance": 1000
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
speed | number | true | none | 0 to 100 represent a forward movement (100 being the maximum speed), while 0 to -100 is a backward movement (-100 being the maximu speed) |
distance | number | true | none | Target distqnce in mm. |
TurnParamsElapse
json
{
"speed": -100,
"elapse": -1
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
speed | number | true | none | 0 to 100 represent a forward movement (100 being the maximum speed), while 0 to -100 is a backward movement (-100 being the maximu speed) |
elapse | number | true | none | Duration of the movement. 0 doesn't move the coderbot. |
TurnParamsDistance
json
{
"speed": -100,
"distance": 100000
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
speed | number | true | none | 0 to 100 represent a forward movement (100 being the maximum speed), while 0 to -100 is a backward movement (-100 being the maximu speed) |
distance | number | true | none | Target distqnce in mm. |
Settings
json
{}
Properties
None
Photo
json
{
"name": "string",
"tag": "string"
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
name | string | false | none | none |
tag | string | false | none | none |
Program
json
{
"name": "string",
"code": "string",
"dom_code": "string",
"default": true,
"overwrite": true
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
name | string | true | none | none |
code | string | true | none | none |
dom_code | string | false | none | none |
default | boolean | false | none | none |
overwrite | boolean | false | none | none |
Activity
json
{
"name": "string",
"description": "string",
"default": true,
"stock": true
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
name | string | true | none | none |
description | string | true | none | none |
default | boolean | true | none | none |
stock | boolean | true | none | none |