REST API not working

For months, I’ve been trying to use the REST API; however, the support hasn’t been able to assist me, and errors consistently occur. Thanks to another thread in this forum, I learned that I needed to create an empty field for the body to retrieve the propertyId. Unfortunately, that’s the only progress I’ve made. I attempted to fetch the list of chats or any other information using the REST API with Basic Auth, but it seems to be simply impossible.

I sent the following request:

curl --location ‘https://api.tawk.to/v1/ticket.list
-H “Content-Type: application/json”
-u XXXXX:
-d ‘{
“propertyId”: “YYYYYY”,
“size”: 0,
“startDate”: “2023-11-01T14:15:22Z”,
“endDate”: “2023-11-17T14:15:22Z”,
“messageCount”: 0,
“deleted”: false,
“status”: “closed”,
“tags”: [
“string”
],
“sort”: “co-new-old”,
“dateType”: “cso”
}’

I’ve tried various versions of this request, but the response remains the same:

{
“ok”: false,
“error”: “auth_error”,
“message”: “invalid_auth”
}

The only way I managed to retrieve the propertyId was with the following command:

curl --location ‘https://api.tawk.to/v1/property.list
–header ‘Content-Type: application/x-www-form-urlencoded’
–header ‘Authorization: Basic XXXXXXXX’
–data-urlencode ‘=’

What can I be doing, or what should I do, to retrieve the list of chats?

I have the same or similar problem to @Ruan. I posted the following back in September and I have been emailing Tawk staff for months but no advice so far.

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.