Get the pairing status of a trial
curl --request GET \
--url https://api.isnap.ai/v1/trial/statusimport requests
url = "https://api.isnap.ai/v1/trial/status"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.isnap.ai/v1/trial/status', 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.isnap.ai/v1/trial/status",
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.isnap.ai/v1/trial/status"
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.isnap.ai/v1/trial/status")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.isnap.ai/v1/trial/status")
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{
"success": true,
"data": {
"trial_id": "<string>",
"token": "<string>",
"status": "pairing_pending",
"pairing_expires_at": "<string>",
"pool_line_id": "<string>",
"pool_line_number": "<string>",
"paired_handle": "<string>",
"activity_rule": {
"max_outbound_without_inbound": 123,
"outbound_since_last_inbound": 123
},
"trial_api_key": "<string>"
},
"trace_id": "<string>",
"request_id": "<string>"
}{
"success": false,
"data": "<unknown>",
"error": {
"status": 123,
"code": "<string>",
"message": "<string>",
"retry_after": 123,
"retry_at": "<string>",
"issues": [
{
"path": [
"<string>"
],
"message": "<string>",
"code": "<string>",
"min": 123,
"max": 123
}
]
},
"trace_id": "<string>",
"request_id": "<string>"
}{
"success": false,
"data": "<unknown>",
"error": {
"status": 123,
"code": "<string>",
"message": "<string>",
"retry_after": 123,
"retry_at": "<string>",
"issues": [
{
"path": [
"<string>"
],
"message": "<string>",
"code": "<string>",
"min": 123,
"max": 123
}
]
},
"trace_id": "<string>",
"request_id": "<string>"
}{
"success": false,
"data": "<unknown>",
"error": {
"status": 123,
"code": "<string>",
"message": "<string>",
"retry_after": 123,
"retry_at": "<string>",
"issues": [
{
"path": [
"<string>"
],
"message": "<string>",
"code": "<string>",
"min": 123,
"max": 123
}
]
},
"trace_id": "<string>",
"request_id": "<string>"
}{
"success": false,
"data": "<unknown>",
"error": {
"status": 123,
"code": "<string>",
"message": "<string>",
"retry_after": 123,
"retry_at": "<string>",
"issues": [
{
"path": [
"<string>"
],
"message": "<string>",
"code": "<string>",
"min": 123,
"max": 123
}
]
},
"trace_id": "<string>",
"request_id": "<string>"
}Trials
Get the pairing status of a trial
Reads a trial by its pairing code, without a credential, and returns the trial key once after pairing.
GET
/
v1
/
trial
/
status
Get the pairing status of a trial
curl --request GET \
--url https://api.isnap.ai/v1/trial/statusimport requests
url = "https://api.isnap.ai/v1/trial/status"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.isnap.ai/v1/trial/status', 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.isnap.ai/v1/trial/status",
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.isnap.ai/v1/trial/status"
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.isnap.ai/v1/trial/status")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.isnap.ai/v1/trial/status")
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{
"success": true,
"data": {
"trial_id": "<string>",
"token": "<string>",
"status": "pairing_pending",
"pairing_expires_at": "<string>",
"pool_line_id": "<string>",
"pool_line_number": "<string>",
"paired_handle": "<string>",
"activity_rule": {
"max_outbound_without_inbound": 123,
"outbound_since_last_inbound": 123
},
"trial_api_key": "<string>"
},
"trace_id": "<string>",
"request_id": "<string>"
}{
"success": false,
"data": "<unknown>",
"error": {
"status": 123,
"code": "<string>",
"message": "<string>",
"retry_after": 123,
"retry_at": "<string>",
"issues": [
{
"path": [
"<string>"
],
"message": "<string>",
"code": "<string>",
"min": 123,
"max": 123
}
]
},
"trace_id": "<string>",
"request_id": "<string>"
}{
"success": false,
"data": "<unknown>",
"error": {
"status": 123,
"code": "<string>",
"message": "<string>",
"retry_after": 123,
"retry_at": "<string>",
"issues": [
{
"path": [
"<string>"
],
"message": "<string>",
"code": "<string>",
"min": 123,
"max": 123
}
]
},
"trace_id": "<string>",
"request_id": "<string>"
}{
"success": false,
"data": "<unknown>",
"error": {
"status": 123,
"code": "<string>",
"message": "<string>",
"retry_after": 123,
"retry_at": "<string>",
"issues": [
{
"path": [
"<string>"
],
"message": "<string>",
"code": "<string>",
"min": 123,
"max": 123
}
]
},
"trace_id": "<string>",
"request_id": "<string>"
}{
"success": false,
"data": "<unknown>",
"error": {
"status": 123,
"code": "<string>",
"message": "<string>",
"retry_after": 123,
"retry_at": "<string>",
"issues": [
{
"path": [
"<string>"
],
"message": "<string>",
"code": "<string>",
"min": 123,
"max": 123
}
]
},
"trace_id": "<string>",
"request_id": "<string>"
}- Credential: none. The pairing code in
tokenidentifies the trial, and the prospect sees that code. Call this operation from your backend only, never from a browser: see How a trial works. - Events: none. A call made after the pairing window ended, for a trial that the prospect has not paired, sets the trial to
revokedand sends no event: see Statuses. - Personal data:
paired_handle, the prospect’s phone number or the email address of their Apple ID. Request it only when needed, do not copy it into logs, tickets or other tools, and refer to a prospect by an id of your own. - Trial key: the first call after pairing returns
trial_api_key, if it is made within 1 hour of pairing. Every later call omits it. - Retries: do not retry this call automatically: the first read after pairing returns the trial key once. See Read the status and the trial key.
- Caching: the response carries
Cache-Control: no-store, whatever its status. - Rate limit: each call counts against the request-rate limit.
Errors
| Status | error.code | When |
|---|---|---|
| 400 | validation_failed | token is missing, empty or longer than 64 characters. |
| 404 | trial_not_found | No trial has this pairing code. |
| 410 | pairing_expired | The pairing window ended before the prospect paired, or the trial is revoked, whatever the reason. A 200 never carries status: revoked. Start another trial. |
Query Parameters
The pairing code, as returned in token by POST /v1/trial/init. Case-insensitive, and surrounding spaces are ignored. From 1 to 64 characters.
Required string length:
1 - 64Example:
"K7M2XQ9"
Response
The state of the trial.
Always true on a success response.
Available options:
true The state of a trial, read from its pairing code.
Show child attributes
Show child attributes
Trace id of the request that produced this response: 32 lowercase hexadecimal characters. Quote it when you report a problem to iSnap.
Id of the request that produced this response: req_ followed by 25 letters or digits.