Send Contact
Method sends a VCard to a single recipient
Url:
https://ongair.im/api/v1/base/send_contact
Method:
POST
Params:
Field | Type | Mandatory | Format | Meaning |
---|---|---|---|---|
phone_number | String | Yes | (country code)(phone number) e.g. 254722200200 | Phone number to send to |
first_name | String | Yes | Utf8 only encoded strings | The first name of the contact |
last_name | String | No | Utf8 only encoded strings | The last name of the contact |
String | No | Utf8 only encoded strings | The email address of the contact | |
contact_number[0] | String | Yes | (country code)(phone number) e.g. 254722200200 | The primary contact to be sent |
contact_number[x] | String | No | (country code)(phone number) e.g. 254722200200 | You can send as many phone numbers as you like by creating an array of contact numbers. e.g. contact_number[1] = 254722123456, contact_number[2] = 254722098765 |
Response:
The server responds with a JSON message:
{"sent":true,"id":2067}
Field | Type | Meaning |
---|---|---|
sent | Boolean | True or False if the contact was sent |
id | Integer | An Identifier for the message. This is used when delivering receipts |
At this stage, the message has been sent to the WhatsApp server for delivery.
Error:
If there is an error or the phone number does not exist, the server returns an error message and response code of 422.
{"error":"Contact with phone number 25470586564 does not exists"}