logo
enes

HTTP connection

Last update: 7 days ago by Irais Aguirre

Request

URLhttps://api.ventachat.com/template/api-template
MethodPOST
Typeapplication/json

Headers

NameDescriptionTypeRequirements
Content-Typeapplication/jsonstringrequired
Authorizationauthentication tokenstringrequired
Accept*/*stringrequired

Objects

General structure

NameDescriptionTypeRequirements
contactNamecontact namestringoptional
fromphone number (with country code) the message will be sent fromstringrequired
toWhatsApp identifier returned by the contacts servicestringrequired
userIduser uuidstring (uuid)required
workgroupIdworkgroup identifierstring (uuid)required
campaignIdcampaign identifierstringrequired
typemessage typestringrequired
messageobject that contains the message contentobjectrequired

Message object

NameDescriptionTypeRequirements
templateIdtemplate identifierintegerrequired
templateobject that contains the template detailsobjectrequired

Template object

NameDescriptionTypeRequirements
languagetemplate languagestringoptional
nametemplate namestringoptional
componentsobject that contains the template configurationobjectoptional

Components object

NameDescriptionTypeRequirements
typeComponent type. Possible values: header: template header, body: template body, button: buttons for template actionsstringrequired
subtypequick_reply: refers to a previously created quick reply button that allows the customer to return a predefined message. URL: refers to a previously created button that allows the customer to visit the URL generated by appending the text parameter to the predefined prefix URL in the template. catalog: refers to a previously created catalog button that allows the customer to return a complete product catalogstringrequired when used with the button type
indexindex for payload type parametersstringoptional, used with the button type; index values can be: 0,1,2
cardssend card type messagesobjectrequired
parametersarray of template types. Possible values: text, currency, date_time, image, document, video, location, payload, actionarrayrequired

Parameter types versus component types

Parameter typeheaderbodybutton
textyesyesno
currencyyesyesno
date_timeyesyesno
imageyesnono
documentyesnono
videoyesnono
locationyesnono
payloadnonoyes
actionnoyesyes

Text

NameDescriptionTypeRequirements
typethe value is “text”stringrequired
texttextstringoptional

Currency

NameDescriptionTypeRequirements
typethe value is “currency”stringrequired
fallbackValueif the currency code is not recognized, the fallbackValue value will be usedstringoptional
codecurrency code (ISO 4217)stringoptional
amountAmountnumberoptional

Datetime

NameDescriptionTypeRequirements
typethe value is “date_time”stringrequired
fallbackValueif the date is not recognized, the fallbackValue value will be usedstringrequired
dayOfMonthday of the monthnumberrequired
yearyearnumberoptional
monthmonthnumberoptional
hourhournumberoptional
minuteminutenumberoptional

Multimedia content

Image object
NameDescriptionTypeRequirements
typethe value is “image”stringrequired
linkimage URLstringrequired
Document object
NameDescriptionTypeRequirements
typethe value is “document”stringrequired
linkdocument URLstringrequired
captiondocument descriptionstringoptional, maximum size is 178 characters
filenamedocument file namestringrequired
Video object
NameDescriptionTypeRequirements
typethe value is “video”stringrequired
linkvideo URLstringrequired
Buttons object
NameDescriptionTypeRequirements
typethe value is “payload”stringrequired
linkquick reply button descriptionstringoptional, used with the payload parameter type in the button component; maximum size is 128 characters
Card object
NameDescriptionTypeRequirements
cardIndexcard indexnumberrequired
componentscard componentsobjectrequired
VentaChat — Previous
Template sending
Next — VentaChat
Examples