cURL
curl "https://app.tatango.com/api/v2/shortcodes/ID/test_keyword" -X POST \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-u emailaddress@mydomain.com:my_api_key \
-d '{"keyword_name": "TESTKEYWORD"}'require 'net/http'
require 'uri'
require 'json'
uri = URI.parse('https://app.tatango.com/api/v2/shortcodes/ID/test_keyword')
http = Net::HTTP.new(uri.host, uri.port)
request = Net::HTTP::Post.new(uri.request_uri)
request.basic_auth("emailaddress@mydomain.com", "my_api_key")
request.body = JSON.generate({keyword_name: "TESTKEYWORD"})
response = http.request(request)var request = new XMLHttpRequest();
request.open('POST', 'https://app.tatango.com/api/v2/shortcodes/ID/test_keyword', false);
request.setRequestHeader('Content-Type', 'application/json');
request.setRequestHeader('Authorization', 'Basic ' + btoa('emailaddress@mydomain.com:my_api_key'));
var data = JSON.stringify({keyword_name: 'TESTKEYWORD'});
request.send(data);import requests
url = "https://app.tatango.com/api/v2/shortcodes/{ID}/test_keyword"
payload = { "keyword_name": "<string>" }
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.tatango.com/api/v2/shortcodes/{ID}/test_keyword",
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([
'keyword_name' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"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://app.tatango.com/api/v2/shortcodes/{ID}/test_keyword"
payload := strings.NewReader("{\n \"keyword_name\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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://app.tatango.com/api/v2/shortcodes/{ID}/test_keyword")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"keyword_name\": \"<string>\"\n}")
.asString();{
"status": "OK",
"keyword_name": "available"
}Shortcodes
Testing Keyword Availability on Shortcode
This endpoint checks the availability of a keyword on the account’s shortcode.
POST
/
api
/
v2
/
shortcodes
/
{ID}
/
test_keyword
cURL
curl "https://app.tatango.com/api/v2/shortcodes/ID/test_keyword" -X POST \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-u emailaddress@mydomain.com:my_api_key \
-d '{"keyword_name": "TESTKEYWORD"}'require 'net/http'
require 'uri'
require 'json'
uri = URI.parse('https://app.tatango.com/api/v2/shortcodes/ID/test_keyword')
http = Net::HTTP.new(uri.host, uri.port)
request = Net::HTTP::Post.new(uri.request_uri)
request.basic_auth("emailaddress@mydomain.com", "my_api_key")
request.body = JSON.generate({keyword_name: "TESTKEYWORD"})
response = http.request(request)var request = new XMLHttpRequest();
request.open('POST', 'https://app.tatango.com/api/v2/shortcodes/ID/test_keyword', false);
request.setRequestHeader('Content-Type', 'application/json');
request.setRequestHeader('Authorization', 'Basic ' + btoa('emailaddress@mydomain.com:my_api_key'));
var data = JSON.stringify({keyword_name: 'TESTKEYWORD'});
request.send(data);import requests
url = "https://app.tatango.com/api/v2/shortcodes/{ID}/test_keyword"
payload = { "keyword_name": "<string>" }
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.tatango.com/api/v2/shortcodes/{ID}/test_keyword",
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([
'keyword_name' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"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://app.tatango.com/api/v2/shortcodes/{ID}/test_keyword"
payload := strings.NewReader("{\n \"keyword_name\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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://app.tatango.com/api/v2/shortcodes/{ID}/test_keyword")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"keyword_name\": \"<string>\"\n}")
.asString();{
"status": "OK",
"keyword_name": "available"
}Request URL
POST https://app.tatango.com/api/v2/shortcodes/{ID}/test_keyword
FAQs
What are the limitations for a keyword?- A keyword must contain at least two characters and no more than 15 characters.
- Keywords are not case sensitive.
FOOwill matchfooandFOOandFoo. - You can’t use obscene words. We’re not going to spell them out here.
- No. The system checks for duplicate keywords by transforming all keywords to uppercase before performing matching algorithms.
- The response from the API will be a 422 error with the response body looking like this:
{"status":"error","error":"invalid keyword names: EXISTINGKW"}
- Yes. By utilizing this endpoint. The response will either be:
200 OKwith the response body looking like this:{"status":"OK","keyword_name":"available"}200 OKwith the response body looking like this:{"status":"OK","keyword_name":"unavailable","error":"Name is in use"}.