إرسال بطاقة جهة اتصال (vCard)

مشاركة أرقام وبطاقات الاتصال الموثقة مع المشتركين.

POST
https://api.wawp.net/v2/send/contact?access_token=YOUR_ACCESS_TOKEN&chatId=201234567890&contacts=%5B%0A++%7B%0A++++%22fullName%22%3A+%22Wawp+Support%22%2C%0A++++%22organization%22%3A+%22Wawp+HQ%22%2C%0A++++%22phoneNumber%22%3A+%22%2B201111111111%22%2C%0A++++%22whatsappId%22%3A+%22201111111111%22%0A++%7D%0A%5D&instance_id=123456789&reply_to=false_111...AAAA

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

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

تسجيل الدخول
اختبار /v2/send/contact
POST
POST

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

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

Professional Identity: Mastering the Contact Card (vCard) Engine

In a professional ecosystem, sharing contact information shouldn't be about typing out phone numbers. The /v2/send/contact endpoint allows you to share digital business cards (vCards) that are interactive, easy to save, and high-fidelity. By automating the sharing of contact cards, you can streamline the "Agent Handoff" process, provide instant access to emergency helplines, or share specialized technician details with a single API call.

send contact.png


🏗️ The VCard Serialization Pipeline

Sharing a contact via Wawp is more than just sending a name. Our engine manages a sophisticated serialization process to ensure compatibility with both Android and iOS contact managers:

  1. vCard Specification Encoding: Wawp takes your JSON contact array and transcribes it into the standard vCard (VCF) v3.0 format. This format is universally recognized by mobile operating systems, ensuring that when the user clicks "Save," the fields map correctly to their local address book.
  2. Identity Verification: The whatsappId field is critical. Our engine uses this to link the vCard directly to a WhatsApp profile. This allows the recipient to immediately see the contact's profile picture and start a one-click message thread without even saving the number first.
  3. Multi-Contact Batching: Wawp supports sending multiple contacts in a single "Message Bubble." This is handled by concatenating the serialized VCF blocks into a single payload, providing a clean "Team" or "Directory" view for the user.

🛡️ Strategic Best Practices for Digital Identity

1. The "Wholesale Profile" Strategy

A bare-bones contact card looks suspicious to users. To build brand authority:

  • Rich Metadata: Always provide the organization and fullName.

  • Professionalism: If the contact is an agent, include their department (e.g., "Sarah - Senior Consultant").

  • Formatting: Ensure phoneNumber includes the international + prefix. This is distinct from the whatsappId, tips: [ { type: 'info', title: 'Format', content: 'Sends a vCard (VCF) file that can be saved directly to contacts.' }, { type: 'info', title: 'Fields', content: 'Supports multiple phone numbers, emails, and addresses.' } ], recommendations: [ "Include a properly formatted name (N, FN properties) for best compatibility.", "Use this to share support line numbers efficiently." ]

    which is just the numeric digits used for network routing.

2. Streamlining the Agent Handoff

In a bot-to-human transition:

  • Implementation: Instead of the bot saying "Now talking to Mark, his number is 123," have the system automatically trigger a /v2/send/contact call for Mark's vCard.
  • UX Impact: This gives the customer a clear "Professional Point of Contact" bubble that they can refer back to later, increasing the transparency of your support flow.

3. Validation and Filename Integrity

  • Character Limits: Keep the fullName under 40 characters. Longer names can be truncated in the chat preview or result in messy address book entries.
  • Emoji Usage: While emojis are supported in the name field, use them sparingly. Excessive emojis in a vCard name can sometimes interfere with search indexing in a user's local contact app.

🧩 Advanced Use Cases

Corporate Staff Directories

Send a "Support Directory" message containing three distinct contact cards: "Billing Support," "Technical Desk," and "Human Resources." By sending these as a single array, the user receives one clean interactive list rather than three separate messages.

Referral and Loyalty Programs

Automate your referral system. When a user qualifies for a partner offer, send the partner's professional contact card via Wawp. The reply_to parameter can be used to link this contact card to the specific "Reward Earned" text message, making the context immediately clear.


🛠️ Common Pitfalls and Solutions

  • Malformed WhatsApp IDs: If the whatsappId doesn't match a real account, the "Message" button on the vCard will be disabled on the recipient's phone. Always verify your agent IDs before sharing.
  • Header Discrepancies: If you provide a vcard string directly (via the legacy fields), ensure it starts with BEGIN:VCARD and ends with END:VCARD. Wawp will return a Serialization Error if the block is malformed.
  • Phone Number Confusion: Users often forget the + in the phoneNumber field. While Wawp attempts to normalize this, provide it explicitly to ensure the user's phone recognizes it as a clickable dialer link.

Summary of Capabilities:

  • Deliver interactive, native-style WhatsApp contact cards (vCards).
  • Support for batching multiple contacts (Staff/Directory) in a single message.
  • One-click "Save Contact" and "Message" functionality for the end-user.
  • Automated VCF v3.0 serialization for universal iOS/Android compatibility.
  • Seamless integration with threading/replies via the reply_to parameter.
  • High-fidelity identity sharing with full support for Organization and Job Title fields.

البارامترات

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

محتوى الطلب

يرسل كـ JSON
string

Unique ID of the WhatsApp session

مثال:
string

API access token

مثال:
string

Recipient's WhatsApp number

مثال:
array

Array of contact objects containing name and phone info.

مثال:
string

The ID of the message you are replying to

مثال:

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

MCP READY

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

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

أمثلة الكود

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

1const baseUrl = "https://api.wawp.net";
2const endpoint = "/v2/send/contact";
3const params = new URLSearchParams({
4 "instance_id": "123456789",
5 "access_token": "YOUR_ACCESS_TOKEN"
6}).toString();
7const body = {
8 "chatId": "201234567890",
9 "contacts": [
10 {
11 "fullName": "Wawp Support",
12 "organization": "Wawp HQ",
13 "phoneNumber": "+201111111111",
14 "whatsappId": "201111111111"
15 }
16 ],
17 "reply_to": "false_111...AAAA"
18};
19
20fetch(`${baseUrl}${endpoint}${params ? '?' + params : ''}`, {
21 method: "POST",
22 headers: { "Content-Type": "application/json" },
23 body: JSON.stringify(body)
24})
25 .then(async (response) => {
26 if (response.ok) {
27 const data = await response.json();
28 console.log("Success:", data);
29 return data;
30 }
31
32 // Error Handling
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: طلب غير صالح - المستلم قام بإلغاء الاشتراك تلقائياً");
41 }
42 if (response.status === 400) {
43 console.error("Error 400: Bad Request - Invalid Number (Egypt)");
44 }
45 if (response.status === 400) {
46 console.error("Error 400: Bad Request - Invalid Number (Saudi Arabia)");
47 }
48 if (response.status === 400) {
49 console.error("Error 400: Bad Request - Invalid Number (Unknown)");
50 }
51 if (response.status === 400) {
52 console.error("Error 400: طلب غير صالح (تنسيق XML)");
53 }
54 if (response.status === 400) {
55 console.error("Error 400: طلب غير صالح (نص عادي)");
56 }
57 if (response.status === 401) {
58 console.error("Error 401: غير مصرح - مفتاح الوصول غير صالح أو مفقود");
59 }
60 if (response.status === 401) {
61 console.error("Error 401: غير مصرح (تنسيق XML)");
62 }
63 if (response.status === 404) {
64 console.error("Error 404: غير موجود - الجلسة غير موجودة");
65 }
66 if (response.status === 404) {
67 console.error("Error 404: غير موجود (تنسيق XML)");
68 }
69 if (response.status === 429) {
70 console.error("Error 429: طلبات كثيرة جداً - تم تجاوز حد المعدل");
71 }
72 if (response.status === 500) {
73 console.error("Error 500: خطأ في الخادم الداخلي - فشل غير متوقع");
74 }
75 if (response.status === 500) {
76 console.error("Error 500: خطأ في الخادم الداخلي (HTML)");
77 }
78 if (response.status === 502) {
79 console.error("Error 502: بوابة غير صالحة - فشل الاتصال بالخادم الرئيسي");
80 }
81 if (response.status === 502) {
82 console.error("Error 502: بوابة غير صالحة (تنسيق XML)");
83 }
84
85 const errorText = await response.text();
86 console.error(`Error ${response.status}: ${errorText}`);
87 })
88 .catch((error) => console.error("Network Error:", error));
عينات تفاعلية
Ln 88, 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": {
  }
}
طلب غير صالح - معاملات مطلوبة مفقودة
غير مصرح - مفتاح الوصول غير صالح أو مفقود
غير موجود - الجلسة غير موجودة
طلبات كثيرة جداً - تم تجاوز حد المعدل
خطأ في الخادم الداخلي - فشل غير متوقع
بوابة غير صالحة - فشل الاتصال بالخادم الرئيسي
الموضوع السابقالتصويت الآلي في الاستطلاعات (Poll Vote)
الموضوع التاليإرسال علامة القراءة (Mark as Read)

Command Palette

Search for a command to run...