Mensajes de contactos
curl --request POST \
--url https://whatsapp.heybot.cloud/api/v2/message \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "<string>",
"contacts": [
{
"name": {
"formatted_name": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"middle_name": "<string>",
"suffix": "<string>",
"prefix": "<string>"
},
"phones": [
{
"phone": "<string>",
"type": "<string>"
}
],
"emails": [
{
"email": "<string>",
"type": "<string>"
}
],
"addresses": [
{
"street": "<string>",
"city": "<string>",
"state": "<string>",
"zip": "<string>",
"country": "<string>",
"country_code": "<string>",
"type": "<string>"
}
],
"org": {
"company": "<string>",
"department": "<string>",
"title": "<string>"
},
"birthday": "<string>",
"urls": [
{
"url": "<string>",
"type": "<string>"
}
]
}
]
}
'import requests
url = "https://whatsapp.heybot.cloud/api/v2/message"
payload = {
"type": "<string>",
"contacts": [
{
"name": {
"formatted_name": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"middle_name": "<string>",
"suffix": "<string>",
"prefix": "<string>"
},
"phones": [
{
"phone": "<string>",
"type": "<string>"
}
],
"emails": [
{
"email": "<string>",
"type": "<string>"
}
],
"addresses": [
{
"street": "<string>",
"city": "<string>",
"state": "<string>",
"zip": "<string>",
"country": "<string>",
"country_code": "<string>",
"type": "<string>"
}
],
"org": {
"company": "<string>",
"department": "<string>",
"title": "<string>"
},
"birthday": "<string>",
"urls": [
{
"url": "<string>",
"type": "<string>"
}
]
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
type: '<string>',
contacts: [
{
name: {
formatted_name: '<string>',
first_name: '<string>',
last_name: '<string>',
middle_name: '<string>',
suffix: '<string>',
prefix: '<string>'
},
phones: [{phone: '<string>', type: '<string>'}],
emails: [{email: '<string>', type: '<string>'}],
addresses: [
{
street: '<string>',
city: '<string>',
state: '<string>',
zip: '<string>',
country: '<string>',
country_code: '<string>',
type: '<string>'
}
],
org: {company: '<string>', department: '<string>', title: '<string>'},
birthday: '<string>',
urls: [{url: '<string>', type: '<string>'}]
}
]
})
};
fetch('https://whatsapp.heybot.cloud/api/v2/message', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://whatsapp.heybot.cloud/api/v2/message",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'type' => '<string>',
'contacts' => [
[
'name' => [
'formatted_name' => '<string>',
'first_name' => '<string>',
'last_name' => '<string>',
'middle_name' => '<string>',
'suffix' => '<string>',
'prefix' => '<string>'
],
'phones' => [
[
'phone' => '<string>',
'type' => '<string>'
]
],
'emails' => [
[
'email' => '<string>',
'type' => '<string>'
]
],
'addresses' => [
[
'street' => '<string>',
'city' => '<string>',
'state' => '<string>',
'zip' => '<string>',
'country' => '<string>',
'country_code' => '<string>',
'type' => '<string>'
]
],
'org' => [
'company' => '<string>',
'department' => '<string>',
'title' => '<string>'
],
'birthday' => '<string>',
'urls' => [
[
'url' => '<string>',
'type' => '<string>'
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://whatsapp.heybot.cloud/api/v2/message"
payload := strings.NewReader("{\n \"type\": \"<string>\",\n \"contacts\": [\n {\n \"name\": {\n \"formatted_name\": \"<string>\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"middle_name\": \"<string>\",\n \"suffix\": \"<string>\",\n \"prefix\": \"<string>\"\n },\n \"phones\": [\n {\n \"phone\": \"<string>\",\n \"type\": \"<string>\"\n }\n ],\n \"emails\": [\n {\n \"email\": \"<string>\",\n \"type\": \"<string>\"\n }\n ],\n \"addresses\": [\n {\n \"street\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\",\n \"country\": \"<string>\",\n \"country_code\": \"<string>\",\n \"type\": \"<string>\"\n }\n ],\n \"org\": {\n \"company\": \"<string>\",\n \"department\": \"<string>\",\n \"title\": \"<string>\"\n },\n \"birthday\": \"<string>\",\n \"urls\": [\n {\n \"url\": \"<string>\",\n \"type\": \"<string>\"\n }\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://whatsapp.heybot.cloud/api/v2/message")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"<string>\",\n \"contacts\": [\n {\n \"name\": {\n \"formatted_name\": \"<string>\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"middle_name\": \"<string>\",\n \"suffix\": \"<string>\",\n \"prefix\": \"<string>\"\n },\n \"phones\": [\n {\n \"phone\": \"<string>\",\n \"type\": \"<string>\"\n }\n ],\n \"emails\": [\n {\n \"email\": \"<string>\",\n \"type\": \"<string>\"\n }\n ],\n \"addresses\": [\n {\n \"street\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\",\n \"country\": \"<string>\",\n \"country_code\": \"<string>\",\n \"type\": \"<string>\"\n }\n ],\n \"org\": {\n \"company\": \"<string>\",\n \"department\": \"<string>\",\n \"title\": \"<string>\"\n },\n \"birthday\": \"<string>\",\n \"urls\": [\n {\n \"url\": \"<string>\",\n \"type\": \"<string>\"\n }\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://whatsapp.heybot.cloud/api/v2/message")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"<string>\",\n \"contacts\": [\n {\n \"name\": {\n \"formatted_name\": \"<string>\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"middle_name\": \"<string>\",\n \"suffix\": \"<string>\",\n \"prefix\": \"<string>\"\n },\n \"phones\": [\n {\n \"phone\": \"<string>\",\n \"type\": \"<string>\"\n }\n ],\n \"emails\": [\n {\n \"email\": \"<string>\",\n \"type\": \"<string>\"\n }\n ],\n \"addresses\": [\n {\n \"street\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\",\n \"country\": \"<string>\",\n \"country_code\": \"<string>\",\n \"type\": \"<string>\"\n }\n ],\n \"org\": {\n \"company\": \"<string>\",\n \"department\": \"<string>\",\n \"title\": \"<string>\"\n },\n \"birthday\": \"<string>\",\n \"urls\": [\n {\n \"url\": \"<string>\",\n \"type\": \"<string>\"\n }\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_bodyEnvío de mensajes
Mensajes de contactos
POST
/
api
/
v2
/
message
Mensajes de contactos
curl --request POST \
--url https://whatsapp.heybot.cloud/api/v2/message \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "<string>",
"contacts": [
{
"name": {
"formatted_name": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"middle_name": "<string>",
"suffix": "<string>",
"prefix": "<string>"
},
"phones": [
{
"phone": "<string>",
"type": "<string>"
}
],
"emails": [
{
"email": "<string>",
"type": "<string>"
}
],
"addresses": [
{
"street": "<string>",
"city": "<string>",
"state": "<string>",
"zip": "<string>",
"country": "<string>",
"country_code": "<string>",
"type": "<string>"
}
],
"org": {
"company": "<string>",
"department": "<string>",
"title": "<string>"
},
"birthday": "<string>",
"urls": [
{
"url": "<string>",
"type": "<string>"
}
]
}
]
}
'import requests
url = "https://whatsapp.heybot.cloud/api/v2/message"
payload = {
"type": "<string>",
"contacts": [
{
"name": {
"formatted_name": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"middle_name": "<string>",
"suffix": "<string>",
"prefix": "<string>"
},
"phones": [
{
"phone": "<string>",
"type": "<string>"
}
],
"emails": [
{
"email": "<string>",
"type": "<string>"
}
],
"addresses": [
{
"street": "<string>",
"city": "<string>",
"state": "<string>",
"zip": "<string>",
"country": "<string>",
"country_code": "<string>",
"type": "<string>"
}
],
"org": {
"company": "<string>",
"department": "<string>",
"title": "<string>"
},
"birthday": "<string>",
"urls": [
{
"url": "<string>",
"type": "<string>"
}
]
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
type: '<string>',
contacts: [
{
name: {
formatted_name: '<string>',
first_name: '<string>',
last_name: '<string>',
middle_name: '<string>',
suffix: '<string>',
prefix: '<string>'
},
phones: [{phone: '<string>', type: '<string>'}],
emails: [{email: '<string>', type: '<string>'}],
addresses: [
{
street: '<string>',
city: '<string>',
state: '<string>',
zip: '<string>',
country: '<string>',
country_code: '<string>',
type: '<string>'
}
],
org: {company: '<string>', department: '<string>', title: '<string>'},
birthday: '<string>',
urls: [{url: '<string>', type: '<string>'}]
}
]
})
};
fetch('https://whatsapp.heybot.cloud/api/v2/message', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://whatsapp.heybot.cloud/api/v2/message",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'type' => '<string>',
'contacts' => [
[
'name' => [
'formatted_name' => '<string>',
'first_name' => '<string>',
'last_name' => '<string>',
'middle_name' => '<string>',
'suffix' => '<string>',
'prefix' => '<string>'
],
'phones' => [
[
'phone' => '<string>',
'type' => '<string>'
]
],
'emails' => [
[
'email' => '<string>',
'type' => '<string>'
]
],
'addresses' => [
[
'street' => '<string>',
'city' => '<string>',
'state' => '<string>',
'zip' => '<string>',
'country' => '<string>',
'country_code' => '<string>',
'type' => '<string>'
]
],
'org' => [
'company' => '<string>',
'department' => '<string>',
'title' => '<string>'
],
'birthday' => '<string>',
'urls' => [
[
'url' => '<string>',
'type' => '<string>'
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://whatsapp.heybot.cloud/api/v2/message"
payload := strings.NewReader("{\n \"type\": \"<string>\",\n \"contacts\": [\n {\n \"name\": {\n \"formatted_name\": \"<string>\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"middle_name\": \"<string>\",\n \"suffix\": \"<string>\",\n \"prefix\": \"<string>\"\n },\n \"phones\": [\n {\n \"phone\": \"<string>\",\n \"type\": \"<string>\"\n }\n ],\n \"emails\": [\n {\n \"email\": \"<string>\",\n \"type\": \"<string>\"\n }\n ],\n \"addresses\": [\n {\n \"street\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\",\n \"country\": \"<string>\",\n \"country_code\": \"<string>\",\n \"type\": \"<string>\"\n }\n ],\n \"org\": {\n \"company\": \"<string>\",\n \"department\": \"<string>\",\n \"title\": \"<string>\"\n },\n \"birthday\": \"<string>\",\n \"urls\": [\n {\n \"url\": \"<string>\",\n \"type\": \"<string>\"\n }\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://whatsapp.heybot.cloud/api/v2/message")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"<string>\",\n \"contacts\": [\n {\n \"name\": {\n \"formatted_name\": \"<string>\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"middle_name\": \"<string>\",\n \"suffix\": \"<string>\",\n \"prefix\": \"<string>\"\n },\n \"phones\": [\n {\n \"phone\": \"<string>\",\n \"type\": \"<string>\"\n }\n ],\n \"emails\": [\n {\n \"email\": \"<string>\",\n \"type\": \"<string>\"\n }\n ],\n \"addresses\": [\n {\n \"street\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\",\n \"country\": \"<string>\",\n \"country_code\": \"<string>\",\n \"type\": \"<string>\"\n }\n ],\n \"org\": {\n \"company\": \"<string>\",\n \"department\": \"<string>\",\n \"title\": \"<string>\"\n },\n \"birthday\": \"<string>\",\n \"urls\": [\n {\n \"url\": \"<string>\",\n \"type\": \"<string>\"\n }\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://whatsapp.heybot.cloud/api/v2/message")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"<string>\",\n \"contacts\": [\n {\n \"name\": {\n \"formatted_name\": \"<string>\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"middle_name\": \"<string>\",\n \"suffix\": \"<string>\",\n \"prefix\": \"<string>\"\n },\n \"phones\": [\n {\n \"phone\": \"<string>\",\n \"type\": \"<string>\"\n }\n ],\n \"emails\": [\n {\n \"email\": \"<string>\",\n \"type\": \"<string>\"\n }\n ],\n \"addresses\": [\n {\n \"street\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\",\n \"country\": \"<string>\",\n \"country_code\": \"<string>\",\n \"type\": \"<string>\"\n }\n ],\n \"org\": {\n \"company\": \"<string>\",\n \"department\": \"<string>\",\n \"title\": \"<string>\"\n },\n \"birthday\": \"<string>\",\n \"urls\": [\n {\n \"url\": \"<string>\",\n \"type\": \"<string>\"\n }\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_bodystring
default:"contacts"
required
The type of message being sent.
array
required
An array containing the contact objects you want to send.
Show contact object
Show contact object
object
required
array
array
array
object
string
The contact’s birthday in YYYY-MM-DD format.
Ejemplo
{
"to": 5219876543210,
"type": "contacts",
"contacts": [
{
"addresses": [
{
"street": "<STREET_NUMBER_AND_NAME>",
"city": "<CITY>",
"state": "<STATE_CODE>",
"zip": "<ZIP_CODE>",
"country": "<COUNTRY_NAME>",
"country_code": "<COUNTRY_CODE>",
"type": "<ADDRESS_TYPE>"
}
<!-- Additional addresses objects go here, if using -->
],
"birthday": "<BIRTHDAY>",
"emails": [
{
"email": "<EMAIL_ADDRESS>",
"type": "<EMAIL_TYPE>"
}
<!-- Additional emails objects go here, if using -->
],
"name": {
"formatted_name": "<FULL_NAME>",
"first_name": "<FIRST_NAME>",
"last_name": "<LAST_NAME>",
"middle_name": "<MIDDLE_NAME>",
"suffix": "<SUFFIX>",
"prefix": "<PREFIX>"
},
"org": {
"company": "<COMPANY_OR_ORG_NAME>",
"department": "<DEPARTMENT_NAME>",
"title": "<JOB_TITLE>"
},
"phones": [
"phone": "<PHONE_NUMBER>",
"type": "<PHONE_NUMBER_TYPE>"
}
<!-- Additional phones objects go here, if using -->
],
"urls": [
{
"url": "<WEBSITE_URL>",
"type": "<WEBSITE_TYPE>"
}
<!-- Additional URLs go here, if using -->
]
}
]
}