curl --request GET \
--url https://api.spreadjam.com/v1/agent-connect/{pollToken}import requests
url = "https://api.spreadjam.com/v1/agent-connect/{pollToken}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.spreadjam.com/v1/agent-connect/{pollToken}', 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.spreadjam.com/v1/agent-connect/{pollToken}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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.spreadjam.com/v1/agent-connect/{pollToken}"
req, _ := http.NewRequest("GET", url, nil)
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.spreadjam.com/v1/agent-connect/{pollToken}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.spreadjam.com/v1/agent-connect/{pollToken}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"status": "pending",
"message": "<string>",
"apiKey": "<string>",
"replaced": true,
"workspaceId": "<string>",
"expiresAt": "<string>",
"stage": "awaiting_signin",
"reason": "checkout_not_started",
"checkoutStartedAt": "<string>",
"checkoutExpiresAt": "<string>",
"resumeUrl": "https://www.spreadjam.com/connect/ABCD234567",
"humanMessage": "<string>"
}Poll an agent connect session
No API key needed. pending (with stage: what is left) until the human approves and, for a session started with onboarding, until the trial has started and the project exists; then approved with the API key; then consumed. The raw key is never stored, so it is not shown twice: a poll within 10 minutes of the first approved whose key was never used gets a replacement key (the first is revoked, replaced: true), so a poller that died before storing it can recover. denied and expired are final.
curl --request GET \
--url https://api.spreadjam.com/v1/agent-connect/{pollToken}import requests
url = "https://api.spreadjam.com/v1/agent-connect/{pollToken}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.spreadjam.com/v1/agent-connect/{pollToken}', 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.spreadjam.com/v1/agent-connect/{pollToken}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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.spreadjam.com/v1/agent-connect/{pollToken}"
req, _ := http.NewRequest("GET", url, nil)
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.spreadjam.com/v1/agent-connect/{pollToken}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.spreadjam.com/v1/agent-connect/{pollToken}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"status": "pending",
"message": "<string>",
"apiKey": "<string>",
"replaced": true,
"workspaceId": "<string>",
"expiresAt": "<string>",
"stage": "awaiting_signin",
"reason": "checkout_not_started",
"checkoutStartedAt": "<string>",
"checkoutExpiresAt": "<string>",
"resumeUrl": "https://www.spreadjam.com/connect/ABCD234567",
"humanMessage": "<string>"
}Path Parameters
Response
Where the session stands.
Only on pending: what is left. awaiting_signin (the link is not opened by a signed-in person yet), awaiting_review (they have not approved), awaiting_payment (approved, the trial has not started), setting_up (paid, the project is being created).
awaiting_signin, awaiting_review, awaiting_payment, setting_up Only on awaiting_payment: why the trial has not started. checkout_not_started (approved, checkout not opened yet), checkout_open (the checkout the human opened is still payable, for up to 31 minutes after it opened; they may still be paying), checkout_abandoned (checkout was opened, then closed or expired unpaid), payment_failed (the card payment did not go through).
checkout_not_started, checkout_open, checkout_abandoned, payment_failed