Skip to main content
POST
/
{sessionId}
/
auth
/
Resume a session (re-issue hydrationId)
curl --request POST \
  --url https://app.dromo.io/api/widget/session/v2/{sessionId}/auth/ \
  --header 'Content-Type: application/json' \
  --header 'X-DROMO-LICENSE-KEY: <api-key>' \
  --data '
{
  "expires_in": 3600
}
'
import requests

url = "https://app.dromo.io/api/widget/session/v2/{sessionId}/auth/"

payload = { "expires_in": 3600 }
headers = {
"X-DROMO-LICENSE-KEY": "<api-key>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {'X-DROMO-LICENSE-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({expires_in: 3600})
};

fetch('https://app.dromo.io/api/widget/session/v2/{sessionId}/auth/', 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://app.dromo.io/api/widget/session/v2/{sessionId}/auth/",
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([
'expires_in' => 3600
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-DROMO-LICENSE-KEY: <api-key>"
],
]);

$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://app.dromo.io/api/widget/session/v2/{sessionId}/auth/"

payload := strings.NewReader("{\n \"expires_in\": 3600\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("X-DROMO-LICENSE-KEY", "<api-key>")
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://app.dromo.io/api/widget/session/v2/{sessionId}/auth/")
.header("X-DROMO-LICENSE-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"expires_in\": 3600\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://app.dromo.io/api/widget/session/v2/{sessionId}/auth/")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["X-DROMO-LICENSE-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"expires_in\": 3600\n}"

response = http.request(request)
puts response.read_body
{
  "hydrationId": "<new-signed-token>",
  "expiresIn": 21600
}

Authorizations

X-DROMO-LICENSE-KEY
string
header
required

Your backend license key (is_for_backend_api=True) from the Dromo Dashboard. Never expose this client-side.

Path Parameters

sessionId
string<uuid>
required

UUID of the session to resume. Returned as sessionId when the session was created. Returns 404 if the session doesn't exist or hasn't been saved within 7 days.

Example:

"1b6acf28-8748-4120-8d7a-4b7846d5e487"

Body

application/json
expires_in
integer

New token TTL in seconds. Defaults to 21600 (6 hours).

Example:

3600

Response

Fresh hydrationId issued

hydrationId
string

The new access token. Pass this to the widget to resume the session.

Example:

"<new-signed-token>"

expiresIn
integer

Seconds until the new hydrationId expires.

Example:

21600