Whatsapp Text Template

Reach users globally on the world's most popular messaging platform to send messages in any format as you need. You can send Whatsapp Text Template messsage to the users as a notification, the user no need to initiate the chat.

Template

You need to request a Whatsapp Text Template to Motict team before sending the message.

Name Example

                            
                            5f0b5191-7093-45b4-962f-f2943adec77b
                            
                        

Content Example

                            
                            Kode otentikasi kamu *{{1}}*. Demi keamanan, jangan berikan kode RAHASIA ini kepada siapa pun.
                            
                        

Format

Name Description
Template Name Identifier of your template. After you requested the template and it approved you will get this template name.
Content Format You can apply any message formats such as Italic, Bold, Strikethrough and Monospace based on this page.
Parameter Placeholder Use Curly Bracket. Format: {{number}}.

Request

The request contains form data with target phone number and message in text format.

Curl Example

                            
                            curl --location --request POST 'https://api.motict.com/v1/wa/message' \
                            --header 'Authorization: api_key' \
                            --header 'Content-Type: application/json' \
                            --data-raw '{
                                "from": "+628123456789",
                                "to": "+628123456781",
                                "type": "template",
                                "template": {
                                    "name": "5f0b5191-7093-45b4-962f-f2943adec77b",
                                    "language": {
                                        "policy": "deterministic",
                                        "code": "id"
                                    },
                                    "components": [
                                        {
                                            "type": "body",
                                            "parameters": [
                                                {
                                                    "type": "text",
                                                    "text": "1234"
                                                }
                                            ]
                                        }
                                    ]
                                }
                            }'
                            
                        

Parameters

Name Type Required Description
api_key String Yes API key credential will be provided by Motict team.
from String Yes Your Whatsapp business phone number.
Phone numbers are in E.164 format (e.g., +6285123456790)
to String Yes Target phone number.
Phone numbers are in E.164 format (e.g., +6285123456790)
type String Yes Type of message
template.name String Yes Your template name.
template.language.policy String Yes Default: deterministic
template.language.code String Yes Default: id
template.components.type String Yes Default: body
template.components.parameters String Yes Your value placeholder. It is in array format and the order based on the number on your template paramater placeholder. Type default text.

Response

The response contains JSON body with message status whether the request is success or error. And also the message id that has been sent to the user.

Body

                            
                            {
                                "message": "success",
                                "data": {
                                    "id": "76034341-89aa-4da2-bc09-1db5dff632e4"
                                }
                            }
                            
                        

Parameters

Name Type Description
id String Whatsaap Message ID will be used as call identifier for each request
message String Success or error message. For error response, check Error section for mor details