Get History

Get history allows you to see all chat history per conversation or for your entire WhatsApp number.

We keep the chat history for 1 year. every message that is stored for more than 1 year will be deleted.

The files are stored as links, which are deleted in 7 days.

Settings:

URL

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

Method

JSON via POST


Body:

Parameter

Description / Example

apiKey

Your API key for the service

from

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

to

You can choose which contact to get the chat history for. if you leave this empty, you will get the history for all your WhatsApp account. for example: 972509876543

page

Mandatory. integer number. every page shows the last 50 messages.

for example, page '1' will show last known messages from 1 to 50

page '2 will show last known messages from message 51 to 100.


Response:

[
    {
        "unique": "3EB08F941940DDC30F58",
        "timestamp": "1614198777",
        "direction": "2",
        "from": "972501234567",
        "to": "972502222222",
        "type": "chat",
        "state": 1,
        "message": "outgoing message"
    },
    {
        "unique": "3EB08F941940DDCFGF58",
        "timestamp": "1614198211",
        "direction": "1",
        "from": "972523443432",
        "to": "972501234567",
        "type": "chat",
	"state": 0,
        "message": "incoming message"
    }
]

Response-Explain:

Parameter

Description

unique

The unique ID of the message

timestamp

The timestamp for the message

direction

'1' for incoming message. '2' for outgoing message

(incoming messages are messages that are coming to the webhook. outgoing messages are messages you sent using the API)

from

The chat that sent the message

to

the chat that received the message

type

message type, depends on the direction

direction

available message types

1

text, image, audio, video, location, ptt, document

2

text, file, location, ptt

message

The message that was sent

state

this state is only relevant for outgoing messages

value

information

0

acknowledge that the message was failed to deliver

1

acknowledge that the message was received by the server (1 gray check mark) 

2

acknowledge that the message was delivered (2 gray check mark)

3

acknowledge that the message was read (2 blue check mark)

reason

'reason' is the status explanation in case of FAIL. this does not explain the state '0' for failed messages.

2

WhatsApp account does not exist

3

wrong apiKey

4

 'from' is either empty or wrong number format

11

'page' is invalid or empty.