waha icon indicating copy to clipboard operation
waha copied to clipboard

[GOWS] - GET /api/contacts endpoint returns a 500 error

Open higorrezend opened this issue 1 year ago • 1 comments

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:

  1. Send a GET request to /api/contacts with a valid contactId and session.
  2. Observe the 500 response.

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

Error Screenshot

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.

patron:PLUS

higorrezend avatar Mar 28 '25 02:03 higorrezend

fixed in 2025.3.2 https://github.com/devlikeapro/waha/issues/866

patron:PRO

devlikepro avatar Mar 28 '25 03:03 devlikepro