إرسال مقطع فيديو عبر الواتساب

إرسال مقاطع الفيديو الترويجية والتعليمية للعملاء.

POST
https://api.wawp.net/v2/send/video?access_token=123456789&asNote=false&caption=Watch+this+clip&chatId=201234567890%40c.us&convert=true&file%5Bfilename%5D=video.mp4&file%5Bmimetype%5D=video%2Fmp4&file%5Burl%5D=https%3A%2F%2Fwawp.net%2Fsamples%2Ffile_example_MP4_480_1_5MG.mp4&instance_id=123456789

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

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

تسجيل الدخول
اختبار /v2/send/video
POSTGET

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

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

توصيات

  • Use "reply_to" to maintain conversation context.

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

  • Implement a robust retry mechanism for failed sends.

Moving Pictures: Mastering the Video Messaging Engine

Video is the ultimate medium for complex information delivery, whether it's an educational tutorial, a personalized message from a CEO, or a visually rich product demonstration. The /v2/send/video endpoint is engineered to handle the substantial data and processing requirements of video files, ensuring they arrive on the recipient's phone in a format that is ready for instant playback.


🏗️ The Intelligent Video Processing Pipeline

Unlike basic file transfers, Wawp treats videos as dynamic assets. Our pipeline includes several specialized stages:

  1. Validation & Mime-Type Consistency: The engine checks the file[mimetype] against the actual binary headers. While MP4 is the standard, our engine can handle various containers and normalize them for the WhatsApp network.
  2. The "Conversion" Engine: One of Wawp's most powerful features is the convert flag. When enabled, the engine evaluates the source video's bitrate, resolution, and encoding (H.264/AAC). If the video is likely to be rejected by WhatsApp due to incompatible parameters, Wawp performs a cloud-based re-encoding to ensure a successful delivery.
  3. Stream Buffering: To prevent transient network failures from killing a transfer, our engine uses an adaptive buffering strategy when fetching videos from your remote file[url].

🛡️ Strategic Best Practices for Video Optimization

1. The 16MB Frontier

WhatsApp has a hard limit of 16MB for video transfers on most mobile devices.

  • Developer Action: If your source video is 50MB, do not send it directly. Use a pre-processing tool or our /v2/media/convert utility to bring it under the 16MB threshold.
  • Target Bitrate: Aim for a bitrate of 1.5 Mbps to 2 Mbps with a resolution of 480p or 720p. This strikes the perfect balance between visual clarity and file size safety.

2. Formatting for Success (MP4 vs. Others)

While many formats exist, MP4 (H.264) is the gold standard for Wawp.

  • Universal Playback: By sticking to H.264, you ensure that even users on older Android or iOS devices can play the video instantly without downloading additional codecs.
  • Audio Sync: Always ensure your audio is encoded in AAC at 44.1kHz or 48kHz to prevent "Mute Video" errors on the recipient's device.

3. AsNote: The "Video Note" Advantage

The asNote parameter allows you to send videos in the distinctive circular "Video Note" format.

  • UX Impact: Round video notes feel more personal and spontaneous. They are perfect for "Thank You" messages or quick status updates.
  • Constraint: Video notes are typically limited to 60 seconds and do not support captions. Ensure your content fits these constraints when switching to "Note" mode.

🧩 Advanced Use Cases

Educational Drip Campaigns

Videos are perfect for daily educational content. By using the caption field, you can provide a textual summary of the video's key points. Because Wawp supports full markdown, you can use *bold* headers to make the caption as engaging as the video itself.

Customer Support via Screen-Cast

Instead of explaining a complex UI step-by-step in text, send a 30-second screen-cast. Use the reply_to field to link the video directly to the user's specific support ticket, creating a high-resolution support experience.


🛠️ Common Pitfalls and Solutions

  • Failed Fetches: If your video server is behind a slow connection, the Wawp engine might timeout. Ensure your video host responds to GET requests within 5-10 seconds.
  • The "No Thumbnail" Bug: If a video arrives but the thumbnail is black, it’s often because the first frame of the video is black. Consider fading into your content or ensuring the metadata isn't corrupted.
  • Unsupported Codecs: Attempting to send H.265 (HEVC) or AV1 without setting convert: true may lead to a "Format Not Supported" error on older devices. Always default to true if you aren't 100% sure of your source encoding.

Summary of Capabilities:

  • Deliver high-quality MP4 videos with integrated, markdown-rich captions.
  • Automated cloud-based video re-encoding via the convert flag.
  • Support for the "Video Note" circular format for high-engagement messaging.
  • Remote fetching from any secure HTTPS URL with adaptive buffering.
  • Consistent success reporting with unique message_id generation for full delivery tracking.

البارامترات

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

محتوى الطلب

يرسل كـ 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

Video caption

مثال:
boolean

Attempt to convert video to compatible MP4 if needed

مثال:
boolean

Send as a round 'Video Note' (if supported by engine)

مثال:
string

Publicly accessible URL of the video

مثال:
string

Filename for the video

مثال:
string

MIME type of the video

مثال:

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

MCP READY

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

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

أمثلة الكود

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

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

Command Palette

Search for a command to run...