Lipachat Docs
  • Lipachat Docs
  • Getting Started
    • Getting Started with Lipachat
  • API
    • Sending Messages
    • Sending Media
    • Sending Buttons
    • Sending Interactive Lists
    • Templates
      • Creating a Template
      • Updating a Template
      • Listing Message Templates
      • Sending Message Templates
    • Whatsapp Flows
      • Creating a flow
      • Updating a flow
      • Get flow preview
      • Publish a flow
      • Send a flow
      • List all flows
    • Webhooks
  • Reference
    • Sandbox
  • Go Live
  • Guides
    • Build A Chat Bot
  • CRM Workflow
Powered by GitBook
On this page
  1. API
  2. Templates

Updating a Template

PUT https://gateway.lipachat.com/api/v1/template/PHONE_NUMBER/:templateId

Pass your WABA number or Sandbox phone number as the value of PHONE_NUMBER

Headers

Name
Value

Content-Type

application/json

apiKey

Body

Name
Type
Description

name

string

Name of template

language

string

Language code e.g en

category

string

Accepted values are: MARKETING, UTILITY or AUTHENTICATION.

component.header.format

string

Accepted values are: TEXT, IMAGE, VIDEO, DOCUMENT

component.header.text

string

Text to be sent on header

component.header.example

string

Should be present if text above has a variable.

component.body.text

string

Body text, accepts variables e.g Hello {{1}}, your balance is {{2}}

component.body.examples

array

Should match number of variables passed in text. For the example above it should be ['John', '2000']

component.footer.text

string

Optional footer text.

component.buttons[0].type

string

Accepted values are: PHONE_NUMBER, URL or QUICK_REPLY.

component.buttons[0].text

string

Text on button above.

component.buttons[0].phoneNumber

string

Should be passed if button type passed is PHONE_NUMBER.

component.buttons[0].url

string

Should be passed if button type passed is URL.

component.buttons[0].example

string

Applies for PHONE_NUMBER and URL.

component.header, component.footer, component.buttons objects are optional.

Request to update a template with header and body.
{
    "name": "test_campaign_utility2",
    "category": "MARKETING",
    "component": {
        "header": {
            "format": "TEXT",
            "text": "{{1}} sale",
            "example": "July"
        },
        "body": {
            "text": "Hi {{1}}, we have an offer for you, click on the link {{2}} to view it.",
            "examples": [
                "John",
                "http://lipachat.com/offers/ASHSH"
            ]
        }
    }
}

Response

{
    "timestamp": null,
    "data": {
        "success": true,
        "error": null
    },
    "status": "success",
    "message": "success",
    "errors": null
}
{
    "timestamp": "2024-09-15T20:06:38.675567555",
    "data": null,
    "status": "error",
    "message": "Content in this language already exists",
    "errors": null
}
{
    "timestamp": "2024-09-15T20:07:23.464199513",
    "data": null,
    "status": "success",
    "message": "Invalid credentials",
    "errors": null
}

PreviousCreating a TemplateNextListing Message Templates

Last updated 4 months ago

Get apiKey from App portal settings tab

https://app.lipachat.com/app/settings