Robot Documentations

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.

GET
/api/v1/tasks

Response Body

Successful Response

responseRequiredResponse Get Tasks Api V1 Tasks Get
curl -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.

POST
/api/v1/tasks

Request Body

application/jsonRequired
timeoutTimeout

Timeout in waiting for task start, in seconds.

Default: 0
typeRequiredType

The type of the task (e.g., 'TABLE_SERVICE', 'DISH', 'CELEBRATING').

activateRequiredActivate

Indicates whether the task should be activated or deactivated.

task_indexTask Index

The index of the task in the task list, if applicable.

Default: 0
target_uidRequiredTarget Uid

The unique identifier of the target to which the task is assigned.

Minimum length: 1
payloadPayload

List of payloads to be used for the task, if any.

celebrating_nameCelebrating Name

The name of the person to be celebrated, if applicable.

Default: ""

Response Body

Successful Response

status_codeStatus Code

HTTP status code of the response.

Default: 200
successSuccess

Indicates whether the operation was successful.

Default: true
messageMessage

A message providing additional information about the operation.

Default: ""
dataobject | null | null
errorobject | null | null

Validation Error

detailDetail
curl -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.

GET
/api/v1/tasks/{task_uid}

Path Parameters

task_uidRequiredTask Uid

Response Body

Successful Response

idRequiredId

The unique identifier of the task.

uidRequiredUid

The unique identifier of the task, same as id.

siteRequiredSite

The site where the task is being performed.

floorRequiredFloor

The floor where the task is being performed.

task_typeRequiredTask Type

The type of the task (e.g., 'TABLE_SERVICE', 'DISH', 'CELEBRATING').

task_indexTask Index

The index of the task in the task list, if applicable.

Default: 0
successRequiredSuccess

Indicates whether the task was successfully started.

completedRequiredCompleted

Indicates whether the task was completed successfully.

messageRequiredMessage

A message providing additional information about the task status.

targetTargetModel

The target to which the robot is navigating.

create_timeRequiredCreate Time

The timestamp when the task was created.

celebrating_nameCelebrating Name

The name of the person to be celebrated, if applicable.

Default: ""
payloadPayload

Which tray or payload is used for the task, if any.

Task not found for the specified ID.

Validation Error

detailDetail
curl -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.

PATCH
/api/v1/tasks/{task_uid}

Request Body

application/jsonRequired
timeoutTimeout

Timeout in waiting for task start, in seconds.

Default: 0
typeRequiredType

The type of the task (e.g., 'TABLE_SERVICE', 'DISH', 'CELEBRATING').

activateRequiredActivate

Indicates whether the task should be activated or deactivated.

task_indexTask Index

The index of the task in the task list, if applicable.

Default: 0
target_uidRequiredTarget Uid

The unique identifier of the target to which the task is assigned.

Minimum length: 1
payloadPayload

List of payloads to be used for the task, if any.

celebrating_nameCelebrating Name

The name of the person to be celebrated, if applicable.

Default: ""

Path Parameters

task_uidRequiredTask Uid

Response Body

Successful Response

status_codeStatus Code

HTTP status code of the response.

Default: 200
successSuccess

Indicates whether the operation was successful.

Default: true
messageMessage

A message providing additional information about the operation.

Default: ""
dataobject | null | null
errorobject | null | null

Validation Error

detailDetail
curl -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.

DELETE
/api/v1/tasks/{task_uid}

Path Parameters

task_uidRequiredTask Uid

Response Body

Successful Response

status_codeStatus Code

HTTP status code of the response.

Default: 200
successSuccess

Indicates whether the operation was successful.

Default: true
messageMessage

A message providing additional information about the operation.

Default: ""
dataobject | null | null
errorobject | null | null

Validation Error

detailDetail
curl -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.

POST
/api/v1/tasks/pause

Response Body

Successful Response

status_codeStatus Code

HTTP status code of the response.

Default: 200
successSuccess

Indicates whether the operation was successful.

Default: true
messageMessage

A message providing additional information about the operation.

Default: ""
dataobject | null | null
errorobject | null | null
curl -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.

POST
/api/v1/tasks/resume

Response Body

Successful Response

status_codeStatus Code

HTTP status code of the response.

Default: 200
successSuccess

Indicates whether the operation was successful.

Default: true
messageMessage

A message providing additional information about the operation.

Default: ""
dataobject | null | null
errorobject | null | null
curl -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.

POST
/api/v1/tasks/clear

Response Body

Successful Response

status_codeStatus Code

HTTP status code of the response.

Default: 200
successSuccess

Indicates whether the operation was successful.

Default: true
messageMessage

A message providing additional information about the operation.

Default: ""
dataobject | null | null
errorobject | null | null
curl -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"
  }
}