إرسال تفاعل (Reaction Emoji)

إرسال تفاعلات الإيموجي على الرسائل الواردة والصادرة.

PUT
https://api.wawp.net/v2/send/reaction?access_token=YOUR_ACCESS_TOKEN&chatId=201234567890%40c.us&instance_id=123456789&messageId=false_20123456789%40c.us_3F351BFA105BA281C054&reaction=%F0%9F%91%8D

تسجيل الدخول مطلوب

سجل الدخول لاستبدال المعرفات (Instance ID) ورمز الوصول (Access Token) بمعلومات حسابك الحقيقي لاختبار ال API مباشرة.

تسجيل الدخول
اختبار /v2/send/reaction
PUT
PUT

لا توجد معاملات استعلام مطلوبة

هذه النهاية الطرفية لا تتوقع بيانات في الرابط.

توصيات

  • Use "reply_to" to maintain conversation context.

  • Handle distinct message types (text, image, video) appropriately.

  • Implement a robust retry mechanism for failed sends.

Micro-Interactions: Mastering the Message Reaction Engine

Reactions (/v2/send/reaction) are one of the most powerful micro-interactions in a modern messaging ecosystem. They allow users and bots to acknowledge information, express sentiment, or provide feedback without the friction of a full text reply. In a Wawp-powered application, reactions aren't just cosmetic; they are structural signals that can be used to track engagement, build interactive voting systems, or simplify bot-to-user acknowledgements.


🏗️ The Reaction Lifecycle Architecture

Unlike full messages, reactions are additive metadata attached to an existing message. Wawp’s reaction engine manages this attachment with high precision:

  1. Target Identification: The engine uses the messageId to locate the specific message on the WhatsApp backend. This must be the unique ID of an existing message in the chat identified by chatId.
  2. Emoji Normalization: While you can send any emoji, Wawp ensures the character is correctly encoded for the WhatsApp WebSocket. If you send an empty string (""), the engine interprets this as a "Delete Reaction" command, instructing the WhatsApp network to remove your previous sentiment from that particular message.
  3. Atomic Delivery: Reactions are delivered as light-weight, high-priority packets. This ensures that a reaction appears almost instantaneously on the recipient's phone, making the chat feel "Live" and responsive.

🛡️ Strategic Best Practices for Sentiment Engagement

1. The "Standard Set" Strategy

While WhatsApp supports any emoji as a reaction, users are most accustomed to the "Standard Quick Actions": 👍 (Acknowledgement), ❤️ (Love/Quality), 😂 (Laughter), 😮 (Surprise), 😢 (Sympathy), and 🙏 (Thanks).

  • UX Impact: By sticking to these standards, you match the user's muscle memory.
  • Compatibility: Rare or complex combined emojis (like multi-colored family units) can sometimes render inconsistently across older Android or Desktop versions. Standard emojis are universally safe.

2. Automated Acknowledgements

Modern bots shouldn't always respond with text.

  • Example: If a user says "Got it!" or "Thanks!", instead of the bot replying with "You're welcome!" (another message for the user to clear), have the bot react with a 👍 or 💙.
  • Value: This keeps the chat history clean while still providing the user with positive reinforcement that their input was received.

3. Removal and Cleanup

Don't let outdated sentiments linger.

  • Workflow: If your bot reacts with a ⏳ (Processing) while it’s working on a long task, make sure to call the endpoint again with an empty string "" to remove the ⏳ once the task is finished, or replace it with a ✅ (Done). This prevents the UI from becoming cluttered with conflicting status emojis.

🧩 Advanced Use Cases

Lightweight Interactive Voting

You can build a low-friction voting system by asking a question and having users react with different emojis for different options.

  • Logic: Use your Webhooks (message.reaction) للاستماع إلى التفاعلات الواردة من المستخدمين. Your backend then tallies the counts for each emoji type, enabling "Reactions-as-Votes" functionality without a single line of extra UI code.

Sentiment Monitoring for Human Agents

When an automated flow is running, have your system monitor the emojis users react with. If a user consistently reacts with 😢 or 😠 to bot messages, your system can interpret this as a "Frustration Signal" and automatically escalate the chat to a human agent.


🛠️ Common Pitfalls and Solutions

  • The "Missing ID" Error: If you provide a correctly formatted messageId but the message was sent too long ago (typically several weeks), the reaction may fail. Reactions are most reliable when applied to recent (active) conversation history.
  • Rapid Re-Reaction: Sending five different reactions to the same message in one second can be flagged as "Suspicious Scripting." Implement a small jitter or debounce (at least 200ms) between reaction updates to the same target message.
  • Encryption Resync: In rare cases, if a session's security keys are out of sync, a reaction might fail while standard text succeeds. A quick /v2/session/restart usually resolves these synchronization edge cases.

Summary of Capabilities:

  • Apply and remove native WhatsApp reactions (emojis) to any existing message.
  • Support for "Delete Reaction" via empty string payloads.
  • High-concurrency support for voting and acknowledgement systems.
  • Real-time event tracking through message.reaction Webhooks.
  • Lightweight and low-priority execution to minimize chat-history clutter.

البارامترات

قم بتهيئة المعاملات المطلوبة للتفاعل مع نقطة النهاية هذه. جميع وسائط الاستعلام والبيانات مدرجة أدناه مع تفاصيلها.

محتوى الطلب

يرسل كـ JSON
string

Your unique WhatsApp Instance ID

مثال:
string

Your API Access Token

مثال:
string

Recipient's WhatsApp ID (JID). Supports Individuals (@c.us), Groups (@g.us), and Newsletters (@newsletter).

مثال:
string

The ID of the message you want to react to.

مثال:
string

The emoji reaction. Use an empty string to remove.

مثال:

برمج بالذكاء الاصطناعي باستخدام Wawp MCP

MCP READY

قم بربط الـ API مباشرة مع Cursor أو Windsurf أو Claude Desktop، ودع الذكاء الاصطناعي يكتب لك كود الربط وينفذه تلقائياً!

طريقة الربط والإعداد

أمثلة الكود

استخدم أمثلة الكود الجاهزة لدمج واجهة برمجة التطبيقات (API) في مشروعك بسرعة وكفاءة. اختر لغة البرمجة والمكتبة التي تفضلها.

1const baseUrl = "https://api.wawp.net";
2const endpoint = "/v2/send/reaction";
3const params = new URLSearchParams({
4 "instance_id": "123456789",
5 "access_token": "YOUR_ACCESS_TOKEN"
6}).toString();
7const body = {
8 "chatId": "201234567890@c.us",
9 "messageId": "false_20123456789@c.us_3F351BFA105BA281C054",
10 "reaction": "👍"
11};
12
13fetch(`${baseUrl}${endpoint}${params ? '?' + params : ''}`, {
14 method: "PUT",
15 headers: { "Content-Type": "application/json" },
16 body: JSON.stringify(body)
17})
18 .then(async (response) => {
19 if (response.ok) {
20 const data = await response.json();
21 console.log("Success:", data);
22 return data;
23 }
24
25 // Error Handling
26 if (response.status === 400) {
27 console.error("Error 400: طلب غير صالح - معاملات مطلوبة مفقودة");
28 }
29 if (response.status === 400) {
30 console.error("Error 400: طلب غير صالح - الرقم المستهدف في قائمة الحظر الخاصة بك");
31 }
32 if (response.status === 400) {
33 console.error("Error 400: طلب غير صالح - المستلم قام بإلغاء الاشتراك تلقائياً");
34 }
35 if (response.status === 400) {
36 console.error("Error 400: Bad Request - Invalid Number (Egypt)");
37 }
38 if (response.status === 400) {
39 console.error("Error 400: Bad Request - Invalid Number (Saudi Arabia)");
40 }
41 if (response.status === 400) {
42 console.error("Error 400: Bad Request - Invalid Number (Unknown)");
43 }
44 if (response.status === 400) {
45 console.error("Error 400: طلب غير صالح (تنسيق XML)");
46 }
47 if (response.status === 400) {
48 console.error("Error 400: طلب غير صالح (نص عادي)");
49 }
50 if (response.status === 401) {
51 console.error("Error 401: غير مصرح - مفتاح الوصول غير صالح أو مفقود");
52 }
53 if (response.status === 401) {
54 console.error("Error 401: غير مصرح (تنسيق XML)");
55 }
56 if (response.status === 404) {
57 console.error("Error 404: غير موجود - الجلسة غير موجودة");
58 }
59 if (response.status === 404) {
60 console.error("Error 404: غير موجود (تنسيق XML)");
61 }
62 if (response.status === 429) {
63 console.error("Error 429: طلبات كثيرة جداً - تم تجاوز حد المعدل");
64 }
65 if (response.status === 500) {
66 console.error("Error 500: خطأ في الخادم الداخلي - فشل غير متوقع");
67 }
68 if (response.status === 500) {
69 console.error("Error 500: خطأ في الخادم الداخلي (HTML)");
70 }
71 if (response.status === 502) {
72 console.error("Error 502: بوابة غير صالحة - فشل الاتصال بالخادم الرئيسي");
73 }
74 if (response.status === 502) {
75 console.error("Error 502: بوابة غير صالحة (تنسيق XML)");
76 }
77
78 const errorText = await response.text();
79 console.error(`Error ${response.status}: ${errorText}`);
80 })
81 .catch((error) => console.error("Network Error:", error));
عينات تفاعلية
Ln 81, Col 1javascript

الردود المتوقعة

استكشف كافة الردود والنتائج المحتملة من الخادم. قمنا بتوثيق كل كود حالة (Status Code) مع أمثلة للبيانات لتسهيل معالجة الأخطاء والنجاح.

تم إرسال الرسالة بنجاح
النوع:
application/json
object *
string *
object *
number *
boolean *
string *
string *
number *
string *
string *
string *
boolean *
number *
boolean *
boolean *
boolean *
boolean *
boolean *
array *
array *
array *
boolean *
array *

Example

{
"_data": {
  "id": {
    "fromMe": true,
    "remote": "000000000000@c.us",
    "id": "MSG_ID_123456",
    "_serialized": "true_000000000000@c.us_MSG_ID_123456"
    },
  "viewed": false,
  "body": "BASE64_IMAGE_DATA",
  "type": "image",
  "t": 1759108866,
  "from": {
    "server": "c.us",
    "user": "111111111111",
    "_serialized": "111111111111@c.us"
    },
  "to": {
    "server": "c.us",
    "user": "000000000000",
    "_serialized": "000000000000@c.us"
    },
  "ack": 0,
  "isNewMsg": true,
  "star": false,
  "kicNotified": false,
  "caption": "Here's your requested image.",
  "deprecatedMms3Url": "https://example.com/media-url",
  "directPath": "/media/direct/path/example",
  "mimetype": "image/jpeg",
  "filehash": "FILE_HASH_PLACEHOLDER",
  "encFilehash": "ENC_FILE_HASH_PLACEHOLDER",
  "size": 192487,
  "mediaKey": "MEDIA_KEY_PLACEHOLDER",
  "mediaKeyTimestamp": 1759108865,
  "streamable": false,
  "mediaHandle": null,
  "isFromTemplate": false,
  "pollInvalidated": false,
  "isSentCagPollCreation": false,
  "latestEditMsgKey": null,
  "latestEditSenderTimestampMs": null,
  "mentionedJidList": {
    },
  "groupMentions": {
    },
  "isEventCanceled": false,
  "eventInvalidated": false,
  "isVcardOverMmsDocument": false,
  "isForwarded": false,
  "isQuestion": false,
  "questionReplyQuotedMessage": null,
  "questionResponsesCount": 0,
  "readQuestionResponsesCount": 0,
  "labels": {
    },
  "hasReaction": false,
  "disappearingModeInitiator": "chat",
  "disappearingModeTrigger": "chat_settings",
  "productHeaderImageRejected": false,
  "lastPlaybackProgress": 0,
  "isDynamicReplyButtonsMsg": false,
  "isCarouselCard": false,
  "parentMsgId": null,
  "callSilenceReason": null,
  "isVideoCall": false,
  "callDuration": null,
  "callCreator": null,
  "callParticipants": null,
  "isCallLink": null,
  "callLinkToken": null,
  "isMdHistoryMsg": false,
  "stickerSentTs": 0,
  "lastUpdateFromServerTs": 0,
  "invokedBotWid": null,
  "bizBotType": null,
  "botResponseTargetId": null,
  "botPluginType": null,
  "botPluginReferenceIndex": null,
  "botPluginSearchProvider": null,
  "botPluginSearchUrl": null,
  "botPluginSearchQuery": null,
  "botPluginMaybeParent": false,
  "botReelPluginThumbnailCdnUrl": null,
  "botMessageDisclaimerText": null,
  "botMsgBodyType": null,
  "requiresDirectConnection": false,
  "bizContentPlaceholderType": null,
  "hostedBizEncStateMismatch": false,
  "senderOrRecipientAccountTypeHosted": false,
  "placeholderCreatedWhenAccountIsHosted": false,
  "galaxyFlowDisabled": false,
  "links": {
    }
  },
"mediaKey": "MEDIA_KEY_PLACEHOLDER",
"id": {
  "fromMe": true,
  "remote": "000000000000@c.us",
  "id": "MSG_ID_123456",
  "_serialized": "true_000000000000@c.us_MSG_ID_123456"
  },
"ack": 0,
"hasMedia": true,
"body": "Here's your requested image.",
"type": "image",
"timestamp": 1759108866,
"from": "111111111111@c.us",
"to": "000000000000@c.us",
"deviceType": "android",
"isForwarded": false,
"forwardingScore": 0,
"isStatus": false,
"isStarred": false,
"fromMe": true,
"hasQuotedMsg": false,
"hasReaction": false,
"vCards": {
  },
"mentionedIds": {
  },
"groupMentions": {
  },
"isGif": false,
"links": {
  }
}
طلب غير صالح - معاملات مطلوبة مفقودة
غير مصرح - مفتاح الوصول غير صالح أو مفقود
غير موجود - الجلسة غير موجودة
طلبات كثيرة جداً - تم تجاوز حد المعدل
خطأ في الخادم الداخلي - فشل غير متوقع
بوابة غير صالحة - فشل الاتصال بالخادم الرئيسي
الموضوع السابقإيقاف مؤشر الكتابة (Stop Typing)
الموضوع التاليإدارة الدردشة

Command Palette

Search for a command to run...