Start a connection from your server (pushed authorization request)
OpenAPI JSONconst url = 'https://api.eu.apigami.com/connect/par';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"redirect_uri":"https://example.com/apigami/callback","code_challenge":"E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM","code_challenge_method":"S256","state":"af0ifjsldkj","login_hint":"jane@example.com"}'};
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.eu.apigami.com/connect/par \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "redirect_uri": "https://example.com/apigami/callback", "code_challenge": "E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM", "code_challenge_method": "S256", "state": "af0ifjsldkj", "login_hint": "jane@example.com" }'RFC 9126. Opens the connection with your key, so no email travels in a URL, and returns the request_uri to put on https://app.apigami.com/connect?client_id={your app id}&request_uri={request_uri} within 90 seconds. Create it when the user clicks your connect button. login_hint prefills the email; for an app Apigami has allowed to vouch for its users’ emails, it also spares them the sign-in code. The user then has 30 minutes to finish, and comes back to redirect_uri with ?code&state, ?error=access_denied&state, or ?error=expired&state.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
One of your registered redirect URLs, scheme, host, port and path included. The query and the fragment may vary.
BASE64URL(SHA-256(code_verifier)), RFC 7636.
Returned unchanged on the redirect. Bind it to the user’s session.
Prefills the email on the connect page.
Example
{ "redirect_uri": "https://example.com/apigami/callback", "code_challenge": "E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM", "code_challenge_method": "S256", "state": "af0ifjsldkj", "login_hint": "jane@example.com"}Responses
Section titled “Responses”The request is registered. Send the user to the connect page with it, within expires_in seconds.
object
Example
{ "request_uri": "urn:ietf:params:oauth:request_uri:0b5c7e1a-6f0d-4d0e-9a51-2b3c4d5e6f70", "expires_in": 90}The request cannot open a connection.
object
Present and true when the approval window is open and the user has not answered within 45 s.
Examples
{ "error": "redirect_uri is not registered for this app"}{ "error": "code_challenge (S256) is required"}{ "error": "login_hint must be an email address"}Missing, malformed or revoked API key.
object
Present and true when the approval window is open and the user has not answered within 45 s.
Example
{ "error": "bad client credentials"}