Skip to content

Ask the user to approve a site, ahead of any call

OpenAPI JSON
POST
/requests
curl --request POST \
--url https://api.eu.apigami.com/requests \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "user_ref": "usr_3f9c1a0e7b2d4c58a61e9f0b2d7c4e13", "install_ref": "ins_8b1e4f2a9c3d4e5f8a7b6c5d4e3f2a1b", "targetDomain": "example.com" }'

Opens the approval window for (your service, targetDomain) in a browser of the user named by user_ref, the one install_ref names or the one a call would use, unless the user already answered for that domain: approved, 200 with granted true and no window; refused, 403 no grant. Otherwise 200 means it is on screen; the answer is not returned here — the next call tells.

Media typeapplication/json
object
user_ref
required

The user, as POST /connect/token returned it. The same for every app of your team; another team sees another value.

string
<= 200 characters
install_ref

Optional: one browser of that user, as POST /connect/token or GET /v1/users/{user_ref}/installs returned it. Named, that browser is never replaced by another; left out, Apigami takes the most recently active browser of the user that can reach the site.

string | null
<= 200 characters
targetDomain
required

A bare host name, e.g. example.com. The site the user approved; subdomains are covered.

string

The window is on screen, or the domain was already approved (granted true, no window).

Media typeapplication/json
object
ok
required
granted

Present and true when the user had already approved this domain; nothing was shown.

boolean
Examples
{
"ok": true
}

Malformed request.

Media typeapplication/json
object
error
required
string
consentPending

Present and true when the approval window is open and the user has not answered within 45 s.

boolean
Example
{
"error": "targetDomain is required"
}

Missing, malformed or revoked API key.

Media typeapplication/json
object
error
required
string
consentPending

Present and true when the approval window is open and the user has not answered within 45 s.

boolean
Example
{
"error": "bad client credentials"
}

Not allowed: the team has no active member, the user is not connected to this app, Apigami disabled their account, they left the team of your private app, install_ref is not one of this user’s browsers, or the user already refused this domain (no window opens).

Media typeapplication/json
object
error
required
string
consentPending

Present and true when the approval window is open and the user has not answered within 45 s.

boolean
Examples
{
"error": "no grant"
}

The user_ref is not one of your team’s.

Media typeapplication/json
object
error
required
string
consentPending

Present and true when the approval window is open and the user has not answered within 45 s.

boolean
Example
{
"error": "unknown user_ref"
}

No browser of the user can show the window: none is attached, or several are online and none is named.

Media typeapplication/json
object
error
required
string
consentPending

Present and true when the approval window is open and the user has not answered within 45 s.

boolean
Example
{
"error": "no browser is attached to this user"
}

That browser cannot be reached. extension offline: the browser holds no connection right now. extension outdated: Apigami in that browser must be updated before it can connect again; Chrome installs the update on its own, and restarting Chrome applies it sooner.

Media typeapplication/json
object
error
required
string
consentPending

Present and true when the approval window is open and the user has not answered within 45 s.

boolean
Examples
{
"error": "extension offline"
}