Poll for Agent Authorization Result
curl --request GET \
--url https://api.casparser.in/v1/agent-auth/token/{token}import requests
url = "https://api.casparser.in/v1/agent-auth/token/{token}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.casparser.in/v1/agent-auth/token/{token}', 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.casparser.in/v1/agent-auth/token/{token}",
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.casparser.in/v1/agent-auth/token/{token}"
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.casparser.in/v1/agent-auth/token/{token}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.casparser.in/v1/agent-auth/token/{token}")
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"
}{
"detail": "Token must be 16-128 characters"
}Agent Auth
Poll for Agent Authorization Result
Agent polls this endpoint to check if the user has approved the authorization.
Returns {"status": "pending"} while waiting for user approval.
Returns {"status": "approved", "api_key": "sk_...", "email": "..."} once approved.
One-shot delivery: the API key is returned exactly once. After delivery, the token is deleted
and subsequent polls return {"status": "pending"}.
Recommended polling interval: 5 seconds. Token expires after 10 minutes.
GET
/
v1
/
agent-auth
/
token
/
{token}
Poll for Agent Authorization Result
curl --request GET \
--url https://api.casparser.in/v1/agent-auth/token/{token}import requests
url = "https://api.casparser.in/v1/agent-auth/token/{token}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.casparser.in/v1/agent-auth/token/{token}', 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.casparser.in/v1/agent-auth/token/{token}",
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.casparser.in/v1/agent-auth/token/{token}"
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.casparser.in/v1/agent-auth/token/{token}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.casparser.in/v1/agent-auth/token/{token}")
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"
}{
"detail": "Token must be 16-128 characters"
}Path Parameters
The token the agent generated locally and included in the approval URL.
Required string length:
16 - 128Example:
"a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6a7b8c9d0e1f2a3b4c5d6a7b8c9d0e1f2"
Response
Current authorization status
- Pending
- Approved
Available options:
pending Was this page helpful?

