Revoke a phone
DELETE
/devices/{id}
const url = 'http://127.0.0.1:7700/api/devices/d4e5f6a7b8c';const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request DELETE \ --url http://127.0.0.1:7700/api/devices/d4e5f6a7b8c \ --header 'Authorization: Bearer <token>'Owner only. The phone’s token stops working at once. Its next request gets 401. POST /pair/devices/{id}/revoke does the same.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”id
required
string
Example
d4e5f6a7b8cResponses
Section titled “Responses”The device is revoked.
Media typeapplication/json
object
id
required
string
revoked
required
boolean
Example
{ "revoked": true}The owner’s route, called by someone who is not the box’s own screen or a device paired as the owner.
Media typeapplication/json
object
error
required
What went wrong
string
Example
{ "error": "only the box's own screen or the owner's paired device can do this"}No device with this id.
Media typeapplication/json
object
error
required
What went wrong
string
Example generated
{ "error": "example"}GurtOS is open source under the Apache License 2.0.Source code on GitHub.