Get an SMS template
curl --request GET \
--url https://collectwiseapi.com/text/templates/{templateId} \
--header 'collectwise_key: <api-key>'import requests
url = "https://collectwiseapi.com/text/templates/{templateId}"
headers = {"collectwise_key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {collectwise_key: '<api-key>'}};
fetch('https://collectwiseapi.com/text/templates/{templateId}', 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://collectwiseapi.com/text/templates/{templateId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"collectwise_key: <api-key>"
],
]);
$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://collectwiseapi.com/text/templates/{templateId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("collectwise_key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://collectwiseapi.com/text/templates/{templateId}")
.header("collectwise_key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://collectwiseapi.com/text/templates/{templateId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["collectwise_key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"templateId": 100,
"accountId": "99999",
"message": "{Consumer Name}, {Company Name} is a debt collector attempting to collect a debt. Visit {Website Payment} using your account# {Account Number} or call {Phone#}. Reply STOP to opt out.",
"placeholders": [
"Consumer Name",
"Company Name",
"Website Payment",
"Account Number",
"Phone#"
]
}{
"error": "templateId must be an integer"
}{
"error": "Texting is not enabled for this organization"
}{
"error": "Template not found"
}{
"error": "Too many requests"
}Texting
Get SMS Template
Fetches a single template’s body and its placeholder variables.
GET
/
text
/
templates
/
{templateId}
Get an SMS template
curl --request GET \
--url https://collectwiseapi.com/text/templates/{templateId} \
--header 'collectwise_key: <api-key>'import requests
url = "https://collectwiseapi.com/text/templates/{templateId}"
headers = {"collectwise_key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {collectwise_key: '<api-key>'}};
fetch('https://collectwiseapi.com/text/templates/{templateId}', 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://collectwiseapi.com/text/templates/{templateId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"collectwise_key: <api-key>"
],
]);
$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://collectwiseapi.com/text/templates/{templateId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("collectwise_key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://collectwiseapi.com/text/templates/{templateId}")
.header("collectwise_key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://collectwiseapi.com/text/templates/{templateId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["collectwise_key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"templateId": 100,
"accountId": "99999",
"message": "{Consumer Name}, {Company Name} is a debt collector attempting to collect a debt. Visit {Website Payment} using your account# {Account Number} or call {Phone#}. Reply STOP to opt out.",
"placeholders": [
"Consumer Name",
"Company Name",
"Website Payment",
"Account Number",
"Phone#"
]
}{
"error": "templateId must be an integer"
}{
"error": "Texting is not enabled for this organization"
}{
"error": "Template not found"
}{
"error": "Too many requests"
}Authorizations
Path Parameters
The template's identifier.
Response
The template.
Identifier for the template.
The account the template belongs to (your organization's configured account).
The template body, containing {placeholder} tokens.
Variable names you must supply in variables when sending.
⌘I
