Get OTP status
curl --request GET \
--url https://api.robase.dev/v1/otp/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.robase.dev/v1/otp/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.robase.dev/v1/otp/{id}', 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.robase.dev/v1/otp/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
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.robase.dev/v1/otp/{id}"
req, _ := http.NewRequest("GET", 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.get("https://api.robase.dev/v1/otp/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.robase.dev/v1/otp/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"workspace_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"phone_number": "<string>",
"country_code": "<string>",
"credit_cost": 123,
"status": "pending",
"code_length": 123,
"ttl_seconds": 123,
"attempt_count": 123,
"max_attempts": 5,
"expired_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"sent_at": "2023-11-07T05:31:56Z",
"delivered_at": "2023-11-07T05:31:56Z",
"verified_at": "2023-11-07T05:31:56Z",
"failed_at": "2023-11-07T05:31:56Z",
"failure_reason": "<string>",
"metadata": {},
"timeline": [
{
"at": "2023-11-07T05:31:56Z",
"status": "<string>",
"reason": "<string>",
"refunded": true
}
]
}{
"error": {
"type": "unauthorized",
"message": "invalid API key"
}
}{
"error": {
"type": "otp_not_found",
"message": "OTP not found"
}
}{
"error": {
"type": "rate_limited",
"message": "too many send attempts, try again later"
}
}{
"error": {
"type": "internal_error",
"message": "an unexpected error occurred"
}
}API reference
Get an OTP
GET /v1/otp/ — status and metadata. The code is never returned.
GET
/
v1
/
otp
/
{id}
Get OTP status
curl --request GET \
--url https://api.robase.dev/v1/otp/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.robase.dev/v1/otp/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.robase.dev/v1/otp/{id}', 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.robase.dev/v1/otp/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
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.robase.dev/v1/otp/{id}"
req, _ := http.NewRequest("GET", 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.get("https://api.robase.dev/v1/otp/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.robase.dev/v1/otp/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"workspace_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"phone_number": "<string>",
"country_code": "<string>",
"credit_cost": 123,
"status": "pending",
"code_length": 123,
"ttl_seconds": 123,
"attempt_count": 123,
"max_attempts": 5,
"expired_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"sent_at": "2023-11-07T05:31:56Z",
"delivered_at": "2023-11-07T05:31:56Z",
"verified_at": "2023-11-07T05:31:56Z",
"failed_at": "2023-11-07T05:31:56Z",
"failure_reason": "<string>",
"metadata": {},
"timeline": [
{
"at": "2023-11-07T05:31:56Z",
"status": "<string>",
"reason": "<string>",
"refunded": true
}
]
}{
"error": {
"type": "unauthorized",
"message": "invalid API key"
}
}{
"error": {
"type": "otp_not_found",
"message": "OTP not found"
}
}{
"error": {
"type": "rate_limited",
"message": "too many send attempts, try again later"
}
}{
"error": {
"type": "internal_error",
"message": "an unexpected error occurred"
}
}Authorizations
Your Robase API key. Starts with robe_. Include as Authorization: Bearer robe_...
Path Parameters
OTP ID returned from send
Response
OTP details
ISO 3166-1 alpha-2 country code
Available options:
pending, sent, verified, expired, failed Verification attempts made so far
Attempt budget before the OTP is burned
Example:
5
When the code stops being verifiable
When the OTP was marked failed. Absent otherwise.
Reason token behind a failed status. See TimelineItem.
Hops the OTP took, oldest first.
Show child attributes
Show child attributes