Kirim Pesan + File
curl --request POST \
--url https://api.example.com/sendimport requests
url = "https://api.example.com/send"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/send', 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://api.example.com/send",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/send"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/send")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/send")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyMessaging
Kirim Pesan + File
Kirim pesan dengan file atau media ke nomor WhatsApp melalui POST /send
POST
/
send
Kirim Pesan + File
curl --request POST \
--url https://api.example.com/sendimport requests
url = "https://api.example.com/send"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/send', 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://api.example.com/send",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/send"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/send")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/send")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyGunakan endpoint
The file upload endpoint returns the same success response as the text message endpoint.
POST /send untuk mengirim pesan beserta media. Template pada API Test Playground menambahkan parameter media_url untuk URL file. Anda juga dapat mengunggah file langsung menggunakan file pada request multipart/form-data.
Request
Headers
| Header | Type | Required | Description |
|---|---|---|---|
Content-Type | string | Yes | application/json or multipart/form-data |
Body Parameters (JSON)
Body Parameters (FormData)
Example Request
# Using media_url
curl -X POST https://api.dripsender.id/send \
-H "Content-Type: application/json" \
-d '{
"api_key": "YOUR_API_KEY",
"text": "Here is the image you requested",
"phone": "6281234567890",
"media_url": "https://example.com/image.jpg"
}'
# Using file upload
curl -X POST https://api.dripsender.id/send \
-F "api_key=YOUR_API_KEY" \
-F "text=Here is the document" \
-F "phone=6281234567890" \
-F "file=@/path/to/document.pdf"
axios.post("https://api.dripsender.id/send", {
api_key: "YOUR_API_KEY",
text: "Here is the image you requested",
phone: "6281234567890",
media_url: "https://example.com/image.jpg"
}).then(response => {
console.log(response.data);
});
Response
Success
Code:
Content: JSON response with
200Content: JSON response with
data: "OK"{
"status": 200,
"statusText": "",
"data": "OK",
"headers": {
"content-length": "2",
"content-type": "text/plain; charset=utf-8"
}
}
Error
Code:
Content: Error message
500Content: Error message
