Send a Word document on WhatsApp.
http://HOST:PORT/base64/wordSend a JSON body.
| Parameter | Required | Description |
recipient |
YES | The phone number to send to. |
file |
YES | The file, base64 encoded. |
caption |
NO | A caption for the file. |
name |
YES | The name of the file. |
password |
YES | The password for your WhatsApp app. Ask us for it. |
curl --location --request POST 'http://HOST:PORT/base64/word' \
--header 'Content-Type: application/json' \
--data '{
"recipient": "recipient",
"file": "base64_encoded_file_content",
"caption": "Your caption here",
"name": "PDF_File.pdf",
"password": "Ask_for_the_password"
}'
curl --location --request POST "http://HOST:PORT/base64/word" ^
--header "Content-Type: application/json" ^
--data "{\"recipient\":\"recipient\",\"file\":\"base64_encoded_file_content\",\"caption\":\"Your caption here\",\"name\":\"PDF_File.pdf\",\"password\":\"Ask_for_the_password\"}"
<?php
$headers = [
'Content-Type: application/json',
];
$data = [
'recipient' => 'recipient',
'file' => 'base64_encoded_file_content',
'caption' => 'Your caption here',
'name' => 'PDF_File.pdf',
'password' => 'Ask_for_the_password'
];
$ch = curl_init('http://HOST:PORT/base64/word');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
print_r(json_decode($response, true));
const axios = require('axios');
axios.request({
method: 'post',
url: 'http://HOST:PORT/base64/word',
headers: {
'Content-Type': 'application/json'
},
data: {
"recipient": "recipient",
"file": "base64_encoded_file_content",
"caption": "Your caption here",
"name": "PDF_File.pdf",
"password": "Ask_for_the_password"
}
}).then((res) => console.log(res.data))
.catch((err) => console.error(err.response ? err.response.data : err.message));
import requests
headers = {
'Content-Type': 'application/json'
}
payload = {
'recipient': 'recipient',
'file': 'base64_encoded_file_content',
'caption': 'Your caption here',
'name': 'PDF_File.pdf',
'password': 'Ask_for_the_password'
}
response = requests.request('POST', 'http://HOST:PORT/base64/word', headers=headers, json=payload)
print(response.json())