Sign the web app in with a link code
POST
/api/v1/auth/web-link
const url = 'http://localhost:8080/api/v1/auth/web-link';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"code":"example","device":"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://localhost:8080/api/v1/auth/web-link \ --header 'Content-Type: application/json' \ --data '{ "code": "example", "device": "example" }'Trades a code from POST /api/v1/me/web-link for a session of its own. Each code works once.
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
code
required
string
device
A label for this session, such as “Chek on the web”.
string
Example generated
{ "code": "example", "device": "example"}Responses
Section titled “Responses”Signed in.
Media typeapplication/json
object
token
required
Send as Authorization: Bearer <token>.
string
user
required
object
id
required
integer format: int64
name
required
string
role
required
string
libraryIds
required
Libraries a reader may open. Empty for admins, who see every library.
Array<integer>
createdAt
required
string format: date-time
demo
True on /api/v1/me for a shared demo account, which can’t change its settings. Absent otherwise.
boolean
Example
{ "user": { "role": "admin" }}The request was malformed.
Media typeapplication/json
object
code
required
string
message
required
Explains the problem to a developer.
string
Example
{ "code": "bad_request"}The server failed; details are in its log.
Media typeapplication/json
object
code
required
string
message
required
Explains the problem to a developer.
string
Example
{ "code": "bad_request"}