Maytapi icon

Maytapi

Integrate with Maytapi WhatsApp Unofficial API

Session → Get QR Code

AI-generated

Overview

This node integrates with the Maytapi WhatsApp Unofficial API to perform various WhatsApp-related actions. Specifically, for the Session resource and Get QR Code operation, it retrieves the current session's QR code image from the WhatsApp instance. This QR code is typically used to authenticate or connect a WhatsApp session by scanning it with the WhatsApp mobile app.

Common scenarios:

  • Automating WhatsApp session setup by programmatically obtaining the QR code.
  • Displaying the QR code in a custom dashboard or workflow for user scanning.
  • Monitoring or managing WhatsApp sessions remotely.

Practical example:
You want to automate the onboarding of new WhatsApp sessions in your system. Using this node, you can fetch the QR code image, send it via email or display it on a web interface, allowing users to scan and activate their WhatsApp session without manual intervention.


Properties

Name Meaning
Phone ID Source Select how to provide the Phone ID for the WhatsApp instance:
- From Credentials
- Custom (enter manually)
Phone ID The WhatsApp instance Phone ID (required if "Custom" is selected as Phone ID Source).

Note: The Phone ID identifies the specific WhatsApp instance to interact with. It can be provided either from stored credentials or entered manually.


Output

The output contains:

  • A JSON object indicating success and a message, e.g., { success: true, message: "QR Code retrieved successfully" }.
  • A binary data field containing the QR code image in PNG format. This binary data can be used directly in n8n workflows to save the image, display it, or send it elsewhere.

Output example structure:

{
  "json": {
    "success": true,
    "message": "QR Code retrieved successfully"
  },
  "binary": {
    "data": {
      "data": "<Buffer ...>",
      "mimeType": "image/png",
      "fileName": "qrcode_<PhoneID>_<timestamp>.png"
    }
  }
}

Dependencies

  • Requires an active connection to the Maytapi WhatsApp API service.
  • Needs an API key credential configured in n8n to authenticate requests.
  • The Phone ID must correspond to a valid WhatsApp instance registered with Maytapi.
  • Network access to https://api.maytapi.com/api is required.

Troubleshooting

  • Missing Phone ID error:
    If neither credentials nor custom Phone ID is provided, the node throws an error stating that Phone ID is required. Ensure you have set the Phone ID correctly.

  • Invalid API key or authentication failure:
    If the API key credential is invalid or missing, requests will fail. Verify your API key configuration.

  • Network errors or timeouts:
    Ensure your environment has internet access and can reach the Maytapi API endpoint.

  • Binary data handling issues:
    When using the QR code image output, ensure subsequent nodes support binary data input.


Links and References

Discussion