Get Screenshot

Returns a base64-encoded screenshot of the current WhatsApp engine state.

GET
https://api.wawp.net/v2/auth/screenshot?access_token=YOUR_ACCESS_TOKEN&instance_id=Your_Instance_ID&session_name=default

Authentication Required

Login to swap the placeholders with your real Instance ID and Access Token.

Log In
Test /v2/auth/screenshot endpoint
GETPOST

No query parameters required

This endpoint doesn't expect data in the URL.

Best practices

  • Use only for debugging failed connection attempts.

  • Check for 'Logout' or '2FA' prompts visible in the screenshot.

  • Do not poll this endpoint continuously in production.

Visual Forensics: Debugging with the Screenshot Endpoint

The /v2/auth/screenshot endpoint is the "X-Ray" tool of the Wawp platform. Because our engines run in highly optimized, headless environments, developers often feel "blind" when a session fails to link. This endpoint provides a high-fidelity, real-time snapshot of exactly what the Chromium browser engine is rendering. It is the ultimate tool for audit logging, technical support, and protocol verification.


🏗️ Technical Specifications

The response is a JSON envelope containing:

  • mimetype: Fixed as image/png.
  • data: A Base64-encoded string representing the raw pixels of the engine's current display.

Decoding for Visualization

To view the screenshot in a browser or admin dashboard, use the standard Base64 image pattern:

<img src="data:image/png;base64,{{response.data}}" alt="Engine State" />

🛡️ Strategic Use Cases for Debugging

1. Identifying "Manual Interaction" Blockers

Sometimes, WhatsApp displays a modal message that cannot be handled by standard automation logic.

  • The "Logout" Confirmation: If a user tries to link a device that is already linked elsewhere, WhatsApp might show a "Confirm Logout" popup. The screenshot will reveal this immediately, allowing your support staff to tell the user: "Please click 'Confirm' on your phone."
  • Two-Step Verification: If the account has a PIN enabled, the screenshot will show the PIN entry screen, signaling that you need to use our account-meta endpoints to submit the 2FA code.

2. QR Visibility Audits

If your frontend claims the QR has loaded, but users say it’s not scanning, use the screenshot endpoint to verify:

  • Is the QR actually there? (Sometimes network jitter on the WhatsApp side causes a blank screen).
  • Is it a different version? (WhatsApp periodically updates its UI; the screenshot helps you stay ahead of these changes).

🛡️ Best Practices & Performance

A. Resource Awareness

Unlike simple status checks, generating a screenshot involves a "Capture and Encode" cycle within the Chromium container.

  • Recommendation: Do not poll this endpoint automatically every second. It should be triggered "On-Demand" by a support agent or when your backend detects an unusually long SCAN_QR_CODE duration (e.g., > 2 minutes).

B. Security and Privacy

Screenshots are transient. Wawp does not store these images on our persistent disks.

  • Developer Action: If you need to keep an audit log of connection states for compliance (e.g., in a regulated Fintech environment), you must fetch the screenshot and store it in your own secure storage (S3/Cloud Storage).

💡 Advanced Automation: "Visual OCR"

Sophisticated developers use the screenshot endpoint in combination with OCR (Optical Character Recognition) libraries like Tesseract. This allows your system to "read" error messages directly from the WhatsApp UI and transform them into actionable logs:

  • "The number provided is banned."
  • "The battery is too low to sync."
  • "Checking for messages..."

Summary of Capabilities:

  • Visualize the raw state of the headless WhatsApp engine.
  • Identify 2FA prompts and confirmation modals instantly.
  • Perform high-fidelity audit logging for connection events.
  • Empower support staff to see what the user sees without manual screen sharing.

Request Parameters

Configure the parameters required to interact with this endpoint. All query and body arguments are listed below with their details.

Query Parameters & Request Body

Supported in URL Query String or JSON Body
string

The 12-character ID of the instance

Example:
string

Your API Access Token

Example:
string—

Optional session name (alternative to instance_id).

Example:

Build with AI using Wawp MCP

MCP READY

Connect Wawp API directly to Cursor, Windsurf, or Claude Desktop. Let AI write, test, and execute your WhatsApp integration code automatically!

How to Connect

Request Samples

Use these ready-to-go code snippets to integrate our API into your project quickly and efficiently. Choose your preferred language and library.

1const baseUrl = "https://api.wawp.net";
2const endpoint = "/v2/auth/screenshot";
3const params = new URLSearchParams({
4 "instance_id": "Your_Instance_ID",
5 "access_token": "YOUR_ACCESS_TOKEN",
6 "session_name": "default"
7}).toString();
8
9
10fetch(`${baseUrl}${endpoint}${params ? '?' + params : ''}`, {
11 method: "GET",
12 headers: { "Content-Type": "application/json" },
13
14})
15 .then(async (response) => {
16 if (response.ok) {
17 const data = await response.json();
18 console.log("Success:", data);
19 return data;
20 }
21
22 // Error Handling
23 if (response.status === 400) {
24 console.error("Error 400: Bad Request - Missing Required Parameter(s)");
25 }
26 if (response.status === 400) {
27 console.error("Error 400: Bad Request (XML Format)");
28 }
29 if (response.status === 400) {
30 console.error("Error 400: Bad Request (Plain Text)");
31 }
32 if (response.status === 401) {
33 console.error("Error 401: Unauthorized - Invalid or Missing Access Token");
34 }
35 if (response.status === 401) {
36 console.error("Error 401: Unauthorized (XML Format)");
37 }
38 if (response.status === 404) {
39 console.error("Error 404: Not Found - Session Does Not Exist");
40 }
41 if (response.status === 404) {
42 console.error("Error 404: Not Found (XML Format)");
43 }
44 if (response.status === 500) {
45 console.error("Error 500: Internal Server Error - Unexpected Failure");
46 }
47 if (response.status === 500) {
48 console.error("Error 500: Internal Server Error (HTML)");
49 }
50 if (response.status === 502) {
51 console.error("Error 502: Bad Gateway - Connection Failed to Upstream");
52 }
53 if (response.status === 502) {
54 console.error("Error 502: Bad Gateway (XML Format)");
55 }
56
57 const errorText = await response.text();
58 console.error(`Error ${response.status}: ${errorText}`);
59 })
60 .catch((error) => console.error("Network Error:", error));
Interactive Samples
Ln 60, Col 1javascript

Expected Responses

Explore all possible responses and outcomes from the server. We have documented each status code with data examples to make success and error handling easier.

Success - Screenshot Data
Type:
application/json
string *
string *

Example

{
"mimetype": "image/png",
"data": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk+A8AAQUBAScY42YAAAAASUVORK5CYII="
}
Bad Request - Missing Required Parameter(s)
Unauthorized - Invalid or Missing Access Token
Not Found - Session Does Not Exist
Internal Server Error - Unexpected Failure
Bad Gateway - Connection Failed to Upstream
Previous TopicGet QR Image
Next TopicSend OTP

Command Palette

Search for a command to run...