Trade a sign-in code for a device token
POST
/sso/redeem
const url = 'http://127.0.0.1:7700/api/sso/redeem';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"code":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url http://127.0.0.1:7700/api/sso/redeem \ --header 'Content-Type: application/json' \ --data '{ "code": "example" }'Preview. Open without a token, so the body is capped at 1 MB. The device token is bound to the person, exactly as pairing a phone for them makes one.
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
code
required
string
Example generated
{ "code": "example"}Responses
Section titled “Responses”The device token.
Media typeapplication/json
object
token
required
string
device
required
object
id
string
name
string
person
string
box
required
object
id
string
name
string
Example generated
{ "token": "example", "device": { "id": "example", "name": "example", "person": "example" }, "box": { "id": "example", "name": "example" }}The code is unknown, used or expired.
Media typeapplication/json
object
error
required
What went wrong
string
Example generated
{ "error": "example"}The sign-in was refused, or the person was removed. The message gives the reason.
Media typeapplication/json
object
error
required
What went wrong
string
Example generated
{ "error": "example"}