Get template by ID

Retrieves a specific message template by its unique identifier for the authenticated customer. Templates define the structure and content of messages that can be sent via SMS or WhatsApp. The customer ID is extracted from the authentication token.

GET
/v1/templates/id
x-sender-id<token>

In: header

Query Parameters

idstring
Formatguid

Header Parameters

x-sender-idstring
Formatguid
x-api-keystring

Response Body

curl -X GET "https://api.sent.dm/v1/templates/id?id=7ba7b820-9dad-11d1-80b4-00c04fd430c8" \
  -H "x-sender-id: string" \
  -H "x-api-key: string"
fetch("https://api.sent.dm/v1/templates/id?id=7ba7b820-9dad-11d1-80b4-00c04fd430c8", {
  headers: {
    "x-sender-id": "string",
    "x-api-key": "string"
  }
})
package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
)

func main() {
  url := "https://api.sent.dm/v1/templates/id?id=7ba7b820-9dad-11d1-80b4-00c04fd430c8"

  req, _ := http.NewRequest("GET", url, nil)
  req.Header.Add("x-sender-id", "string")
  req.Header.Add("x-api-key", "string")
  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))
}
import requests

url = "https://api.sent.dm/v1/templates/id?id=7ba7b820-9dad-11d1-80b4-00c04fd430c8"

response = requests.request("GET", url, headers = {
  "x-sender-id": "string",
  "x-api-key": "string"
})

print(response.text)
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.http.HttpResponse.BodyHandlers;
import java.time.Duration;

HttpClient client = HttpClient.newBuilder()
  .connectTimeout(Duration.ofSeconds(10))
  .build();

HttpRequest.Builder requestBuilder = HttpRequest.newBuilder()
  .uri(URI.create("https://api.sent.dm/v1/templates/id?id=7ba7b820-9dad-11d1-80b4-00c04fd430c8"))
  .header("x-sender-id", "string")
  .header("x-api-key", "string")
  .GET()
  .build();

try {
  HttpResponse<String> response = client.send(requestBuilder.build(), BodyHandlers.ofString());
  System.out.println("Status code: " + response.statusCode());
  System.out.println("Response body: " + response.body());
} catch (Exception e) {
  e.printStackTrace();
}
using System;
using System.Net.Http;
using System.Text;

var client = new HttpClient();
client.DefaultRequestHeaders.Add("x-sender-id", "string");
client.DefaultRequestHeaders.Add("x-api-key", "string");
var response = await client.GetAsync("https://api.sent.dm/v1/templates/id?id=7ba7b820-9dad-11d1-80b4-00c04fd430c8");
var responseBody = await response.Content.ReadAsStringAsync();
{
  "id": "7ba7b820-9dad-11d1-80b4-00c04fd430c8",
  "name": "Appointment Reminder",
  "category": "MARKETING",
  "whatsappTemplateName": "appointment_reminder_v1",
  "whatsappTemplateStatus": "APPROVED",
  "published": true
}
Empty
Empty