Categories API
Manage target categories for organizing and classifying robot targets.
Get the list of categories
Retrieve all categories configured for the robot.
Response Body
Successful Response
responseRequiredResponse Get Categories Api V1 Categories Getcurl -X GET "http://localhost:7242/api/v1/categories"fetch("http://localhost:7242/api/v1/categories")package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "http://localhost:7242/api/v1/categories"
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/categories"
response = requests.request("GET", url)
print(response.text)[
{
"image": "",
"label": "{\"name\":\"Beverages\"}",
"cid": "1"
}
]Add a new category to the robot
Add a new category to the robot configuration.
Request Body
application/jsonRequiredimagestring | null | nulllabelLabelCategory label json.
"{}"cidstring | null | nullResponse 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 | nullFailed to add category
Validation Error
detailDetailcurl -X POST "http://localhost:7242/api/v1/categories" \
-H "Content-Type: application/json" \
-d '{
"image": "",
"label": "{\"name\":\"Beverages\"}",
"cid": "1"
}'const body = JSON.stringify({
"image": "",
"label": "{\"name\":\"Beverages\"}",
"cid": "1"
})
fetch("http://localhost:7242/api/v1/categories", {
body
})package main
import (
"fmt"
"net/http"
"io/ioutil"
"strings"
)
func main() {
url := "http://localhost:7242/api/v1/categories"
body := strings.NewReader(`{
"image": "",
"label": "{\"name\":\"Beverages\"}",
"cid": "1"
}`)
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/categories"
body = {
"image": "",
"label": "{\"name\":\"Beverages\"}",
"cid": "1"
}
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"
}
}{
"status_code": 400,
"success": false,
"message": "Failed to add category",
"error": {
"code": "CATEGORY_ADD_ERROR",
"message": "Failed to add category"
}
}{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string"
}
]
}Get a category by id
Retrieve a category by its category id.
Path Parameters
cidRequiredCidResponse Body
Successful Response
imagestring | null | nulllabelLabelCategory label json.
"{}"cidstring | null | nullCategory not found.
Validation Error
detailDetailcurl -X GET "http://localhost:7242/api/v1/categories/string"fetch("http://localhost:7242/api/v1/categories/string")package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "http://localhost:7242/api/v1/categories/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/categories/string"
response = requests.request("GET", url)
print(response.text){
"image": "",
"label": "{\"name\":\"Beverages\"}",
"cid": "1"
}{
"status_code": 404,
"success": false,
"message": "Category not found.",
"error": {
"code": "CATEGORY_NOT_FOUND",
"message": "Category not found."
}
}{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string"
}
]
}Update a category
Update category fields by category id.
Request Body
application/jsonRequiredimagestring | null | nulllabelstring | null | nullPath Parameters
cidRequiredCidResponse 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 | nullFailed to update category
Validation Error
detailDetailcurl -X PATCH "http://localhost:7242/api/v1/categories/string" \
-H "Content-Type: application/json" \
-d '{
"image": "",
"label": "{\"name\":\"Beverages\"}"
}'const body = JSON.stringify({
"image": "",
"label": "{\"name\":\"Beverages\"}"
})
fetch("http://localhost:7242/api/v1/categories/string", {
body
})package main
import (
"fmt"
"net/http"
"io/ioutil"
"strings"
)
func main() {
url := "http://localhost:7242/api/v1/categories/string"
body := strings.NewReader(`{
"image": "",
"label": "{\"name\":\"Beverages\"}"
}`)
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/categories/string"
body = {
"image": "",
"label": "{\"name\":\"Beverages\"}"
}
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"
}
}{
"status_code": 400,
"success": false,
"message": "Failed to update category",
"error": {
"code": "CATEGORY_UPDATE_ERROR",
"message": "Failed to update category"
}
}{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string"
}
]
}Delete a category
Delete a category by category id.
Path Parameters
cidRequiredCidResponse 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 | nullFailed to delete category
Validation Error
detailDetailcurl -X DELETE "http://localhost:7242/api/v1/categories/string"fetch("http://localhost:7242/api/v1/categories/string")package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "http://localhost:7242/api/v1/categories/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/categories/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"
}
}{
"status_code": 400,
"success": false,
"message": "Failed to delete category",
"error": {
"code": "CATEGORY_DELETE_ERROR",
"message": "Failed to delete category"
}
}{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string"
}
]
}