Skip to content
On this page

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

StatusMeaningDescriptionSchema
200OKokNone

api.saveSettings

Code samples

PUT /settings

Save settings

Body parameter

json
{}

Parameters

NameInTypeRequiredDescription
bodybodySettingstrueSave Settings

Responses

StatusMeaningDescriptionSchema
200OKokNone

api.restoreSettings

Code samples

POST /settings/restore

Restore settings to default

Responses

StatusMeaningDescriptionSchema
200OKokNone

Photos management

api.listPhotos

Code samples

GET /media

Get the list of all photos

Responses

StatusMeaningDescriptionSchema
200OKokNone

api.takePhoto

Code samples

POST /media

take a new photo

Responses

StatusMeaningDescriptionSchema
200OKokNone

api.getPhoto

Code samples

GET /media/{name}

Get photo by name

Parameters

NameInTypeRequiredDescription
namepathstringtruenone

Example responses

200 Response

Responses

StatusMeaningDescriptionSchema
200OKImage in JPEG formatstring

api.savePhoto

Code samples

PUT /media/{name}

Save photo by name

Body parameter

json
{
  "name": "string",
  "tag": "string"
}

Parameters

NameInTypeRequiredDescription
namepathstringtruenone
bodybodyPhototrueSave Photo metadata

Responses

StatusMeaningDescriptionSchema
200OKokNone

api.deletePhoto

Code samples

DELETE /media/{name}

Delete photo by name

Parameters

NameInTypeRequiredDescription
namepathstringtruenone

Responses

StatusMeaningDescriptionSchema
200OKokNone

Video management

api.streamVideo

Code samples

GET /video/stream

Stream video

Responses

StatusMeaningDescriptionSchema
200OKokNone

api.recVideo

Code samples

POST /video/rec

Rec video

Responses

StatusMeaningDescriptionSchema
200OKokNone

api.stopVideo

Code samples

POST /video/stop

Stop rec video

Responses

StatusMeaningDescriptionSchema
200OKokNone

Program management

api.listPrograms

Code samples

GET /programs

Get the list of all the saved programs

Responses

StatusMeaningDescriptionSchema
200OKokNone

api.loadProgram

Code samples

GET /programs/{name}

Get the program with the specified name

Parameters

NameInTypeRequiredDescription
namepathstringtruenone

Responses

StatusMeaningDescriptionSchema
200OKokNone

api.deleteProgram

Code samples

DELETE /programs/{name}

Delete a program

Parameters

NameInTypeRequiredDescription
namepathstringtruenone

Responses

StatusMeaningDescriptionSchema
200OKokNone

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

NameInTypeRequiredDescription
namepathstringtruenone
bodybodyProgramtrueProgram object

Responses

StatusMeaningDescriptionSchema
200OKokNone
400Bad RequestFailed to save the programNone

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

NameInTypeRequiredDescription
namepathstringtruenone
bodybodyProgramtrueProgram object

Responses

StatusMeaningDescriptionSchema
200OKokNone

api.statusProgram

Code samples

GET /programs/{name}/status

Get the status of the given program

Parameters

NameInTypeRequiredDescription
namepathstringtruenone

Responses

StatusMeaningDescriptionSchema
200OKokNone

api.stopProgram

Code samples

PATCH /programs/{name}/stop

Stop the given program

Parameters

NameInTypeRequiredDescription
namepathstringtruenone

Responses

StatusMeaningDescriptionSchema
200OKokNone

Activity management

api.listActivities

Code samples

GET /activities

Get the list of all the saved activities

Responses

StatusMeaningDescriptionSchema
200OKokNone

api.saveAsNewActivity

Code samples

POST /activities

Save a new activity

Body parameter

json
{
  "name": "string",
  "description": "string",
  "default": true,
  "stock": true
}

Parameters

NameInTypeRequiredDescription
bodybodyActivitytrueCreate new Activity

Responses

StatusMeaningDescriptionSchema
200OKokNone
400Bad RequestFailed to save the activityNone

api.loadActivity

Code samples

GET /activities/{name}

Get the activity with the specified name

Parameters

NameInTypeRequiredDescription
namepathstringtruenone
defaultquerystringfalsenone

Responses

StatusMeaningDescriptionSchema
200OKokNone

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

NameInTypeRequiredDescription
namepathstringtruenone
bodybodyActivitytrueUpdate Activity

Responses

StatusMeaningDescriptionSchema
200OKokNone

api.deleteActivity

Code samples

DELETE /activities/{name}

Delete an activity

Parameters

NameInTypeRequiredDescription
namepathstringtruenone

Responses

StatusMeaningDescriptionSchema
200OKokNone

Music extensions

api.listMusicPackages

Code samples

GET /music/packages

List Music Packages

Responses

StatusMeaningDescriptionSchema
200OKokNone

api.deleteMusicPackage

Code samples

DELETE /music/packages/{name}

Delete Music Package

Parameters

NameInTypeRequiredDescription
namepathstringtruenone

Responses

StatusMeaningDescriptionSchema
200OKokNone
400Bad Requestnot foundNone

System operations

api.addMusicPackage

Code samples

POST /music/packages

Add Music Package

Body parameter

yaml
{}

Parameters

NameInTypeRequiredDescription
bodybodyobjecttrueAdd a Music Package

Responses

StatusMeaningDescriptionSchema
200OKokNone
400Bad Requestupload failedNone

api.get_status

Code samples

GET /system/status

Bot general informations, execution status and reset log file

Responses

StatusMeaningDescriptionSchema
200OKBot statusNone

api.testCoderbot

Code samples

POST /system/test

Tests CoderBot components.

Body parameter

json
{
  "tests": [
    "string"
  ]
}

Parameters

NameInTypeRequiredDescription
bodybodyobjecttruePerforms onboard tests
» testsbody[string]falsenone

Responses

StatusMeaningDescriptionSchema
200OKTest ended.None
400Bad RequestInvalid input.None

api.get_info

Code samples

GET /system/info

Bot general informations and execution status

Responses

StatusMeaningDescriptionSchema
200OKBot statusNone

api.halt

Code samples

POST /system/halt

Halt system (system shutdown)

Responses

StatusMeaningDescriptionSchema
200OKacceptedNone

api.reset

Code samples

POST /system/reset

Reset all local configuration to factory state

Responses

StatusMeaningDescriptionSchema
200OKnoneNone

api.restart

Code samples

POST /system/restart

Restart backend

Responses

StatusMeaningDescriptionSchema
200OKacceptedNone

api.reboot

Code samples

POST /system/reboot

Reboot all device

Responses

StatusMeaningDescriptionSchema
200OKacceptedNone

Direct control

api.stop

Code samples

POST /control/stop

Stops the bot motors

Responses

StatusMeaningDescriptionSchema
200OKSuccessfully stopped the motorsNone

api.move

Code samples

POST /control/move

Moves the bot forward or backward.

Body parameter

json
{
  "speed": -100,
  "elapse": -1
}

Parameters

NameInTypeRequiredDescription
bodybodyanytrueMovement speed and duration or distance

Responses

StatusMeaningDescriptionSchema
200OKSent 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

NameInTypeRequiredDescription
bodybodyanytrueMovement Speed and duration or distance

Responses

StatusMeaningDescriptionSchema
200OKSent command to the bot GPIO.None

api.speak

Code samples

POST /control/speak

Pronounce a phrase

Body parameter

json
{
  "text": "string",
  "locale": "st"
}

Parameters

NameInTypeRequiredDescription
bodybodyobjecttrueMovement Speed and duration
» textbodystringtruetext to be "spoken"
» localebodystringtruelocale of text to be "spoken"

Responses

StatusMeaningDescriptionSchema
200OKphrase receivedNone

CNN Models

api.listCNNModels

Code samples

GET /cnnmodels

list of CNN Models

Responses

StatusMeaningDescriptionSchema
200OKCNN Models as JSON ObjectNone

api.trainCNNModel

Code samples

POST /cnnmodels

train new CNN Model

Body parameter

json
{}

Parameters

NameInTypeRequiredDescription
bodybodyobjecttrueCNN Model parameters

Responses

StatusMeaningDescriptionSchema
200OKCNN Models as JSON ObjectNone

api.getCNNModel

Code samples

GET /cnnmodels/{name}

get CNN Model

Parameters

NameInTypeRequiredDescription
namepathstringtruenone

Responses

StatusMeaningDescriptionSchema
200OKCNN Model as JSON ObjectNone

api.deleteCNNModel

Code samples

DELETE /cnnmodels/{name}

delete CNN Model

Parameters

NameInTypeRequiredDescription
namepathstringtruenone

Responses

StatusMeaningDescriptionSchema
200OKCNN Model deletedNone

Schemas

MoveParamsElapse

json
{
  "speed": -100,
  "elapse": -1
}

Properties

NameTypeRequiredRestrictionsDescription
speednumbertruenone0 to 100 represent a forward movement (100 being the maximum speed), while 0 to -100 is a backward movement (-100 being the maximu speed)
elapsenumbertruenoneDuration of the movement. 0 doesn't move the coderbot.

MoveParamsDistance

json
{
  "speed": -100,
  "distance": 1000
}

Properties

NameTypeRequiredRestrictionsDescription
speednumbertruenone0 to 100 represent a forward movement (100 being the maximum speed), while 0 to -100 is a backward movement (-100 being the maximu speed)
distancenumbertruenoneTarget distqnce in mm.

TurnParamsElapse

json
{
  "speed": -100,
  "elapse": -1
}

Properties

NameTypeRequiredRestrictionsDescription
speednumbertruenone0 to 100 represent a forward movement (100 being the maximum speed), while 0 to -100 is a backward movement (-100 being the maximu speed)
elapsenumbertruenoneDuration of the movement. 0 doesn't move the coderbot.

TurnParamsDistance

json
{
  "speed": -100,
  "distance": 100000
}

Properties

NameTypeRequiredRestrictionsDescription
speednumbertruenone0 to 100 represent a forward movement (100 being the maximum speed), while 0 to -100 is a backward movement (-100 being the maximu speed)
distancenumbertruenoneTarget distqnce in mm.

Settings

json
{}

Properties

None

Photo

json
{
  "name": "string",
  "tag": "string"
}

Properties

NameTypeRequiredRestrictionsDescription
namestringfalsenonenone
tagstringfalsenonenone

Program

json
{
  "name": "string",
  "code": "string",
  "dom_code": "string",
  "default": true,
  "overwrite": true
}

Properties

NameTypeRequiredRestrictionsDescription
namestringtruenonenone
codestringtruenonenone
dom_codestringfalsenonenone
defaultbooleanfalsenonenone
overwritebooleanfalsenonenone

Activity

json
{
  "name": "string",
  "description": "string",
  "default": true,
  "stock": true
}

Properties

NameTypeRequiredRestrictionsDescription
namestringtruenonenone
descriptionstringtruenonenone
defaultbooleantruenonenone
stockbooleantruenonenone