Kategoriler API
Robot hedeflerini düzenlemek ve sınıflandırmak için hedef kategorilerini yönetin.
Kategorilerin listesini alma
Robot için yapılandırılmış tüm kategorileri döndürür.
Authorization
x-api-key<token>Robotun projesinde Robot Gateway Client rolü olan bir istemcinin API anahtarı
In: header
Response Body
Başarılı yanıt
responseRequiredResponse Get Categories Api V1 Categories Getcurl -X GET "https://robots.saharobotik.com/api/v1/YOUR_ROBOT_ID/robot/categories" \
-H "x-api-key: <token>"fetch("https://robots.saharobotik.com/api/v1/YOUR_ROBOT_ID/robot/categories", {
headers: {
"x-api-key": "<token>"
}
})package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://robots.saharobotik.com/api/v1/YOUR_ROBOT_ID/robot/categories"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}import requests
url = "https://robots.saharobotik.com/api/v1/YOUR_ROBOT_ID/robot/categories"
response = requests.request("GET", url, headers = {
"x-api-key": "<token>"
})
print(response.text)[
{
"image": "",
"label": "{\"name\":\"Beverages\"}",
"cid": "1"
}
]Robota yeni kategori ekleme
Robotun yapılandırmasına yeni bir kategori ekler.
Authorization
x-api-key<token>Robotun projesinde Robot Gateway Client rolü olan bir istemcinin API anahtarı
In: header
Request Body
application/jsonRequiredimagestring | null | nulllabelLabelKategori etiketi JSON'u.
"{}"cidstring | null | nullResponse Body
Başarılı yanıt
status_codeStatus CodeYanıtın HTTP durum kodu.
200successSuccessİşlemin başarılı olup olmadığını belirtir.
truemessageMessageİşlem hakkında ek bilgi veren mesaj.
""dataobject | null | nullerrorobject | null | nullKategori eklenemedi
Doğrulama hatası
detailDetailcurl -X POST "https://robots.saharobotik.com/api/v1/YOUR_ROBOT_ID/robot/categories" \
-H "x-api-key: <token>" \
-H "Content-Type: application/json" \
-d '{
"image": "",
"label": "{\"name\":\"Beverages\"}",
"cid": "1"
}'const body = JSON.stringify({
"image": "",
"label": "{\"name\":\"Beverages\"}",
"cid": "1"
})
fetch("https://robots.saharobotik.com/api/v1/YOUR_ROBOT_ID/robot/categories", {
headers: {
"x-api-key": "<token>"
},
body
})package main
import (
"fmt"
"net/http"
"io/ioutil"
"strings"
)
func main() {
url := "https://robots.saharobotik.com/api/v1/YOUR_ROBOT_ID/robot/categories"
body := strings.NewReader(`{
"image": "",
"label": "{\"name\":\"Beverages\"}",
"cid": "1"
}`)
req, _ := http.NewRequest("POST", url, body)
req.Header.Add("x-api-key", "<token>")
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 = "https://robots.saharobotik.com/api/v1/YOUR_ROBOT_ID/robot/categories"
body = {
"image": "",
"label": "{\"name\":\"Beverages\"}",
"cid": "1"
}
response = requests.request("POST", url, json = body, headers = {
"x-api-key": "<token>",
"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"
}
]
}Bir kategoriyi ID'ye göre alma
Bir kategoriyi kategori ID'sine göre döndürür.
Authorization
x-api-key<token>Robotun projesinde Robot Gateway Client rolü olan bir istemcinin API anahtarı
In: header
Path Parameters
cidRequiredCidResponse Body
Başarılı yanıt
imagestring | null | nulllabelLabelKategori etiketi JSON'u.
"{}"cidstring | null | nullKategori bulunamadı.
Doğrulama hatası
detailDetailcurl -X GET "https://robots.saharobotik.com/api/v1/YOUR_ROBOT_ID/robot/categories/string" \
-H "x-api-key: <token>"fetch("https://robots.saharobotik.com/api/v1/YOUR_ROBOT_ID/robot/categories/string", {
headers: {
"x-api-key": "<token>"
}
})package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://robots.saharobotik.com/api/v1/YOUR_ROBOT_ID/robot/categories/string"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}import requests
url = "https://robots.saharobotik.com/api/v1/YOUR_ROBOT_ID/robot/categories/string"
response = requests.request("GET", url, headers = {
"x-api-key": "<token>"
})
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"
}
]
}Kategori güncelleme
Kategori alanlarını kategori ID'sine göre günceller.
Authorization
x-api-key<token>Robotun projesinde Robot Gateway Client rolü olan bir istemcinin API anahtarı
In: header
Request Body
application/jsonRequiredimagestring | null | nulllabelstring | null | nullPath Parameters
cidRequiredCidResponse Body
Başarılı yanıt
status_codeStatus CodeYanıtın HTTP durum kodu.
200successSuccessİşlemin başarılı olup olmadığını belirtir.
truemessageMessageİşlem hakkında ek bilgi veren mesaj.
""dataobject | null | nullerrorobject | null | nullKategori güncellenemedi
Doğrulama hatası
detailDetailcurl -X PATCH "https://robots.saharobotik.com/api/v1/YOUR_ROBOT_ID/robot/categories/string" \
-H "x-api-key: <token>" \
-H "Content-Type: application/json" \
-d '{
"image": "",
"label": "{\"name\":\"Beverages\"}"
}'const body = JSON.stringify({
"image": "",
"label": "{\"name\":\"Beverages\"}"
})
fetch("https://robots.saharobotik.com/api/v1/YOUR_ROBOT_ID/robot/categories/string", {
headers: {
"x-api-key": "<token>"
},
body
})package main
import (
"fmt"
"net/http"
"io/ioutil"
"strings"
)
func main() {
url := "https://robots.saharobotik.com/api/v1/YOUR_ROBOT_ID/robot/categories/string"
body := strings.NewReader(`{
"image": "",
"label": "{\"name\":\"Beverages\"}"
}`)
req, _ := http.NewRequest("PATCH", url, body)
req.Header.Add("x-api-key", "<token>")
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 = "https://robots.saharobotik.com/api/v1/YOUR_ROBOT_ID/robot/categories/string"
body = {
"image": "",
"label": "{\"name\":\"Beverages\"}"
}
response = requests.request("PATCH", url, json = body, headers = {
"x-api-key": "<token>",
"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"
}
]
}Kategori silme
Bir kategoriyi kategori ID'sine göre siler.
Authorization
x-api-key<token>Robotun projesinde Robot Gateway Client rolü olan bir istemcinin API anahtarı
In: header
Path Parameters
cidRequiredCidResponse Body
Başarılı yanıt
status_codeStatus CodeYanıtın HTTP durum kodu.
200successSuccessİşlemin başarılı olup olmadığını belirtir.
truemessageMessageİşlem hakkında ek bilgi veren mesaj.
""dataobject | null | nullerrorobject | null | nullKategori silinemedi
Doğrulama hatası
detailDetailcurl -X DELETE "https://robots.saharobotik.com/api/v1/YOUR_ROBOT_ID/robot/categories/string" \
-H "x-api-key: <token>"fetch("https://robots.saharobotik.com/api/v1/YOUR_ROBOT_ID/robot/categories/string", {
headers: {
"x-api-key": "<token>"
}
})package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://robots.saharobotik.com/api/v1/YOUR_ROBOT_ID/robot/categories/string"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("x-api-key", "<token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}import requests
url = "https://robots.saharobotik.com/api/v1/YOUR_ROBOT_ID/robot/categories/string"
response = requests.request("DELETE", url, headers = {
"x-api-key": "<token>"
})
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"
}
]
}