Examples of using the Tawk.to REST API (not the JavaScript API)

Are there any examples (ideally in Python) showing how to use the Tawk.to REST API? I need to retrieve our Inbox messages. In our case they are all ‘Offline Form’ ones that are sent as email notifications but I want to capture them via API. I have a Tawk.to REST API key.
Searching for an answer all end up with the JavaScript API documentation, which is not want I want.
I’ve seen a hint that the endpoint might be “https://api.tawk.to/v1/conversations” but so far I’ve not got it working.
Thanks!

2 Likes

Hi Jim,

This article will guide you on how to access and start using the tawk.to REST API:

Once access has been granted, you will receive a link with the credentials to access the documentation via email.

Let me know if you have any other queries.

Thanks,
Kristaps

1 Like

Hi Kristaps,

Thank you, I’ve visited that page earlier to request access. Do you know how long it normally takes to grant access?

Best regards

Jim

Hi Jim,

This typically takes less than 24 hours. I believe the team has already sent you an email with the credentials.

Please check your inbox for emails from tawk.to.

If you cannot find the email, just let me know and we’ll resend it – no worries!

Thanks,
Kris

Hi Kris,

Thank you, the email came through early this morning.

Best regards

Jim

1 Like

Hi @kristaps,
I have signed up around 2 weeks back and tried to follow the REST api docs, but still unable to login via all the means e.g. curl example given in docs, postman.

I am unable to generate access token as I didn’t receive any client_id, can you please assist.

Thanks

Hi @FarrukhAyyaz, we see that your account has been granted access to the REST API.

You can generate the API access key from your profile by following these steps:

Let us know if you need any further assistance.

If someone is in need that encounters error like:

{
“ok”: false,
“error”: “validation_error”,
“message”: “body”
}

please send body as an empty object

Thanks for sharing.

I need to obtain Tawk messages but have run into a problem.

The following curl returns two of our earliest tickets, but that is all:

curl -X POST 'https://api.tawk.to/v1/ticket.list' \
-u <API_KEY>: \
-H "Content-Type: application/json" \
-d '{"propertyId": "<propertyId>"}'

When I try to send any more key-value pairs in the JSON body it just returns:
{"ok":true,"total":0,"data":[]}

Based on the documentation (https://docs.tawk.to/?shell#list-tickets-of-a-property), I had the following:

-d '{"propertyId": "<propertId>","size": 2,"startDate": "2023-01-01T00:00:00Z","endDate": "2023-05-31T23:59:59Z","deleted": false,"status": "open","sort": "co-new-old","dateType": "cso"}'

I have tried each key-value pair one at a time, and different variations of the date format, shorter date ranges, and different values for size, and I just get back: {"ok":true,"total":0,"data":[]}

I only get two early tickets returned if I only send propertyID without any other key value pairs.

Has anyone had more success at retrieving messages?

btw - https://api.tawk.to/v1/property.list returns two propertyId key-value pairs with different values. Evidently we have to use the first one.

I submitted a requesting for the API do you know how long it takes to get approved?

Hi @corybaker, the team should contact you within 24-48 hours from the time it was requested. For further support, please contact support@tawk.to.

i submited the request at last week,but i still haven’t received a mail from team and seen the function on my dashboard,and i want to ask if rest api can do respond user by programming?