Check carrier accounts are available
curl --request GET \
--url https://api.goyappr.com/carrier-accounts/status \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.goyappr.com/carrier-accounts/status"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.goyappr.com/carrier-accounts/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.goyappr.com/carrier-accounts/status",
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.goyappr.com/carrier-accounts/status"
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.goyappr.com/carrier-accounts/status")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.goyappr.com/carrier-accounts/status")
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{
"enabled": true
}{
"error": "Calling out through your own Telnyx account is switched off for this workspace. Contact Yappr support.",
"code": "CARRIER_ACCOUNTS_NOT_ENABLED",
"enabled": false
}Carrier accounts
Carrier Accounts Status
Whether this workspace may use carrier accounts (calls from numbers in your own
Telnyx account). They are available in every workspace, so this answers
{"enabled": true} unless Yappr has switched them off for this one; then every
carrier-accounts route answers 403 CARRIER_ACCOUNTS_NOT_ENABLED. Requires
carrier_accounts:read.
GET
/
carrier-accounts
/
status
Check carrier accounts are available
curl --request GET \
--url https://api.goyappr.com/carrier-accounts/status \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.goyappr.com/carrier-accounts/status"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.goyappr.com/carrier-accounts/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.goyappr.com/carrier-accounts/status",
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.goyappr.com/carrier-accounts/status"
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.goyappr.com/carrier-accounts/status")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.goyappr.com/carrier-accounts/status")
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{
"enabled": true
}{
"error": "Calling out through your own Telnyx account is switched off for this workspace. Contact Yappr support.",
"code": "CARRIER_ACCOUNTS_NOT_ENABLED",
"enabled": false
}Whether this workspace may use carrier accounts: calls from the numbers you own in
your own Telnyx account. They are available in every workspace, so this answers
Available (every workspace):
Switched off (
{ "enabled": true } unless Yappr has switched them off for yours. Requires
carrier_accounts:read.
curl https://api.goyappr.com/carrier-accounts/status \
-H "Authorization: Bearer ypr_live_..."
{ "enabled": true }
403), only where Yappr has had to turn carrier accounts off for this
workspace. Every other carrier-accounts route answers the same while it is off, and
nothing is sent to Telnyx:
{
"error": "Calling out through your own Telnyx account is switched off for this workspace. Contact Yappr support.",
"code": "CARRIER_ACCOUNTS_NOT_ENABLED",
"enabled": false
}
Errors
| Status | code | Meaning |
|---|---|---|
| 403 | CARRIER_ACCOUNTS_NOT_ENABLED | Yappr has switched carrier accounts off for this workspace. Contact Yappr support. |