Robot Dokümantasyonu

Görev API

Robot görevlerini oluşturun, güncelleyin ve yönetin.

Tüm görevlerin listesini alma

Robotun tüm görevlerinin listesini döndürür. Bu uç nokta, tüm görevleri ID, hedef ve durum gibi ayrıntılarıyla birlikte döndürür.

GET
/tasks

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 Tasks Api V1 Tasks Get
curl -X GET "https://robots.saharobotik.com/api/v1/YOUR_ROBOT_ID/robot/tasks" \
  -H "x-api-key: <token>"
fetch("https://robots.saharobotik.com/api/v1/YOUR_ROBOT_ID/robot/tasks", {
  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/tasks"

  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/tasks"

response = requests.request("GET", url, headers = {
  "x-api-key": "<token>"
})

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
    ]
  }
]

Görev oluşturma veya güncelleme ve listeyi sıralama

Yeni bir görev oluşturur veya mevcut bir görevi günceller. Bu uç nokta ile hedef UID'si olan bir görev ekleyebilir ve görev listesini sıralayabilirsiniz. Görev, görev bilgisine (mission info) eklenir ve görev ID'sine göre sıralanır.

POST
/tasks

Authorization

x-api-key<token>

Robotun projesinde Robot Gateway Client rolü olan bir istemcinin API anahtarı

In: header

Request Body

application/jsonRequired
timeoutTimeout

Görevin başlamasını bekleme süresi sınırı (saniye).

Default: 0
typeRequiredType

Görevin türü (ör. 'TABLE_SERVICE', 'DISH', 'CELEBRATING').

activateRequiredActivate

Görevin etkinleştirilip etkinleştirilmeyeceğini belirtir.

task_indexTask Index

Varsa görevin görev listesindeki sırası.

Default: 0
target_uidRequiredTarget Uid

Görevin atandığı hedefin benzersiz tanımlayıcısı.

Minimum length: 1
payloadPayload

Varsa görevde kullanılacak yüklerin (payload) listesi.

celebrating_nameCelebrating Name

Varsa kutlanacak kişinin adı.

Default: ""

Response Body

Başarılı yanıt

status_codeStatus Code

Yanıtın HTTP durum kodu.

Default: 200
successSuccess

İşlemin başarılı olup olmadığını belirtir.

Default: true
messageMessage

İşlem hakkında ek bilgi veren mesaj.

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

Doğrulama hatası

detailDetail
curl -X POST "https://robots.saharobotik.com/api/v1/YOUR_ROBOT_ID/robot/tasks" \
  -H "x-api-key: <token>" \
  -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("https://robots.saharobotik.com/api/v1/YOUR_ROBOT_ID/robot/tasks", {
  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/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("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/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 = {
  "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"
  }
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}

Belirli bir görevi ID'ye göre alma

Belirli bir görevi ID'sine göre döndürür. Görev varsa bilgilerini döndürür, yoksa 404 hatası verir.

GET
/tasks/{task_uid}

Authorization

x-api-key<token>

Robotun projesinde Robot Gateway Client rolü olan bir istemcinin API anahtarı

In: header

Path Parameters

task_uidRequiredTask Uid

Response Body

Başarılı yanıt

idRequiredId

Görevin benzersiz tanımlayıcısı.

uidRequiredUid

Görevin benzersiz tanımlayıcısı, id ile aynı.

siteRequiredSite

Görevin yapıldığı site.

floorRequiredFloor

Görevin yapıldığı kat.

task_typeRequiredTask Type

Görevin türü (ör. 'TABLE_SERVICE', 'DISH', 'CELEBRATING').

task_indexTask Index

Varsa görevin görev listesindeki sırası.

Default: 0
successRequiredSuccess

Görevin başarıyla başlatılıp başlatılmadığını belirtir.

completedRequiredCompleted

Görevin başarıyla tamamlanıp tamamlanmadığını belirtir.

messageRequiredMessage

Görev durumu hakkında ek bilgi veren mesaj.

targetTargetModel

Robotun gittiği hedef.

create_timeRequiredCreate Time

Görevin oluşturulduğu zaman damgası.

celebrating_nameCelebrating Name

Varsa kutlanacak kişinin adı.

Default: ""
payloadPayload

Varsa görevde hangi tepsinin veya yükün (payload) kullanıldığı.

Belirtilen ID için görev bulunamadı.

Doğrulama hatası

detailDetail
curl -X GET "https://robots.saharobotik.com/api/v1/YOUR_ROBOT_ID/robot/tasks/string" \
  -H "x-api-key: <token>"
fetch("https://robots.saharobotik.com/api/v1/YOUR_ROBOT_ID/robot/tasks/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/tasks/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/tasks/string"

response = requests.request("GET", url, headers = {
  "x-api-key": "<token>"
})

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"
    }
  ]
}

Belirli bir görevi ID'ye göre güncelleme

Belirli bir görevi ID'sine göre günceller. Bu uç nokta ile görevin hedef UID'sini ve diğer ayrıntılarını değiştirebilirsiniz. Görev, görev bilgisinde (mission info) güncellenir ve görev ID'sine göre sıralanır.

PATCH
/tasks/{task_uid}

Authorization

x-api-key<token>

Robotun projesinde Robot Gateway Client rolü olan bir istemcinin API anahtarı

In: header

Request Body

application/jsonRequired
timeoutTimeout

Görevin başlamasını bekleme süresi sınırı (saniye).

Default: 0
typeRequiredType

Görevin türü (ör. 'TABLE_SERVICE', 'DISH', 'CELEBRATING').

activateRequiredActivate

Görevin etkinleştirilip etkinleştirilmeyeceğini belirtir.

task_indexTask Index

Varsa görevin görev listesindeki sırası.

Default: 0
target_uidRequiredTarget Uid

Görevin atandığı hedefin benzersiz tanımlayıcısı.

Minimum length: 1
payloadPayload

Varsa görevde kullanılacak yüklerin (payload) listesi.

celebrating_nameCelebrating Name

Varsa kutlanacak kişinin adı.

Default: ""

Path Parameters

task_uidRequiredTask Uid

Response Body

Başarılı yanıt

status_codeStatus Code

Yanıtın HTTP durum kodu.

Default: 200
successSuccess

İşlemin başarılı olup olmadığını belirtir.

Default: true
messageMessage

İşlem hakkında ek bilgi veren mesaj.

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

Doğrulama hatası

detailDetail
curl -X PATCH "https://robots.saharobotik.com/api/v1/YOUR_ROBOT_ID/robot/tasks/string" \
  -H "x-api-key: <token>" \
  -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("https://robots.saharobotik.com/api/v1/YOUR_ROBOT_ID/robot/tasks/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/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("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/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 = {
  "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"
  }
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}

Belirli bir görevi ID'ye göre silme

Belirli bir görevi ID'sine göre siler. Bu uç nokta ile bir görevi robotun görev bilgisinden (mission info) kaldırabilirsiniz. Görev listeden çıkarılır ve görev sayısı güncellenir.

DELETE
/tasks/{task_uid}

Authorization

x-api-key<token>

Robotun projesinde Robot Gateway Client rolü olan bir istemcinin API anahtarı

In: header

Path Parameters

task_uidRequiredTask Uid

Response Body

Başarılı yanıt

status_codeStatus Code

Yanıtın HTTP durum kodu.

Default: 200
successSuccess

İşlemin başarılı olup olmadığını belirtir.

Default: true
messageMessage

İşlem hakkında ek bilgi veren mesaj.

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

Doğrulama hatası

detailDetail
curl -X DELETE "https://robots.saharobotik.com/api/v1/YOUR_ROBOT_ID/robot/tasks/string" \
  -H "x-api-key: <token>"
fetch("https://robots.saharobotik.com/api/v1/YOUR_ROBOT_ID/robot/tasks/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/tasks/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/tasks/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"
  }
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}

Robotu duraklatma

Robotun mevcut görevini duraklatır. Bu uç nokta, bir duraklatma mesajı yayınlayarak robotun mevcut görevini duraklatmanızı sağlar.

POST
/tasks/pause

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

status_codeStatus Code

Yanıtın HTTP durum kodu.

Default: 200
successSuccess

İşlemin başarılı olup olmadığını belirtir.

Default: true
messageMessage

İşlem hakkında ek bilgi veren mesaj.

Default: ""
dataobject | null | null
errorobject | null | null
curl -X POST "https://robots.saharobotik.com/api/v1/YOUR_ROBOT_ID/robot/tasks/pause" \
  -H "x-api-key: <token>"
fetch("https://robots.saharobotik.com/api/v1/YOUR_ROBOT_ID/robot/tasks/pause", {
  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/tasks/pause"

  req, _ := http.NewRequest("POST", 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/tasks/pause"

response = requests.request("POST", 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"
  }
}

Robotu devam ettirme

Robotun duraklatılmış görevini devam ettirir. Bu uç nokta, bir devam mesajı yayınlayarak robotun görevini devam ettirmenizi sağlar.

POST
/tasks/resume

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

status_codeStatus Code

Yanıtın HTTP durum kodu.

Default: 200
successSuccess

İşlemin başarılı olup olmadığını belirtir.

Default: true
messageMessage

İşlem hakkında ek bilgi veren mesaj.

Default: ""
dataobject | null | null
errorobject | null | null
curl -X POST "https://robots.saharobotik.com/api/v1/YOUR_ROBOT_ID/robot/tasks/resume" \
  -H "x-api-key: <token>"
fetch("https://robots.saharobotik.com/api/v1/YOUR_ROBOT_ID/robot/tasks/resume", {
  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/tasks/resume"

  req, _ := http.NewRequest("POST", 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/tasks/resume"

response = requests.request("POST", 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"
  }
}

Robotun görev listesindeki tüm görevleri temizleme

Robotun görev listesindeki tüm görevleri temizler. Bu uç nokta ile robotun görev bilgisindeki (mission info) tüm görevleri kaldırarak görev listesini sıfırlayabilirsiniz.

POST
/tasks/clear

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

status_codeStatus Code

Yanıtın HTTP durum kodu.

Default: 200
successSuccess

İşlemin başarılı olup olmadığını belirtir.

Default: true
messageMessage

İşlem hakkında ek bilgi veren mesaj.

Default: ""
dataobject | null | null
errorobject | null | null
curl -X POST "https://robots.saharobotik.com/api/v1/YOUR_ROBOT_ID/robot/tasks/clear" \
  -H "x-api-key: <token>"
fetch("https://robots.saharobotik.com/api/v1/YOUR_ROBOT_ID/robot/tasks/clear", {
  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/tasks/clear"

  req, _ := http.NewRequest("POST", 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/tasks/clear"

response = requests.request("POST", 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"
  }
}