Read the outcome of a mailbox connection
GET
/emails/{email_provider}/oauth/result
const url = 'https://api.clearance.rest/emails/gmail/oauth/result?token=example';const options = {method: 'GET', headers: {'X-API-Key': '<X-API-Key>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://api.clearance.rest/emails/gmail/oauth/result?token=example' \ --header 'X-API-Key: <X-API-Key>'Single use: the token is consumed by the first read and expires 10 minutes after the browser returned. A failed connection is a successful read with status: failed and an error code.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”email_provider
required
string
Email provider that can be connected with OAuth.
Query Parameters
Section titled “Query Parameters”token
required
string
The result_token from the return_url.
Responses
Section titled “Responses”Default Response
Media typeapplication/json
object
Example
{ "success": true, "status": "connected", "email_provider": "gmail"}Default Response
Media typeapplication/json
Error envelope returned by every JSON endpoint.
object
success
required
boolean
error
required
object
code
required
Machine-readable error code (snake_case).
string
message
required
Human-readable message.
string
details
Extra context for the error.
object
key
additional properties
Example
{ "success": false}Default Response
Media typeapplication/json
Error envelope returned by every JSON endpoint.
object
success
required
boolean
error
required
object
code
required
Machine-readable error code (snake_case).
string
message
required
Human-readable message.
string
details
Extra context for the error.
object
key
additional properties
Example
{ "success": false}Default Response
Media typeapplication/json
Error envelope returned by every JSON endpoint.
object
success
required
boolean
error
required
object
code
required
Machine-readable error code (snake_case).
string
message
required
Human-readable message.
string
details
Extra context for the error.
object
key
additional properties
Example
{ "success": false}