chrishubert / whatsapp-api

This project is a REST API wrapper for the whatsapp-web.js library, providing an easy-to-use interface to interact with the WhatsApp Web platform.
https://www.christophehubert.com
Other
892 stars 401 forks source link

Receiving Empty POST Requests from Webhook #272

Closed Martin22 closed 1 month ago

Martin22 commented 1 month ago

Hi, I keep receiving empty POST messages from a webhook. I created a PHP script where I save the POST data to a file using $postData = print_r($_POST, true);, but when I check the file, the array is empty.

My docker-compose.yml configuration is:


services:
  app:
    container_name: whatsapp_web_api
    # build: .
    image: chrishubert/whatsapp-web-api:latest # Pull the image from Docker Hub
    restart: always
    ports:
      - "3000:3000"
    environment:
      # - API_KEY=your_global_api_key_here  # OPTIONAL
      - BASE_WEBHOOK_URL=http://10.38.253.184/wh.php
      - TEST_WEBHOOK_URL=http://10.38.253.184/wh2.php
      - ENABLE_LOCAL_CALLBACK_EXAMPLE=TRUE # OPTIONAL, NOT RECOMMENDED FOR PRODUCTION
      - MAX_ATTACHMENT_SIZE=5000000 # IN BYTES
      - SET_MESSAGES_AS_SEEN=TRUE # WILL MARK THE MESSAGES AS READ AUTOMATICALLY
      - ALL CALLBACKS: auth_failure|authenticated|call|change_state|disconnected|group_join|group_leave|group_update|loading_screen|media_uploaded|message|message_ack|message_create|message_reaction|message_revoke_everyone|qr|ready|contact_changed
      - DISABLED_CALLBACKS=message_ack|message_reaction  # PREVENT SENDING CERTAIN TYPES OF CALLBACKS BACK TO THE WEBHOOK
      - ENABLE_SWAGGER_ENDPOINT=TRUE # OPTIONAL, ENABLES THE /api-docs ENDPOINT
      # - RATE_LIMIT_MAX=1000 # OPTIONAL, THE MAXIUM NUMBER OF CONNECTIONS TO ALLOW PER TIME FRAME
      # - RATE_LIMIT_WINDOW_MS=1000 # OPTIONAL, TIME FRAME FOR WHICH REQUESTS ARE CHECKED IN MS
      # - WEB_VERSION='2.2328.5' # OPTIONAL, THE VERSION OF WHATSAPP WEB TO USE
      # - WEB_VERSION_CACHE_TYPE=none # OPTIONAL, DETERMINES WHERE TO GET THE WHATSAPP WEB VERSION(local, remote or none), DEFAULT 'none'
      # - RECOVER_SESSIONS=TRUE # OPTIONAL, SHOULD WE RECOVER THE SESSION IN CASE OF PAGE FAILURES
    volumes:
      - ./sessions:/usr/src/app/sessions # Mount the local ./sessions/ folder to the container's /usr/src/app/sessions folder