File Upload by Bytes
Base URL
https://graph.communikate.in
Authentication
All API requests require authentication credentials. Include your API Key and API Secret in request headers to access protected endpoints.
Every API endpoint requires the following headers.
X-Api-Key
Your public API key.
X-Api-Secret
Your secret API key.
POST
/meta/wa/file/upload/by-bytes
Request Parameters
|
file *
string($binary)
|
IFormFile file
|
Response
|
isSuccess
boolean
|
true: success
false: failed |
|
message
string
|
response messae from API endpoint
|
|
traceId
string?
|
a server specific tracing code by which the actual error can be reviewed
|
|
result
string?
|
if isSuccess: true then it contains WhatsApp MediaId, and thereafter
you can use this MediaId to send Template Media Messages
|
cURL Request
curl 'https://graph.communikate.in/meta/wa/file/upload/by-bytes' \
--header 'X-Api-Key: YOUR_API_KEY' \
--header 'X-Api-Secret: YOUR_API_SECRET' \
--header 'Content-Type: multipart/form-data' \
--form 'file=@"/path/to/sample.pdf"'
Json Response
{
"isSuccess": true,
"message": "sample.pdf uploaded successfully.",
"traceId": null,
"result": {
"mediaId": "993039230272348"
}
}