Send a file to a new or existing chat.
sendFile
Only one of two parameters is needed to determine the destination - chatId or phone.
Request test
Request URL
https://api.4whats.net/sendFile
Parameters
instanceid
|
|
token
|
|
phone
|
A phone number starting with the country code. or the chatId For example: 17472822486 or 17472822486 @c.us |
body
|
HTTP link https://upload.wikimedia.org/wikipedia/ru/3/33/NatureCover2001.jpg Or base64-encoded file with mime data, for example data:image/jpeg;base64,/9j/4AAQSkZJRgABAQ... File in form-data input field |
filename
|
File name, for example 1.jpg or hello.xlsx |
caption
|
Text under the file. When sending an image сan be used with mentionedPhones, example: this image for @78005553535 |
{ "sent": true, "id": "[email protected]_DF38E6A25B42CC8CCE57EC40F", "from": "[email protected]", "to": "[email protected]", "timestamp": 1641495963, "type": "image", "queueNumber": 399955 }
Request samples
Note : don't forget to URL encode your query
params like base64 or utf-8