from engini import Engini
client = Engini() # reads ENGINI_API_KEY
resp = client.connections.get_sign_in_url("outlook", 0)
print(resp.sign_in_url) # open this for the user; keep resp.stateimport { Engini } from "@engini/sdk";
const client = new Engini(); // reads ENGINI_API_KEY
const resp = await client.connections.getSignInUrl("outlook", 0);
console.log(resp.signInUrl); // open this for the user; keep resp.stateengini connections sign-in-url outlook --auth 0const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({applicationSlug: 'example-app', authenticationId: 1, environment: 'production'})
};
fetch('https://api.engini.io/v1/connections/get-sign-in-url', 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/get-sign-in-url",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'applicationSlug' => 'example-app',
'authenticationId' => 1,
'environment' => 'production'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.engini.io/v1/connections/get-sign-in-url"
payload := strings.NewReader("{\n \"applicationSlug\": \"example-app\",\n \"authenticationId\": 1,\n \"environment\": \"production\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.engini.io/v1/connections/get-sign-in-url")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"applicationSlug\": \"example-app\",\n \"authenticationId\": 1,\n \"environment\": \"production\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.engini.io/v1/connections/get-sign-in-url")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"applicationSlug\": \"example-app\",\n \"authenticationId\": 1,\n \"environment\": \"production\"\n}"
response = http.request(request)
puts response.read_body{
"signInUrl": "https://example.com/oauth/authorize?state=00000000-0000-0000-0000-000000000000",
"state": "00000000-0000-0000-0000-000000000000"
}{
"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>"
}
]
}Get OAuth sign-in URL
First half of the OAuth pairing with GET /connections/access-token/. Builds a sign-in URL for the given application and authentication method, along with a freshly generated opaque state value. Redirect the end user to signInUrl to authorize; once they complete the provider’s consent screen, poll the access-token endpoint with the same state to retrieve the resulting token data.
from engini import Engini
client = Engini() # reads ENGINI_API_KEY
resp = client.connections.get_sign_in_url("outlook", 0)
print(resp.sign_in_url) # open this for the user; keep resp.stateimport { Engini } from "@engini/sdk";
const client = new Engini(); // reads ENGINI_API_KEY
const resp = await client.connections.getSignInUrl("outlook", 0);
console.log(resp.signInUrl); // open this for the user; keep resp.stateengini connections sign-in-url outlook --auth 0const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({applicationSlug: 'example-app', authenticationId: 1, environment: 'production'})
};
fetch('https://api.engini.io/v1/connections/get-sign-in-url', 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/get-sign-in-url",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'applicationSlug' => 'example-app',
'authenticationId' => 1,
'environment' => 'production'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.engini.io/v1/connections/get-sign-in-url"
payload := strings.NewReader("{\n \"applicationSlug\": \"example-app\",\n \"authenticationId\": 1,\n \"environment\": \"production\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.engini.io/v1/connections/get-sign-in-url")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"applicationSlug\": \"example-app\",\n \"authenticationId\": 1,\n \"environment\": \"production\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.engini.io/v1/connections/get-sign-in-url")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"applicationSlug\": \"example-app\",\n \"authenticationId\": 1,\n \"environment\": \"production\"\n}"
response = http.request(request)
puts response.read_body{
"signInUrl": "https://example.com/oauth/authorize?state=00000000-0000-0000-0000-000000000000",
"state": "00000000-0000-0000-0000-000000000000"
}{
"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
Enter your JWT token
Body
The request describing the application, authentication method, and any provider fields.
Request body for generating an OAuth sign-in URL.
Slug of the application to authenticate against.
Identifier of the authentication method to use.
Optional environment to target for sign-in.
Optional field values required to build the sign-in URL, keyed by field name.
Show child attributes
Show child attributes