Send a Contact
Send a contact to an existing chat. (Only if the dialogue has an Open Session). Only one destination parameter is needed - chatId, phone, or bsuid. In BSUID-centric routing, chatId can be [email protected], bsuid@lid, [email protected], or username@username. The phone field accepts a phone number or BSUID; bsuid can be passed separately.
JWT tokentoken<token>- body
contacts?array<>Array containing contact objects.
Contact object parameters:
name - full contact name. Required. Object with properties:
-
formatted_name - Full name, as it normally appears. Example: Lord Adam John Smith Junior. You have to use at least one additional parameter (first_name, last_name, middle_name, suffix, prefix)
-
first_name - First name. Example: Adam
-
last_name - Last name. Example: Smith
-
middle_name - Middle name. Example: John
-
suffix - Name suffix. Example: Junior
-
prefix - Name prefix. Example: Lord
birthday - YYYY-MM-DD formatted string. Example: 2012-08-18
addresses - array containing address objects with parameters:
-
street - Street number and name. Example: 1 Hacker Way
-
city - City name. Example: Menlo Park
-
state - State abbreviation. Example: CA
-
zip - ZIP code. Example: 94025
-
country - Full country name. Example: United States
-
country_code - Two-letter country abbreviation. Example: us
-
type - Standard Values: HOME, WORK. Example: HOME
emails - array containing email objects with parameters:
-
email - Email address. Example: [email protected]
-
type - Standard Values: HOME, WORK. Example: WORK
org - object containing parameters:
-
company - Name of the contact's company. Example: WhatsApp
-
department - Name of the contact's department. Example: Design
-
title - Contact's business title. Example: Manager
phones - array containing phone objects with parameters:
-
phone - Automatically populated with the wa_id value as a formatted phone number. Example: +1 (940) 555-1234
-
type - Standard Values: CELL, MAIN, IPHONE, HOME, WORK. Example: HOME
-
wa_id - WhatsApp ID. Example: 19405551234
urls - array containing url objects with parameters:
-
url - URL. Example: https://www.facebook.com
-
type - Standard Values: HOME, WORK. Example: WORK
Example: [{"addresses":[{"city":"Menlo Park","country":"United States","country_code":"us","state":"CA","street":"1 Hacker Way","type":"HOME","zip":"94025"},{"city":"Menlo Park","country":"United States","country_code":"us","state":"CA","street":"200 Jefferson Dr","type":"WORK","zip":"94025"}],"birthday":"2012-08-18","emails":[{"email":"[email protected]","type":"WORK"},{"email":"[email protected]","type":"WORK"}],"name":{"first_name":"John","formatted_name":"John Smith","last_name":"Smith"},"org":{"company":"WhatsApp","department":"Design","title":"Manager"},"phones":[{"phone":"+1 (940) 555-1234","type":"HOME"},{"phone":"+1 (650) 555-1234","type":"WORK","wa_id":"16505551234"}],"urls":[{"url":"https://www.facebook.com","type":"WORK"}]}]
contact?Simple contact card alternative to contacts. Requires name and phone.
quotedMsgId?stringQuoted message ID (Cloud API)
chatId?stringRequired if phone and bsuid are not set
Chat ID from the message list. Examples: [email protected], RU.1504711984690866@lid, username@username, or [email protected] (group). Used instead of the phone parameter.
phone?stringRequired if chatId and bsuid are not set
Recipient identifier. Accepts a phone number starting with the country code, or a BSUID such as RU.1504711984690866.
Use chatId for full chat IDs: [email protected], bsuid@lid, username@username, or [email protected].
bsuid?stringOptional alternative to phone/chatId
Recipient BSUID without the @lid suffix. Example: RU.1504711984690866.
Server response example
application/json- response
sent?booleanid?stringunique message id
message?stringPosting status message
description?stringResult description
curl -X POST 'https://api.1msg.io/123/sendContact' \ -H 'Content-Type: application/json' \ -d '{ "contacts": [ { "name": { "formatted_name": "John Smith", "first_name": "John", "last_name": "Smith" }, "phones": [ { "phone": "+1 (650) 555-1234", "type": "WORK", "wa_id": "16505551234" } ] } ], "phone": "12020721369"}'{ "sent": true, "id": "gBGGeRhGZTEfAgkJCh2wAz4ZH-8", "message": "Sent to [email protected]", "description": "Message has been sent to the provider"}