Explanation

Sending a message means sending a normal text message to your clients.


Remarks

  • You can use the "Send Message" API in one case only - for reply to a message that the client sent, within 24 hours since the client sent his last message. If you send a message to a new client, or try to send a message to an old client (old client means that 24 hours since client's last message has passed), you must use the "Send Template Message" API instead. If you send a template message to the client, and the client did not reply yet, and you want to send another message to him, you must use the template message again.
  • You can only send a message to private people, not groups.
  • The billing is per "conversation". conversation means a 24 hours session between you and the client (this 24 hours conversation session is unrelated to the 24 hours timer for template message)
  • You can send unlimited messages within the 24 hours session time of a conversation.
  • 24 hours session conversation starts when you send a message to the client.
  • Every time the user replies, the template message session resets. which means that you don't have to use template message during this 24 hours template message session.




Settings:

URL

https://api.99digital.co.il/whatsapp/v2/sendMessage

Method

JSON via POST



Body:

Parameter

Description / Example

Mandatory

apiKey

Your API key for the service

yes

from

your WhatsApp account. international number without +. for example: 972771234567

yes

to

The number you want to send the message to. for example: 972501234567

yes

body

your message goes here

\n for new line

*text* for bold

_text_ for italic

~text~ for strike through

yes

replyTo

In case you want to reply to a message that the end user has sent (quoted message), here you can provide the unique ID of that message

no

showRequest

You can get back in the response an object with all the request you sent (without the 'apiKey')

default is off (0)

1 - enable

no



Response:


{
"status": "OK",
"unique": "65dfd4r4dref34rdfxd34r",
"body": "your message",
"timestamp": 1600115719,
"from": "972507654321",
"to": "972501234567",
"templateTimeLeft": 1200,
"reason": 1
}




Response-Explain:

Parameter

Description

status

OK or FAIL


**Note: OK status doesn't mean the message arrived to the end user. it only means that the system received your request.

You should listen to webhooks to see the status of your message.

unique

Unique ID for any message

body

The text you sent

timestamp

Time stamp of the message

from

Your WhatsApp account

to

The number that the message was sent to

templateTimeLeft

Amount of minutes left since client's last message. if passed, you must use Template Message. This value resets every time the client is sending you a message.

conversationTimeLeft

Deprecated

this value is no longer in use.

Conversation time left is now part of the webhook response instead.

This parameter will be removed in future updates. until then, this value will show 0 always.

originalRequest

Original request object, if you enabled this in 'showRequest' when sending the request.

reason

'reason' is the status explanation in case of FAIL

1

not FAIL. the status is OK

2

Your "from" number account does not exist, or JSON syntax error

3

wrong apiKey

4

 'to' is either empty or wrong number format

5

'body' can't be empty

6

WhatsApp error - try again

7

You are trying to send a message but it has been more than 24 hours since client's last message. please use 'Send Template' instead

8

You are trying to send a message for first time to a contact. please use 'Send Template' message instead

9

rate limit error, try again