Pre-Flight 21-Rule UCC Compliance & Segmentation Check
curl --request POST \
--url https://ugatext.com/api/v1/compliance/inspect \
--header 'Client-ID: <api-key>' \
--header 'Client-Secret: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"message": "Your verification code is 482910.",
"sender_id": "UGATEXT"
}
'import requests
url = "https://ugatext.com/api/v1/compliance/inspect"
payload = {
"message": "Your verification code is 482910.",
"sender_id": "UGATEXT"
}
headers = {
"Client-ID": "<api-key>",
"Client-Secret": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Client-ID': '<api-key>',
'Client-Secret': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({message: 'Your verification code is 482910.', sender_id: 'UGATEXT'})
};
fetch('https://ugatext.com/api/v1/compliance/inspect', 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://ugatext.com/api/v1/compliance/inspect",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'message' => 'Your verification code is 482910.',
'sender_id' => 'UGATEXT'
]),
CURLOPT_HTTPHEADER => [
"Client-ID: <api-key>",
"Client-Secret: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://ugatext.com/api/v1/compliance/inspect"
payload := strings.NewReader("{\n \"message\": \"Your verification code is 482910.\",\n \"sender_id\": \"UGATEXT\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Client-ID", "<api-key>")
req.Header.Add("Client-Secret", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://ugatext.com/api/v1/compliance/inspect")
.header("Client-ID", "<api-key>")
.header("Client-Secret", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"message\": \"Your verification code is 482910.\",\n \"sender_id\": \"UGATEXT\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://ugatext.com/api/v1/compliance/inspect")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Client-ID"] = '<api-key>'
request["Client-Secret"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"message\": \"Your verification code is 482910.\",\n \"sender_id\": \"UGATEXT\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"decision": "APPROVE",
"risk_score": 0,
"character_count": 33,
"encoding": "GSM-7",
"sms_parts": 1,
"cost_estimate_ugx": 25,
"violations": [
"<string>"
],
"warnings": [
"<string>"
],
"inspected_at": "2023-11-07T05:31:56Z"
}Compliance
Pre-Flight 21-Rule UCC Compliance & Segmentation Check
POST
/
compliance
/
inspect
Pre-Flight 21-Rule UCC Compliance & Segmentation Check
curl --request POST \
--url https://ugatext.com/api/v1/compliance/inspect \
--header 'Client-ID: <api-key>' \
--header 'Client-Secret: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"message": "Your verification code is 482910.",
"sender_id": "UGATEXT"
}
'import requests
url = "https://ugatext.com/api/v1/compliance/inspect"
payload = {
"message": "Your verification code is 482910.",
"sender_id": "UGATEXT"
}
headers = {
"Client-ID": "<api-key>",
"Client-Secret": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Client-ID': '<api-key>',
'Client-Secret': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({message: 'Your verification code is 482910.', sender_id: 'UGATEXT'})
};
fetch('https://ugatext.com/api/v1/compliance/inspect', 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://ugatext.com/api/v1/compliance/inspect",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'message' => 'Your verification code is 482910.',
'sender_id' => 'UGATEXT'
]),
CURLOPT_HTTPHEADER => [
"Client-ID: <api-key>",
"Client-Secret: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://ugatext.com/api/v1/compliance/inspect"
payload := strings.NewReader("{\n \"message\": \"Your verification code is 482910.\",\n \"sender_id\": \"UGATEXT\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Client-ID", "<api-key>")
req.Header.Add("Client-Secret", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://ugatext.com/api/v1/compliance/inspect")
.header("Client-ID", "<api-key>")
.header("Client-Secret", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"message\": \"Your verification code is 482910.\",\n \"sender_id\": \"UGATEXT\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://ugatext.com/api/v1/compliance/inspect")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Client-ID"] = '<api-key>'
request["Client-Secret"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"message\": \"Your verification code is 482910.\",\n \"sender_id\": \"UGATEXT\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"decision": "APPROVE",
"risk_score": 0,
"character_count": 33,
"encoding": "GSM-7",
"sms_parts": 1,
"cost_estimate_ugx": 25,
"violations": [
"<string>"
],
"warnings": [
"<string>"
],
"inspected_at": "2023-11-07T05:31:56Z"
}Authorizations
Your UgaText Client-ID (e.g. uga_...). Accepted header aliases: X-Client-ID, or combined in Authorization: Bearer : / X-API-Key: :.
Your UgaText Client-Secret (e.g. sk_live_...). Accepted header alias: X-Client-Secret.
Body
application/json
Response
200 - application/json
Compliance analysis result
Example:
true
Available options:
APPROVE, WARN, BLOCK Example:
"APPROVE"
Example:
0
Example:
33
Available options:
GSM-7, UCS-2 Example:
"GSM-7"
Example:
1
Example:
25

