Create an install token
curl --request POST \
--url https://api.reintersect.com/v0/apps/installs/{installId}/access-tokens \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.reintersect.com/v0/apps/installs/{installId}/access-tokens"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.reintersect.com/v0/apps/installs/{installId}/access-tokens', 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.reintersect.com/v0/apps/installs/{installId}/access-tokens",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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.reintersect.com/v0/apps/installs/{installId}/access-tokens"
req, _ := http.NewRequest("POST", 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.post("https://api.reintersect.com/v0/apps/installs/{installId}/access-tokens")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.reintersect.com/v0/apps/installs/{installId}/access-tokens")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_bodyInstall
Create an install token
Mint a one-hour install token for one install with your app’s client credentials.
POST
/
v0
/
apps
/
installs
/
{installId}
/
access-tokens
Create an install token
curl --request POST \
--url https://api.reintersect.com/v0/apps/installs/{installId}/access-tokens \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.reintersect.com/v0/apps/installs/{installId}/access-tokens"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.reintersect.com/v0/apps/installs/{installId}/access-tokens', 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.reintersect.com/v0/apps/installs/{installId}/access-tokens",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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.reintersect.com/v0/apps/installs/{installId}/access-tokens"
req, _ := http.NewRequest("POST", 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.post("https://api.reintersect.com/v0/apps/installs/{installId}/access-tokens")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.reintersect.com/v0/apps/installs/{installId}/access-tokens")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body
Mints a one-hour install token (
The token carries the scopes the install granted for its current version.
reiapp_…) for calls made outside a delivery, such as from a route or
a job. The SDK does this for you in reintersect.forInstall(installId) and
createReintersectClient(app, { installId }), and caches the token.
Authenticate with HTTP Basic, using your client ID and client secret. Each client can mint at most
600 tokens a minute. Responses carry cache-control: no-store. Hosted apps never hold the client secret and
don’t call this endpoint.
Response
| Field | Description |
|---|---|
token | The install token. Send it as authorization: Bearer …. |
expires_at | When it expires, about an hour from now. |
Errors
_tag | Status | Cause |
|---|---|---|
ReintersectAppOAuthInvalidClientError | 401 | Wrong client credentials. |
ReintersectAppInstallNotFoundError | 404 | No install with this id for your app. |
ReintersectAppInstallRevokedError | 403 | The install was uninstalled or suspended. |
ReintersectApiRateLimitExceededError | 429 | Too many tokens. |
Example
curl -X POST https://api.reintersect.com/v0/apps/installs/inst_123/access-tokens \
-u "$REINTERSECT_APP_CLIENT_ID:$REINTERSECT_APP_CLIENT_SECRET"