Say which organisation a grant was for
const url = 'https://api.sloose.com/auth/zoho/connect/choose';const options = { method: 'POST', headers: {'Content-Type': 'application/x-www-form-urlencoded'}, body: new URLSearchParams({nonce: 'example', host: 'standard', address: '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 https://api.sloose.com/auth/zoho/connect/choose \ --header 'Content-Type: application/x-www-form-urlencoded' \ --data nonce=example \ --data host=standard \ --data address=exampleThe form on the page the connect callback shows when nothing says which organisation the person picked on Zoho’s screen. nonce names the waiting grant — ten minutes, stored hashed — and the options route says which question it waits on.
ask: host — two of Zoho’s hosts answered for a new grant: host is the answer, one use.
ask: organisation — Zoho said no organisation, and its hosts answered for the person’s default one instead: address is the CRM’s address (or its organisation id), and each host is asked for that organisation by name. One answering completes the grant; two answering turns the question into ask: host on the same nonce; none sends the page back to /connect/choose with error (not_that_org, no_answer, address_unread, or — where Zoho turned the question away for its rate — day_spent when the CRM’s API credits for the last 24 hours are spent and too_many_calls when too many were being made at once), the grant still waiting for another try.
The grant then completes exactly as the callback would have: with the popup page inside a CRM tab, or back to the page it started on outside one. host: cancel sends it back to Zoho to revoke instead, and when Zoho does not confirm that, the answer says where the person removes Sloose themselves.
You never call this directly.
Request Bodyrequired
Section titled “Request Bodyrequired”object
Which host the person chose, or cancel: nothing is connected, the waiting grant is sent back to Zoho to revoke, and the page the connect began on is told so (#730) — and told where to remove Sloose by hand when Zoho did not confirm the revoke. Absent when address answers instead.
For a grant whose organisation Zoho did not say (ask: organisation from the options route): the CRM’s address as the person’s browser shows it — Zoho CRM’s, or a sandbox’s, carrying /org<id>/ — or the organisation id alone. Each of Zoho’s hosts is asked for that organisation by name: one answering connects it; two answering asks which host, on the same page; none sends the page back to try again, the grant still waiting until its ten minutes run out.
Responses
Section titled “Responses”A small HTML page that posts the outcome to window.opener and closes itself. Not a JSON API.
Started outside a CRM tab: back to the page it began on, with ?connected=<id> or ?connect_error=<why>.
A small HTML page that posts the outcome to window.opener and closes itself. Not a JSON API.
A small HTML page that posts the outcome to window.opener and closes itself. Not a JSON API.
A small HTML page that posts the outcome to window.opener and closes itself. Not a JSON API.
A small HTML page that posts the outcome to window.opener and closes itself. Not a JSON API.
The restore switch is on (code: MAINTENANCE): every route but /health and /robots.txt is refused before anything is read, except the operator’s own POST /staff/people/{id}/delete with the ADMIN_TOKEN. Sloose is down for maintenance. Please try again in a few minutes.
object
Example
{ "code": "MAINTENANCE"}Headers
Section titled “Headers”Seconds until asking again is worth it (300 while the switch is on).