送出機械人樣本(beta)
Beta
POST
/v1/robots/raw/samples
const url = 'https://api.example.yas/v1/robots/raw/samples';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"partnerId":"partner","schemaVersion":"2026-11","sourceSystem":"partner-export","records":[{"robotId":"rbt_example","recordedAt":"2026-10-15T10:00:05.000Z","timezone":"Asia/Hong_Kong","label":"dock_camera","payload":{"note":"glare"}}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.example.yas/v1/robots/raw/samples \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "partnerId": "partner", "schemaVersion": "2026-11", "sourceSystem": "partner-export", "records": [ { "robotId": "rbt_example", "recordedAt": "2026-10-15T10:00:05.000Z", "timezone": "Asia/Hong_Kong", "label": "dock_camera", "payload": { "note": "glare" } } ] }'Beta。用 server key 送出 1 至 100 筆樣本。每筆要有 robotId、recordedAt、timezone 與 label。payload 可省略,送出後按原樣保存。這台機械人必須已存在於這個 partnerId。未知的 robotId 是 404,這次什麼都不會存。清單是空的或缺欄位是 400。超過 100 筆是 413。這些紀錄沒有 id。再送會多存一列。accepted 等於紀錄筆數。
Authorizations
小節:AuthorizationsRequest Bodyrequired
小節:Request BodyrequiredMedia typeapplication/json
object
partnerId
required
合作夥伴 id。必須與 server key 相符。
string
schemaVersion
required
這次內容的 schema 版本。例子:2026-11。
string
sourceSystem
required
送出這次內容的系統名稱。例子:partner-export。
string
records
required
這次呼叫的其他樣本。送 1 至 100 筆。
Array<object>
object
robotId
required
機械人 id。這台機械人必須已經存在。
string
recordedAt
required
取這個樣本的時間,ISO-8601。
string format: date-time
timezone
required
IANA 時區。例子:Asia/Hong_Kong。
string
label
required
合作夥伴給這個樣本的名稱。
string
payload
這個樣本的額外欄位。按送出的內容保存。
object
key
additional properties
any
Example
{ "partnerId": "partner", "schemaVersion": "2026-11", "sourceSystem": "partner-export", "records": [ { "robotId": "rbt_example", "recordedAt": "2026-10-15T10:00:05.000Z", "timezone": "Asia/Hong_Kong", "label": "dock_camera", "payload": { "note": "glare" } } ]}Responses
小節:Responses200
小節:200樣本已保存。accepted 等於紀錄筆數。
Media typeapplication/json
object
accepted
required
integer
Example
{ "accepted": 1}400清單是空的,或缺必填欄位。什麼都不會存。
Media typeapplication/json
object
error
required
穩定的錯誤代碼。沒有 stack trace。
string
Example
{ "error": "invalid_body"}401沒有 server key,或 server key 不正確。
Media typeapplication/json
object
error
required
穩定的錯誤代碼。沒有 stack trace。
string
Example
{ "error": "invalid_credentials"}403server key 可以只限車輛、只限機械人,或兩者都可以。超出範圍的呼叫是 403 `forbidden`,而且不會保存。`identity_mismatch` 表示 `partnerId` 與 server key 不符。
Media typeapplication/json
object
error
required
穩定的錯誤代碼。沒有 stack trace。
string
Example
{ "error": "forbidden"}404未知的 `robotId`。這次什麼都不會存。
Media typeapplication/json
object
error
required
穩定的錯誤代碼。沒有 stack trace。
string
Example
{ "error": "not_found"}413超過 100 筆紀錄。什麼都不會存。
Media typeapplication/json
object
error
required
穩定的錯誤代碼。沒有 stack trace。
string
Example
{ "error": "payload_too_large"}