Sending plain text
#
Method#
/send-textPOST
https://api.z-api.io/instances/YOUR_INSTANCE/token/YOUR_TOKEN/send-text
#
HeaderKey | Value |
---|---|
Client-Token | ACCOUNT SECURITY TOKEN |
#
ConceptIn this method you will be able to send simple texts, you can add to them by using the formatting of text and emojis. In case you don’t know how to do that, you can click the links below and follow the instructions:
To format texts on WhatsApp click here
You can also use line breaks in your messages however, this can be done in different ways. This will depend on the platform that you are using as well as the language, up until this moment we have identified the following.
- \n
- \r
- \r\n
- %0a
Identify which will be the most adequate for your case.
If you can find a different way of doing a line break please let us know :)
- Another resource that you can explore and use are emojis, if need be you can find a few here link
Sobre emojis
What you need to know is that it is a normal ASCII character. Just like there are character fonts you can have emoji fonts. You are actually able to create your own gallery of emojis!
To test this, just copy an emoji and paste into your text! You can use this one 🤪 if you’d like
#
Attributes#
RequiredAttributes | Type | Description |
---|---|---|
phone | string | Recipient (or group ID in case you want to send it to a group) telephone number in the format DDI DDD NUMERS Ex: 551199999999. IMPORTANT only send numbers without formatting or a mask |
message | string | Text to be sent |
#
OptionalAttributes | Type | Description |
---|---|---|
delayMessage | number | In this attribute a delay is added to the message. You can decide between a range of 1 - 15 secs (this is for how many seconds it will wait to send the next message EX: “delayMessage”:5,). The default delay is between 1 - 3 secs |
delayTyping | number | In this attribute, a delay is added to the message. You can choose from a range of 1 to 15 seconds, which indicates how many seconds it will remain in the "Typing..." status. (For example, "delayTyping": 5). The default delay if not specified is 0. |
editMessageId | string | This attribute allows you to edit previously sent messages on WhatsApp. Use the message ID and the new content in the JSON to make changes. It's necessary to configure the webhook before edit. |
#
Request Body#
Response#
200Attributes | Type | Description |
---|---|---|
zaapId | string | id on z-api |
messageId | string | id on whatsapp |
Example
#
405In this case certify that you are sending the correct specification of the method. This means, verify if you sent a POST or GET as specified at the beginning of this topic.
#
415In case you receive 415 error, make sure to add the “Content-Type” of the object you are sending in the request headers, mostly “application/json”
#
Webhook ResponseLink to webhook response (on receipt)