waha
waha copied to clipboard
[GOWS] - GET /api/contacts endpoint returns a 500 error
Describe the bug
When trying to retrieve a contact using the GET /api/contacts endpoint, the API returns a 500 error. The response indicates a TypeError due to an invalid argument type. The error message states that the 'original' argument must be of type function but received undefined.
Version
{
"version": "2025.3.1",
"engine": "GOWS",
"tier": "PLUS"
}
Steps
To Reproduce Steps to reproduce the behavior:
- Send a
GETrequest to/api/contactswith a validcontactIdandsession. - Observe the
500response.
Expected behavior
The API should return the contact information instead of failing with a TypeError.
Requests - Responses
Request:
curl -X 'GET' 'https://[BASE_URL]/api/contacts?contactId=[CONTACT_ID]&session=[SESSION_ID]' \
-H 'accept: */*' \
-H 'X-Api-Key: [API_KEY]'
Response:
{
"statusCode": 500,
"timestamp": "2025-03-28T01:58:07.865Z",
"exception": {
"stack": "TypeError [ERR_INVALID_ARG_TYPE]: The 'original' argument must be of type function. Received undefined\n at ...",
"code": "ERR_INVALID_ARG_TYPE",
"message": "The 'original' argument must be of type function. Received undefined",
"name": "TypeError"
},
"request": {
"path": "/api/contacts",
"method": "GET",
"query": {
"contactId": "[CONTACT_ID]",
"session": "[SESSION_ID]"
}
},
"version": {
"version": "2025.3.1",
"engine": "GOWS",
"tier": "PLUS"
}
}
Docker Logs
The error in the Docker logs matches the one returned by the API.
Screenshots
Additional context
It appears that the function WhatsAppSessionGOWSPlus.getContact() is not receiving a valid argument, causing a TypeError. This might be due to an undefined or missing parameter in the request.