Skip to main content

Contacts

Contacts API आपको WhatsApp पर phone numbers verify करने, contact जानकारी प्राप्त करने, और profile pictures fetch करने की सुविधा देता है। यह messages भेजने से पहले numbers validate करने और अपने contact data को enrich करने के लिए विशेष रूप से उपयोगी है। सभी contact endpoints एक specific instance से जुड़े हैं:

Number मौजूद है या नहीं जांचें

Message भेजने से पहले verify करें कि कोई phone number WhatsApp पर registered है या नहीं। यह विफल deliveries और बर्बाद API calls को रोकता है।
Response (number मौजूद है):
Response (number मौजूद नहीं है):
Messages भेजने से पहले numbers validate करने के लिए इस endpoint का उपयोग करें। यह message quota बचाता है और message.failed webhook events को रोकता है।

सभी Contacts प्राप्त करें

Connected WhatsApp account की पूर्ण contact list प्राप्त करें।
Response:

Contact Fields

name field आपके phone की address book से आता है। यदि contact save नहीं है, तो केवल push_name (contact द्वारा स्वयं set किया गया) उपलब्ध होगा।

Contact की जानकारी प्राप्त करें

किसी specific contact की विस्तृत जानकारी प्राप्त करें।
Response:

Profile Picture प्राप्त करें

किसी contact की WhatsApp profile picture URL प्राप्त करें।
Response:
Profile picture URLs temporary हैं और कुछ समय बाद expire हो जाती हैं। उन्हें स्थायी रूप से store न करें — जरूरत पड़ने पर fresh URL fetch करें।
यदि contact ने कोई profile picture सेट नहीं किया है या उसने अपनी privacy settings में दृश्यता प्रतिबंधित की है, तो profile_picture_url null होगा:

सामान्य Patterns

भेजने से पहले Validate करें

अनावश्यक failures से बचने के लिए message भेजने से पहले हमेशा जांचें कि number WhatsApp पर मौजूद है या नहीं:

Contact Directory बनाएं

सभी contacts fetch करें और उन्हें profile pictures से enrich करें:
कई contacts के लिए profile pictures fetch करते समय, rate limits के भीतर रहने के लिए requests के बीच delay जोड़ें। ऊपर के उदाहरण में 200ms delay उपयोग किया गया है।

Endpoint Reference


Error Handling