完成機械人地圖(beta)
const url = 'https://api.example.yas/v1/robots/maps/complete';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"partnerId":"partner","schemaVersion":"2026-11","sourceSystem":"partner-export","robotId":"rbt_example","mapId":"map_1"}'};
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/maps/complete \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "partnerId": "partner", "schemaVersion": "2026-11", "sourceSystem": "partner-export", "robotId": "rbt_example", "mapId": "map_1" }'Beta。完成後,地圖才會生效。請送 partnerId、schemaVersion、sourceSystem、robotId 與 mapId。請先把位元組 PUT 到簽發的網址。未知的 robotId 或地圖是 404。第一次 complete 會回傳 status ready,以及 ISO-8601 UTC 的 updatedAt。地圖已經生效時再呼叫,是 200,status 是 ready,而且沒有 updatedAt。 須於簽發後 24 小時內 complete。未收到上傳是 409 upload_incomplete;大小或類型不符是 422 invalid_media。上傳憑證可能先於 complete 期限失效;已上傳的有效物件仍可 complete。物件不能覆寫,內容不符時請重新簽發。
Authorizations
小節:AuthorizationsRequest Bodyrequired
小節:Request Bodyrequiredobject
合作夥伴 id。必須與 server key 相符。
這次內容的 schema 版本。例子:2026-11。
送出這次內容的系統名稱。例子:partner-export。
機械人 id。這台機械人必須已經存在。
簽發時的地圖 id。complete 成功後,目前使用的地圖才會更換。
Example
{ "partnerId": "partner", "schemaVersion": "2026-11", "sourceSystem": "partner-export", "robotId": "rbt_example", "mapId": "map_1"}Responses
小節:Responses200
小節:200地圖已生效。status 是 ready。第一次 complete 的 updatedAt 是 ISO-8601 UTC。地圖已經生效時再呼叫,是 200,status 是 ready,而且沒有 updatedAt。
object
ready 表示地圖已生效。
第一次 complete 的 ISO-8601 UTC。地圖已經生效時再呼叫,不會有這個欄位。
Example
{ "robotId": "rbt_example", "mapId": "map_1", "status": "ready", "updatedAt": "2026-10-15T10:00:00.000Z"}400缺少必填欄位。
object
穩定的錯誤代碼。沒有 stack trace。
Example
{ "error": "invalid_body"}401沒有 server key,或 server key 不正確。
object
穩定的錯誤代碼。沒有 stack trace。
Example
{ "error": "invalid_credentials"}403server key 可以只限車輛、只限機械人,或兩者都可以。超出範圍的呼叫是 403 `forbidden`,而且不會保存。`identity_mismatch` 表示 `partnerId` 與 server key 不符。
object
穩定的錯誤代碼。沒有 stack trace。
Example
{ "error": "forbidden"}404未知的 `robotId` 或地圖。什麼都不會存。
object
穩定的錯誤代碼。沒有 stack trace。
Example
{ "error": "not_found"}409尚未有完整物件。請在憑證失效前上傳,然後重試 complete。
object
穩定的錯誤代碼。沒有 stack trace。
Example
{ "error": "upload_incomplete"}41024 小時 complete 期限已過。請重新簽發;之前 ready 的地圖維持不變。
object
穩定的錯誤代碼。沒有 stack trace。
Example
{ "error": "upload_expired"}422上傳物件與宣告的大小或類型不符。請重新簽發並上傳正確內容;物件不能覆寫。
object
穩定的錯誤代碼。沒有 stack trace。
Example
{ "error": "invalid_media"}503Storage 或必要設定暫時無法使用。請按 Retry-After 指定時間重試。
object
穩定的錯誤代碼。沒有 stack trace。
Example
{ "error": "unavailable"}