Jump to content

TuCloudAPI authpoll

From Wiki 7Kas

TuCloudAPI function to manage FuturePBX (the cloud PBX). Available to: SuperRoot, Operator, Client.

Description

Has the user authorized the magic link? PUBLIC, like authrequest. Until then, returns magiclogin's own status: pending (no decision yet), or the terminal denied (the user refused on the link page), expired and consumed. On success it creates the session, sets the HttpOnly+Secure+SameSite=Strict cookie and returns the context the SPA hydrates from. The response carries NO token and NO ukey: the id is in the cookie, and the tenant key never leaves this service. The identity is the PBX administrator (kind pbx) or, with the tucloud_login search, the sec_user the e-mail belongs to (kind user).

Call

https://tucloudapi.7kas.com:9087/tucloud?func=authpoll&ukey=YOUR_KEY

GET, or POST with the parameters form-urlencoded in the body. Requires the ukey parameter.

Parameters

Parameter Type Required Default Meaning
session_code string Yes — The code returned by authrequest.

Example

https://tucloudapi.7kas.com:9087/tucloud?func=authpoll&session_code=XXXX

Response

{ok, status, remaining} for pending, denied, expired and consumed; on success {ok, pbx, pbx_id, root, admin_ext_id, identity, is_admin, idle_timeout, identity_kind ("pbx" | "user"), login (the e-mail typed, or the sec_users login), name, priv_admin, profiles [{_id, description}], sections [nav ids the session may use; all 25 for kind pbx]} plus Set-Cookie.


Back to TuCloudAPI