Fetch Templates

Fetches WhatsApp message templates associated with a channel.

Endpoint

GET /api/message-templates/official-templates

Base URL

https://api.rampwin.com

Description

Retrieves WhatsApp message templates stored in Rampwin, with an option to sync with Meta for the latest status.


Headers

HeaderTypeRequiredDescription
acceptstringYesapplication/json
x-api-keystringYesYour Rampwin API key

Query Parameters

ParameterTypeRequiredDescription
channel_idstringYesWhatsApp channel ID
isSyncMessagebooleanNoSync templates from Meta for latest status
isPaginationbooleanNoEnable pagination
pagenumberNoPage number
page_sizenumberNoNumber of records per page
isCurrencybooleanNoInclude currency-related data

1. Fetch Templates (Default)

Returns templates stored in Rampwin without syncing from Meta.

Use Case

  • Fast retrieval
  • Regular listing
  • No need for real-time status updates

Example Request

curl --location 'https://api.rampwin.com/api/message-templates/official-templates?channel_id=YOUR_CHANNEL_ID&isPagination=true&page=1&page_size=10&isCurrency=true' \
--header 'accept: application/json' \
--header 'x-api-key: YOUR_API_KEY'

2. Fetch + Sync Templates

Fetches templates after syncing with Meta to ensure the latest status.

Use Case

  • When template status may have changed in Meta
  • Before sending campaigns
  • Admin or refresh actions

Key Difference

  • isSyncMessage=true → Syncs templates from Meta before returning response

Example Request

curl --location 'https://api.rampwin.com/api/message-templates/official-templates?channel_id=YOUR_CHANNEL_ID&isSyncMessage=true&isPagination=true&page=1&page_size=10&isCurrency=true' \
--header 'accept: application/json' \
--header 'x-api-key: YOUR_API_KEY'

Note

Both APIs use the same endpoint.
The only difference is the isSyncMessage parameter:

  • false / not provided → Fetch from Rampwin DB
  • true → Sync from Meta and return latest status

Response

Success (200)

{
  "success": true,
  "data": [
    {
      "template_id": "template_123",
      "name": "payment_receipt",
      "status": "APPROVED",
      "category": "UTILITY",
      "language": "en_US",
      "components": []
    }
  ],
  "pagination": {
    "page": 1,
    "page_size": 10,
    "total": 100
  }
}