Task API
Create, update, and manage robot tasks and missions.
Get the list of all tasks
Retrieve the list of all tasks of the robot. This endpoint returns all tasks with their details such as ID, target, and status.
Response Body
Successful Response
responseRequiredResponse Get Tasks Api V1 Tasks Getcurl -X GET "http://localhost:7242/api/v1/tasks"fetch("http://localhost:7242/api/v1/tasks")package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "http://localhost:7242/api/v1/tasks"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}import requests
url = "http://localhost:7242/api/v1/tasks"
response = requests.request("GET", url)
print(response.text)[
{
"id": 1,
"uid": 1,
"site": "site",
"floor": "floor",
"task_type": "TABLE_SERVICE",
"task_index": 0,
"success": true,
"completed": true,
"message": "Task started successfully",
"target": {
"cid": "",
"eg": "",
"eg_dir": "",
"label": "{}",
"name": "Target 1",
"px": 0,
"py": 0,
"site_floor": {
"floor": "floor",
"site": "site"
},
"tol": 0.5,
"type": "default='default'",
"uid": "site_floor_target-1",
"yaw_deg": 0
},
"create_time": 1633036800,
"celebrating_name": "John Doe",
"payload": [
false,
false,
false,
false
]
}
]Create or update a task and sort the list
Create a new task or update an existing one. This endpoint allows you to add a task with a target UID and sort the task list. The task will be added to the mission info and sorted by task ID.
Request Body
application/jsonRequiredtimeoutTimeoutTimeout in waiting for task start, in seconds.
0typeRequiredTypeThe type of the task (e.g., 'TABLE_SERVICE', 'DISH', 'CELEBRATING').
activateRequiredActivateIndicates whether the task should be activated or deactivated.
task_indexTask IndexThe index of the task in the task list, if applicable.
0target_uidRequiredTarget UidThe unique identifier of the target to which the task is assigned.
1payloadPayloadList of payloads to be used for the task, if any.
celebrating_nameCelebrating NameThe name of the person to be celebrated, if applicable.
""Response Body
Successful Response
status_codeStatus CodeHTTP status code of the response.
200successSuccessIndicates whether the operation was successful.
truemessageMessageA message providing additional information about the operation.
""dataobject | null | nullerrorobject | null | nullValidation Error
detailDetailcurl -X POST "http://localhost:7242/api/v1/tasks" \
-H "Content-Type: application/json" \
-d '{
"timeout": 30,
"type": "TABLE_SERVICE",
"activate": true,
"task_index": 0,
"target_uid": "site_floor_target-1",
"payload": [
false,
false,
false,
false
],
"celebrating_name": "John Doe"
}'const body = JSON.stringify({
"timeout": 30,
"type": "TABLE_SERVICE",
"activate": true,
"task_index": 0,
"target_uid": "site_floor_target-1",
"payload": [
false,
false,
false,
false
],
"celebrating_name": "John Doe"
})
fetch("http://localhost:7242/api/v1/tasks", {
body
})package main
import (
"fmt"
"net/http"
"io/ioutil"
"strings"
)
func main() {
url := "http://localhost:7242/api/v1/tasks"
body := strings.NewReader(`{
"timeout": 30,
"type": "TABLE_SERVICE",
"activate": true,
"task_index": 0,
"target_uid": "site_floor_target-1",
"payload": [
false,
false,
false,
false
],
"celebrating_name": "John Doe"
}`)
req, _ := http.NewRequest("POST", url, body)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}import requests
url = "http://localhost:7242/api/v1/tasks"
body = {
"timeout": 30,
"type": "TABLE_SERVICE",
"activate": true,
"task_index": 0,
"target_uid": "site_floor_target-1",
"payload": [
false,
false,
false,
false
],
"celebrating_name": "John Doe"
}
response = requests.request("POST", url, json = body, headers = {
"Content-Type": "application/json"
})
print(response.text){
"status_code": 200,
"success": true,
"message": "Operation successful",
"data": {
"key": "value"
},
"error": {
"code": "ERROR_CODE",
"message": "An error occurred"
}
}{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string"
}
]
}Get a specific task by ID
Retrieve a specific task by its ID. This endpoint returns the task information if it exists, otherwise it raises a 404 error.
Path Parameters
task_uidRequiredTask UidResponse Body
Successful Response
idRequiredIdThe unique identifier of the task.
uidRequiredUidThe unique identifier of the task, same as id.
siteRequiredSiteThe site where the task is being performed.
floorRequiredFloorThe floor where the task is being performed.
task_typeRequiredTask TypeThe type of the task (e.g., 'TABLE_SERVICE', 'DISH', 'CELEBRATING').
task_indexTask IndexThe index of the task in the task list, if applicable.
0successRequiredSuccessIndicates whether the task was successfully started.
completedRequiredCompletedIndicates whether the task was completed successfully.
messageRequiredMessageA message providing additional information about the task status.
targetTargetModelThe target to which the robot is navigating.
create_timeRequiredCreate TimeThe timestamp when the task was created.
celebrating_nameCelebrating NameThe name of the person to be celebrated, if applicable.
""payloadPayloadWhich tray or payload is used for the task, if any.
Task not found for the specified ID.
Validation Error
detailDetailcurl -X GET "http://localhost:7242/api/v1/tasks/string"fetch("http://localhost:7242/api/v1/tasks/string")package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "http://localhost:7242/api/v1/tasks/string"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}import requests
url = "http://localhost:7242/api/v1/tasks/string"
response = requests.request("GET", url)
print(response.text){
"id": 1,
"uid": 1,
"site": "site",
"floor": "floor",
"task_type": "TABLE_SERVICE",
"task_index": 0,
"success": true,
"completed": true,
"message": "Task started successfully",
"target": {
"cid": "",
"eg": "",
"eg_dir": "",
"label": "{}",
"name": "Target 1",
"px": 0,
"py": 0,
"site_floor": {
"floor": "floor",
"site": "site"
},
"tol": 0.5,
"type": "default='default'",
"uid": "site_floor_target-1",
"yaw_deg": 0
},
"create_time": 1633036800,
"celebrating_name": "John Doe",
"payload": [
false,
false,
false,
false
]
}{
"status_code": 404,
"success": false,
"message": "Task not found for the specified ID.",
"error": {
"code": "TASK_NOT_FOUND",
"message": "Task not found for the specified ID."
}
}{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string"
}
]
}Update a specific task by ID
Update a specific task by its ID. This endpoint allows you to modify the task's target UID and other details. The task will be updated in the mission info and sorted by task ID.
Request Body
application/jsonRequiredtimeoutTimeoutTimeout in waiting for task start, in seconds.
0typeRequiredTypeThe type of the task (e.g., 'TABLE_SERVICE', 'DISH', 'CELEBRATING').
activateRequiredActivateIndicates whether the task should be activated or deactivated.
task_indexTask IndexThe index of the task in the task list, if applicable.
0target_uidRequiredTarget UidThe unique identifier of the target to which the task is assigned.
1payloadPayloadList of payloads to be used for the task, if any.
celebrating_nameCelebrating NameThe name of the person to be celebrated, if applicable.
""Path Parameters
task_uidRequiredTask UidResponse Body
Successful Response
status_codeStatus CodeHTTP status code of the response.
200successSuccessIndicates whether the operation was successful.
truemessageMessageA message providing additional information about the operation.
""dataobject | null | nullerrorobject | null | nullValidation Error
detailDetailcurl -X PATCH "http://localhost:7242/api/v1/tasks/string" \
-H "Content-Type: application/json" \
-d '{
"timeout": 30,
"type": "TABLE_SERVICE",
"activate": true,
"task_index": 0,
"target_uid": "site_floor_target-1",
"payload": [
false,
false,
false,
false
],
"celebrating_name": "John Doe"
}'const body = JSON.stringify({
"timeout": 30,
"type": "TABLE_SERVICE",
"activate": true,
"task_index": 0,
"target_uid": "site_floor_target-1",
"payload": [
false,
false,
false,
false
],
"celebrating_name": "John Doe"
})
fetch("http://localhost:7242/api/v1/tasks/string", {
body
})package main
import (
"fmt"
"net/http"
"io/ioutil"
"strings"
)
func main() {
url := "http://localhost:7242/api/v1/tasks/string"
body := strings.NewReader(`{
"timeout": 30,
"type": "TABLE_SERVICE",
"activate": true,
"task_index": 0,
"target_uid": "site_floor_target-1",
"payload": [
false,
false,
false,
false
],
"celebrating_name": "John Doe"
}`)
req, _ := http.NewRequest("PATCH", url, body)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}import requests
url = "http://localhost:7242/api/v1/tasks/string"
body = {
"timeout": 30,
"type": "TABLE_SERVICE",
"activate": true,
"task_index": 0,
"target_uid": "site_floor_target-1",
"payload": [
false,
false,
false,
false
],
"celebrating_name": "John Doe"
}
response = requests.request("PATCH", url, json = body, headers = {
"Content-Type": "application/json"
})
print(response.text){
"status_code": 200,
"success": true,
"message": "Operation successful",
"data": {
"key": "value"
},
"error": {
"code": "ERROR_CODE",
"message": "An error occurred"
}
}{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string"
}
]
}Delete a specific task by ID
Delete a specific task by its ID. This endpoint allows you to remove a task from the robot's mission info. The task will be removed from the list and the task count will be updated.
Path Parameters
task_uidRequiredTask UidResponse Body
Successful Response
status_codeStatus CodeHTTP status code of the response.
200successSuccessIndicates whether the operation was successful.
truemessageMessageA message providing additional information about the operation.
""dataobject | null | nullerrorobject | null | nullValidation Error
detailDetailcurl -X DELETE "http://localhost:7242/api/v1/tasks/string"fetch("http://localhost:7242/api/v1/tasks/string")package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "http://localhost:7242/api/v1/tasks/string"
req, _ := http.NewRequest("DELETE", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}import requests
url = "http://localhost:7242/api/v1/tasks/string"
response = requests.request("DELETE", url)
print(response.text){
"status_code": 200,
"success": true,
"message": "Operation successful",
"data": {
"key": "value"
},
"error": {
"code": "ERROR_CODE",
"message": "An error occurred"
}
}{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string"
}
]
}Pause the robot
Pause the robot's current mission. This endpoint allows you to pause the robot's current mission by publishing a pause message.
Response Body
Successful Response
status_codeStatus CodeHTTP status code of the response.
200successSuccessIndicates whether the operation was successful.
truemessageMessageA message providing additional information about the operation.
""dataobject | null | nullerrorobject | null | nullcurl -X POST "http://localhost:7242/api/v1/tasks/pause"fetch("http://localhost:7242/api/v1/tasks/pause")package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "http://localhost:7242/api/v1/tasks/pause"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}import requests
url = "http://localhost:7242/api/v1/tasks/pause"
response = requests.request("POST", url)
print(response.text){
"status_code": 200,
"success": true,
"message": "Operation successful",
"data": {
"key": "value"
},
"error": {
"code": "ERROR_CODE",
"message": "An error occurred"
}
}Resume the robot
Resume the robot's paused mission. This endpoint allows you to resume the robot's mission by publishing a resume message.
Response Body
Successful Response
status_codeStatus CodeHTTP status code of the response.
200successSuccessIndicates whether the operation was successful.
truemessageMessageA message providing additional information about the operation.
""dataobject | null | nullerrorobject | null | nullcurl -X POST "http://localhost:7242/api/v1/tasks/resume"fetch("http://localhost:7242/api/v1/tasks/resume")package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "http://localhost:7242/api/v1/tasks/resume"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}import requests
url = "http://localhost:7242/api/v1/tasks/resume"
response = requests.request("POST", url)
print(response.text){
"status_code": 200,
"success": true,
"message": "Operation successful",
"data": {
"key": "value"
},
"error": {
"code": "ERROR_CODE",
"message": "An error occurred"
}
}Clear all tasks from the robot's mission
Clear all tasks from the robot's mission. This endpoint allows you to remove all tasks from the robot's mission info, effectively resetting the task list.
Response Body
Successful Response
status_codeStatus CodeHTTP status code of the response.
200successSuccessIndicates whether the operation was successful.
truemessageMessageA message providing additional information about the operation.
""dataobject | null | nullerrorobject | null | nullcurl -X POST "http://localhost:7242/api/v1/tasks/clear"fetch("http://localhost:7242/api/v1/tasks/clear")package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "http://localhost:7242/api/v1/tasks/clear"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}import requests
url = "http://localhost:7242/api/v1/tasks/clear"
response = requests.request("POST", url)
print(response.text){
"status_code": 200,
"success": true,
"message": "Operation successful",
"data": {
"key": "value"
},
"error": {
"code": "ERROR_CODE",
"message": "An error occurred"
}
}