Python
from engini import Engini
client = Engini() # reads ENGINI_API_KEY
# state is the value returned with the sign-in URL
token = client.connections.get_access_token(state)import { Engini } from "@engini/sdk";
const client = new Engini(); // reads ENGINI_API_KEY
// state is the value returned with the sign-in URL
const token = await client.connections.getAccessToken(state);# polls the access-token endpoint, then creates the connection
engini connections oauth-complete outlook --auth 0 --state <state>const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.engini.io/v1/connections/access-token/{state}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.engini.io/v1/connections/access-token/{state}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.engini.io/v1/connections/access-token/{state}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.engini.io/v1/connections/access-token/{state}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.engini.io/v1/connections/access-token/{state}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"status": "completed",
"error_message": null,
"fieldOptions": {
"ApiVersionUrl": {
"/services/data/v60.0": "60.0",
"/services/data/v59.0": "59.0"
}
}
}{
"errorCode": "<string>",
"message": "<string>",
"requestId": "<string>",
"timestamp": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}{
"errorCode": "<string>",
"message": "<string>",
"requestId": "<string>",
"timestamp": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}{
"errorCode": "<string>",
"message": "<string>",
"requestId": "<string>",
"timestamp": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}{
"errorCode": "<string>",
"message": "<string>",
"requestId": "<string>",
"timestamp": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}{
"errorCode": "<string>",
"message": "<string>",
"requestId": "<string>",
"timestamp": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}{
"errorCode": "<string>",
"message": "<string>",
"requestId": "<string>",
"timestamp": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}Connections
Get OAuth access token
Second half of the OAuth pairing with POST /connections/get-sign-in-url. Retrieves the token data captured once the end user completes the sign-in flow for the given state. Returns a null body if the flow hasn’t completed yet - poll until a non-null response is returned, then use tokenData/connectionData to complete the connection.
GET
/
v1
/
connections
/
access-token
/
{state}
Python
from engini import Engini
client = Engini() # reads ENGINI_API_KEY
# state is the value returned with the sign-in URL
token = client.connections.get_access_token(state)import { Engini } from "@engini/sdk";
const client = new Engini(); // reads ENGINI_API_KEY
// state is the value returned with the sign-in URL
const token = await client.connections.getAccessToken(state);# polls the access-token endpoint, then creates the connection
engini connections oauth-complete outlook --auth 0 --state <state>const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.engini.io/v1/connections/access-token/{state}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.engini.io/v1/connections/access-token/{state}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.engini.io/v1/connections/access-token/{state}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.engini.io/v1/connections/access-token/{state}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.engini.io/v1/connections/access-token/{state}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"status": "completed",
"error_message": null,
"fieldOptions": {
"ApiVersionUrl": {
"/services/data/v60.0": "60.0",
"/services/data/v59.0": "59.0"
}
}
}{
"errorCode": "<string>",
"message": "<string>",
"requestId": "<string>",
"timestamp": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}{
"errorCode": "<string>",
"message": "<string>",
"requestId": "<string>",
"timestamp": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}{
"errorCode": "<string>",
"message": "<string>",
"requestId": "<string>",
"timestamp": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}{
"errorCode": "<string>",
"message": "<string>",
"requestId": "<string>",
"timestamp": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}{
"errorCode": "<string>",
"message": "<string>",
"requestId": "<string>",
"timestamp": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}{
"errorCode": "<string>",
"message": "<string>",
"requestId": "<string>",
"timestamp": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}Authorizations
BearerApiKey
Enter your JWT token
Path Parameters
The state value returned when the sign-in URL was generated.
Response
The access token data for the state, or null if no token has been captured yet.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Per-field option lists a connector can supply after sign-in, keyed by AppConnectionField.FieldName. Empty for connectors that supply none.
Show child attributes
Show child attributes