WhatsMate API v3.0.0
Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.
WhatsApp and Telegram messaging gateway API, plus translation and PDF-to-text services.
Developer Automation Resources
Helpful resources to facilitate integration with your existing workflows:
| Resource | Format | Description | Download |
|---|---|---|---|
| OpenAPI Spec | YAML |
The primary source of truth (v3.0). | Download |
| Swagger Spec | JSON |
A legacy-compatible port (v2.0). | Download |
| Postman Collection | JSON |
Pre-configured requests for manual testing. | Download |
| WhatsMate API Technical Guide | Tutorials |
Explanatory articles / videos that guide developers how to call WhatsMate API | Visit Website |
| WhatsApp Gateway Demo | GitHub Repo |
Sample code that demonstrates how to call WhatsApp Gateway API in different programming languages. | Visit Repo |
| Telegram Gateway Demo | GitHub Repo |
Sample code that demonstrates how to call Telegram Gateway API in different programming languages. | Visit Repo |
Authentication
Most endpoints require authentication using two custom HTTP headers:
X-WM-CLIENT-ID: Your Client ID (email address)X-WM-CLIENT-SECRET: Your Client Secret key
You receive these credentials after subscribing to a Premium plan.
Base URLs:
Authentication
-
API Key (WhatsmateAuth)
- Parameter Name: X-WM-CLIENT-ID, in: header. Your client ID (email address)
-
API Key (WhatsmateSecret)
- Parameter Name: X-WM-CLIENT-SECRET, in: header. Your client secret key
Whatsapp - Single Recipient
Send messages to registered Whatsapp users
Send text message to single WhatsApp recipient
Code samples
import http.client
conn = http.client.HTTPSConnection("api.whatsmate.net")
payload = "{\"number\":\"14155552671\",\"message\":\"Hello from WhatsMate!\"}"
headers = {
'Content-Type': "application/json",
'Accept': "application/json",
'X-WM-CLIENT-ID': "API_KEY",
'X-WM-CLIENT-SECRET': "API_KEY"
}
conn.request("POST", "/v3/whatsapp/single/text/message/1", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
"https://api.whatsmate.net/v3/whatsapp/single/text/message/1",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\"number\":\"14155552671\",\"message\":\"Hello from WhatsMate!\"}",
CURLOPT_HTTPHEADER => [
"Accept: application/json",
"Content-Type: application/json",
"X-WM-CLIENT-ID: API_KEY",
"X-WM-CLIENT-SECRET: API_KEY"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
const data = JSON.stringify({
"number": "14155552671",
"message": "Hello from WhatsMate!"
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://api.whatsmate.net/v3/whatsapp/single/text/message/1");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.setRequestHeader("Accept", "application/json");
xhr.setRequestHeader("X-WM-CLIENT-ID", "API_KEY");
xhr.setRequestHeader("X-WM-CLIENT-SECRET", "API_KEY");
xhr.send(data);
HttpResponse response = Unirest.post("https://api.whatsmate.net/v3/whatsapp/single/text/message/1")
.header("Content-Type", "application/json")
.header("Accept", "application/json")
.header("X-WM-CLIENT-ID", "API_KEY")
.header("X-WM-CLIENT-SECRET", "API_KEY")
.body("{\"number\":\"14155552671\",\"message\":\"Hello from WhatsMate!\"}")
.asString();
curl --request POST \
--url https://api.whatsmate.net/v3/whatsapp/single/text/message/1 \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'X-WM-CLIENT-ID: API_KEY' \
--header 'X-WM-CLIENT-SECRET: API_KEY' \
--data '{"number":"14155552671","message":"Hello from WhatsMate!"}'
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.whatsmate.net/v3/whatsapp/single/text/message/1"
payload := strings.NewReader("{\"number\":\"14155552671\",\"message\":\"Hello from WhatsMate!\"}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Accept", "application/json")
req.Header.Add("X-WM-CLIENT-ID", "API_KEY")
req.Header.Add("X-WM-CLIENT-SECRET", "API_KEY")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.whatsmate.net/v3/whatsapp/single/text/message/1")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request["Accept"] = 'application/json'
request["X-WM-CLIENT-ID"] = 'API_KEY'
request["X-WM-CLIENT-SECRET"] = 'API_KEY'
request.body = "{\"number\":\"14155552671\",\"message\":\"Hello from WhatsMate!\"}"
response = http.request(request)
puts response.read_body
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\"number\":\"14155552671\",\"message\":\"Hello from WhatsMate!\"}")
val request = Request.Builder()
.url("https://api.whatsmate.net/v3/whatsapp/single/text/message/1")
.post(body)
.addHeader("Content-Type", "application/json")
.addHeader("Accept", "application/json")
.addHeader("X-WM-CLIENT-ID", "API_KEY")
.addHeader("X-WM-CLIENT-SECRET", "API_KEY")
.build()
val response = client.newCall(request).execute()
POST /v3/whatsapp/single/text/message/{instance_number}
Send a WhatsApp text message to a single recipient.
Documentation: WhatsApp Gateway API Guide
Body parameter
{
"number": "14155552671",
"message": "Hello from WhatsMate!"
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| instance_number | path | integer | true | Your gateway's instance ID (positive integer) |
| body | body | WhatsappTextRequest | true | none |
Example responses
200 Response
{
"status": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Message queued for delivery | JobResponse |
| 400 | Bad Request | Bad request | ErrorResponse |
| 401 | Unauthorized | Invalid or missing authentication credentials | ErrorResponse |
| 469 | Unknown | API quota exceeded | ErrorResponse |
Send image to single WhatsApp recipient
Code samples
import http.client
conn = http.client.HTTPSConnection("api.whatsmate.net")
payload = "{\"number\":\"14155552671\",\"image\":\"string\",\"caption\":\"string\"}"
headers = {
'Content-Type': "application/json",
'Accept': "application/json",
'X-WM-CLIENT-ID': "API_KEY",
'X-WM-CLIENT-SECRET': "API_KEY"
}
conn.request("POST", "/v3/whatsapp/single/image/message/1", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
"https://api.whatsmate.net/v3/whatsapp/single/image/message/1",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\"number\":\"14155552671\",\"image\":\"string\",\"caption\":\"string\"}",
CURLOPT_HTTPHEADER => [
"Accept: application/json",
"Content-Type: application/json",
"X-WM-CLIENT-ID: API_KEY",
"X-WM-CLIENT-SECRET: API_KEY"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
const data = JSON.stringify({
"number": "14155552671",
"image": "string",
"caption": "string"
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://api.whatsmate.net/v3/whatsapp/single/image/message/1");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.setRequestHeader("Accept", "application/json");
xhr.setRequestHeader("X-WM-CLIENT-ID", "API_KEY");
xhr.setRequestHeader("X-WM-CLIENT-SECRET", "API_KEY");
xhr.send(data);
HttpResponse response = Unirest.post("https://api.whatsmate.net/v3/whatsapp/single/image/message/1")
.header("Content-Type", "application/json")
.header("Accept", "application/json")
.header("X-WM-CLIENT-ID", "API_KEY")
.header("X-WM-CLIENT-SECRET", "API_KEY")
.body("{\"number\":\"14155552671\",\"image\":\"string\",\"caption\":\"string\"}")
.asString();
curl --request POST \
--url https://api.whatsmate.net/v3/whatsapp/single/image/message/1 \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'X-WM-CLIENT-ID: API_KEY' \
--header 'X-WM-CLIENT-SECRET: API_KEY' \
--data '{"number":"14155552671","image":"string","caption":"string"}'
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.whatsmate.net/v3/whatsapp/single/image/message/1"
payload := strings.NewReader("{\"number\":\"14155552671\",\"image\":\"string\",\"caption\":\"string\"}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Accept", "application/json")
req.Header.Add("X-WM-CLIENT-ID", "API_KEY")
req.Header.Add("X-WM-CLIENT-SECRET", "API_KEY")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.whatsmate.net/v3/whatsapp/single/image/message/1")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request["Accept"] = 'application/json'
request["X-WM-CLIENT-ID"] = 'API_KEY'
request["X-WM-CLIENT-SECRET"] = 'API_KEY'
request.body = "{\"number\":\"14155552671\",\"image\":\"string\",\"caption\":\"string\"}"
response = http.request(request)
puts response.read_body
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\"number\":\"14155552671\",\"image\":\"string\",\"caption\":\"string\"}")
val request = Request.Builder()
.url("https://api.whatsmate.net/v3/whatsapp/single/image/message/1")
.post(body)
.addHeader("Content-Type", "application/json")
.addHeader("Accept", "application/json")
.addHeader("X-WM-CLIENT-ID", "API_KEY")
.addHeader("X-WM-CLIENT-SECRET", "API_KEY")
.build()
val response = client.newCall(request).execute()
POST /v3/whatsapp/single/image/message/{instance_number}
Send a WhatsApp image message to a single recipient.
Body parameter
{
"number": "14155552671",
"image": "string",
"caption": "string"
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| instance_number | path | integer | true | Your gateway's instance ID (positive integer) |
| body | body | WhatsappMediaRequest | true | none |
Example responses
200 Response
{
"status": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Message queued for delivery | JobResponse |
| 400 | Bad Request | Bad request | ErrorResponse |
| 401 | Unauthorized | Invalid or missing authentication credentials | ErrorResponse |
Send document to single WhatsApp recipient
Code samples
import http.client
conn = http.client.HTTPSConnection("api.whatsmate.net")
payload = "{\"number\":\"14155552671\",\"document\":\"string\",\"filename\":\"document.pdf\"}"
headers = {
'Content-Type': "application/json",
'Accept': "application/json",
'X-WM-CLIENT-ID': "API_KEY",
'X-WM-CLIENT-SECRET': "API_KEY"
}
conn.request("POST", "/v3/whatsapp/single/document/message/1", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
"https://api.whatsmate.net/v3/whatsapp/single/document/message/1",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\"number\":\"14155552671\",\"document\":\"string\",\"filename\":\"document.pdf\"}",
CURLOPT_HTTPHEADER => [
"Accept: application/json",
"Content-Type: application/json",
"X-WM-CLIENT-ID: API_KEY",
"X-WM-CLIENT-SECRET: API_KEY"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
const data = JSON.stringify({
"number": "14155552671",
"document": "string",
"filename": "document.pdf"
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://api.whatsmate.net/v3/whatsapp/single/document/message/1");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.setRequestHeader("Accept", "application/json");
xhr.setRequestHeader("X-WM-CLIENT-ID", "API_KEY");
xhr.setRequestHeader("X-WM-CLIENT-SECRET", "API_KEY");
xhr.send(data);
HttpResponse response = Unirest.post("https://api.whatsmate.net/v3/whatsapp/single/document/message/1")
.header("Content-Type", "application/json")
.header("Accept", "application/json")
.header("X-WM-CLIENT-ID", "API_KEY")
.header("X-WM-CLIENT-SECRET", "API_KEY")
.body("{\"number\":\"14155552671\",\"document\":\"string\",\"filename\":\"document.pdf\"}")
.asString();
curl --request POST \
--url https://api.whatsmate.net/v3/whatsapp/single/document/message/1 \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'X-WM-CLIENT-ID: API_KEY' \
--header 'X-WM-CLIENT-SECRET: API_KEY' \
--data '{"number":"14155552671","document":"string","filename":"document.pdf"}'
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.whatsmate.net/v3/whatsapp/single/document/message/1"
payload := strings.NewReader("{\"number\":\"14155552671\",\"document\":\"string\",\"filename\":\"document.pdf\"}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Accept", "application/json")
req.Header.Add("X-WM-CLIENT-ID", "API_KEY")
req.Header.Add("X-WM-CLIENT-SECRET", "API_KEY")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.whatsmate.net/v3/whatsapp/single/document/message/1")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request["Accept"] = 'application/json'
request["X-WM-CLIENT-ID"] = 'API_KEY'
request["X-WM-CLIENT-SECRET"] = 'API_KEY'
request.body = "{\"number\":\"14155552671\",\"document\":\"string\",\"filename\":\"document.pdf\"}"
response = http.request(request)
puts response.read_body
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\"number\":\"14155552671\",\"document\":\"string\",\"filename\":\"document.pdf\"}")
val request = Request.Builder()
.url("https://api.whatsmate.net/v3/whatsapp/single/document/message/1")
.post(body)
.addHeader("Content-Type", "application/json")
.addHeader("Accept", "application/json")
.addHeader("X-WM-CLIENT-ID", "API_KEY")
.addHeader("X-WM-CLIENT-SECRET", "API_KEY")
.build()
val response = client.newCall(request).execute()
POST /v3/whatsapp/single/document/message/{instance_number}
Send a WhatsApp document (PDF, MP3, etc.) to a single recipient.
Body parameter
{
"number": "14155552671",
"document": "string",
"filename": "document.pdf"
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| instance_number | path | integer | true | Your gateway's instance ID (positive integer) |
| body | body | WhatsappDocumentRequest | true | none |
Example responses
200 Response
{
"status": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Message queued for delivery | JobResponse |
| 400 | Bad Request | Bad request | ErrorResponse |
| 401 | Unauthorized | Invalid or missing authentication credentials | ErrorResponse |
Send URL to single WhatsApp recipient
Code samples
import http.client
conn = http.client.HTTPSConnection("api.whatsmate.net")
payload = "{\"number\":\"14155552671\",\"url\":\"string\"}"
headers = {
'Content-Type': "application/json",
'Accept': "application/json",
'X-WM-CLIENT-ID': "API_KEY",
'X-WM-CLIENT-SECRET': "API_KEY"
}
conn.request("POST", "/v3/whatsapp/single/url/message/1", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
"https://api.whatsmate.net/v3/whatsapp/single/url/message/1",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\"number\":\"14155552671\",\"url\":\"string\"}",
CURLOPT_HTTPHEADER => [
"Accept: application/json",
"Content-Type: application/json",
"X-WM-CLIENT-ID: API_KEY",
"X-WM-CLIENT-SECRET: API_KEY"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
const data = JSON.stringify({
"number": "14155552671",
"url": "string"
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://api.whatsmate.net/v3/whatsapp/single/url/message/1");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.setRequestHeader("Accept", "application/json");
xhr.setRequestHeader("X-WM-CLIENT-ID", "API_KEY");
xhr.setRequestHeader("X-WM-CLIENT-SECRET", "API_KEY");
xhr.send(data);
HttpResponse response = Unirest.post("https://api.whatsmate.net/v3/whatsapp/single/url/message/1")
.header("Content-Type", "application/json")
.header("Accept", "application/json")
.header("X-WM-CLIENT-ID", "API_KEY")
.header("X-WM-CLIENT-SECRET", "API_KEY")
.body("{\"number\":\"14155552671\",\"url\":\"string\"}")
.asString();
curl --request POST \
--url https://api.whatsmate.net/v3/whatsapp/single/url/message/1 \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'X-WM-CLIENT-ID: API_KEY' \
--header 'X-WM-CLIENT-SECRET: API_KEY' \
--data '{"number":"14155552671","url":"string"}'
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.whatsmate.net/v3/whatsapp/single/url/message/1"
payload := strings.NewReader("{\"number\":\"14155552671\",\"url\":\"string\"}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Accept", "application/json")
req.Header.Add("X-WM-CLIENT-ID", "API_KEY")
req.Header.Add("X-WM-CLIENT-SECRET", "API_KEY")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.whatsmate.net/v3/whatsapp/single/url/message/1")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request["Accept"] = 'application/json'
request["X-WM-CLIENT-ID"] = 'API_KEY'
request["X-WM-CLIENT-SECRET"] = 'API_KEY'
request.body = "{\"number\":\"14155552671\",\"url\":\"string\"}"
response = http.request(request)
puts response.read_body
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\"number\":\"14155552671\",\"url\":\"string\"}")
val request = Request.Builder()
.url("https://api.whatsmate.net/v3/whatsapp/single/url/message/1")
.post(body)
.addHeader("Content-Type", "application/json")
.addHeader("Accept", "application/json")
.addHeader("X-WM-CLIENT-ID", "API_KEY")
.addHeader("X-WM-CLIENT-SECRET", "API_KEY")
.build()
val response = client.newCall(request).execute()
POST /v3/whatsapp/single/url/message/{instance_number}
Send a URL message to a single WhatsApp recipient.
Body parameter
{
"number": "14155552671",
"url": "string"
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| instance_number | path | integer | true | Your gateway's instance ID (positive integer) |
| body | body | object | true | none |
| » number | body | string | true | Recipient's phone number with country code (no "+" sign) |
| » url | body | string | true | URL to send |
Example responses
200 Response
{
"status": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Message queued for delivery | JobResponse |
| 400 | Bad Request | Bad request | ErrorResponse |
| 401 | Unauthorized | Invalid or missing authentication credentials | ErrorResponse |
| 469 | Unknown | API quota exceeded | ErrorResponse |
Whatsapp - Group
Send messages to Whatsapp groups
Send text message to WhatsApp group
Code samples
import http.client
conn = http.client.HTTPSConnection("api.whatsmate.net")
payload = "{\"group_name\":\"My WhatsApp Group\",\"group_admin\":\"14155552671\",\"message\":\"string\"}"
headers = {
'Content-Type': "application/json",
'Accept': "application/json",
'X-WM-CLIENT-ID': "API_KEY",
'X-WM-CLIENT-SECRET': "API_KEY"
}
conn.request("POST", "/v3/whatsapp/group/text/message/1", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
"https://api.whatsmate.net/v3/whatsapp/group/text/message/1",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\"group_name\":\"My WhatsApp Group\",\"group_admin\":\"14155552671\",\"message\":\"string\"}",
CURLOPT_HTTPHEADER => [
"Accept: application/json",
"Content-Type: application/json",
"X-WM-CLIENT-ID: API_KEY",
"X-WM-CLIENT-SECRET: API_KEY"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
const data = JSON.stringify({
"group_name": "My WhatsApp Group",
"group_admin": "14155552671",
"message": "string"
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://api.whatsmate.net/v3/whatsapp/group/text/message/1");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.setRequestHeader("Accept", "application/json");
xhr.setRequestHeader("X-WM-CLIENT-ID", "API_KEY");
xhr.setRequestHeader("X-WM-CLIENT-SECRET", "API_KEY");
xhr.send(data);
HttpResponse response = Unirest.post("https://api.whatsmate.net/v3/whatsapp/group/text/message/1")
.header("Content-Type", "application/json")
.header("Accept", "application/json")
.header("X-WM-CLIENT-ID", "API_KEY")
.header("X-WM-CLIENT-SECRET", "API_KEY")
.body("{\"group_name\":\"My WhatsApp Group\",\"group_admin\":\"14155552671\",\"message\":\"string\"}")
.asString();
curl --request POST \
--url https://api.whatsmate.net/v3/whatsapp/group/text/message/1 \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'X-WM-CLIENT-ID: API_KEY' \
--header 'X-WM-CLIENT-SECRET: API_KEY' \
--data '{"group_name":"My WhatsApp Group","group_admin":"14155552671","message":"string"}'
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.whatsmate.net/v3/whatsapp/group/text/message/1"
payload := strings.NewReader("{\"group_name\":\"My WhatsApp Group\",\"group_admin\":\"14155552671\",\"message\":\"string\"}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Accept", "application/json")
req.Header.Add("X-WM-CLIENT-ID", "API_KEY")
req.Header.Add("X-WM-CLIENT-SECRET", "API_KEY")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.whatsmate.net/v3/whatsapp/group/text/message/1")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request["Accept"] = 'application/json'
request["X-WM-CLIENT-ID"] = 'API_KEY'
request["X-WM-CLIENT-SECRET"] = 'API_KEY'
request.body = "{\"group_name\":\"My WhatsApp Group\",\"group_admin\":\"14155552671\",\"message\":\"string\"}"
response = http.request(request)
puts response.read_body
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\"group_name\":\"My WhatsApp Group\",\"group_admin\":\"14155552671\",\"message\":\"string\"}")
val request = Request.Builder()
.url("https://api.whatsmate.net/v3/whatsapp/group/text/message/1")
.post(body)
.addHeader("Content-Type", "application/json")
.addHeader("Accept", "application/json")
.addHeader("X-WM-CLIENT-ID", "API_KEY")
.addHeader("X-WM-CLIENT-SECRET", "API_KEY")
.build()
val response = client.newCall(request).execute()
POST /v3/whatsapp/group/text/message/{instance_number}
Send a WhatsApp text message to a group.
Body parameter
{
"group_name": "My WhatsApp Group",
"group_admin": "14155552671",
"message": "string"
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| instance_number | path | integer | true | Your gateway's instance ID (positive integer) |
| body | body | WhatsappGroupTextRequest | true | none |
Example responses
200 Response
{
"status": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Message queued for delivery | JobResponse |
| 400 | Bad Request | Bad request | ErrorResponse |
| 401 | Unauthorized | Invalid or missing authentication credentials | ErrorResponse |
Send image to WhatsApp group
Code samples
import http.client
conn = http.client.HTTPSConnection("api.whatsmate.net")
payload = "{\"group_name\":\"string\",\"image\":\"string\",\"caption\":\"string\"}"
headers = {
'Content-Type': "application/json",
'Accept': "application/json",
'X-WM-CLIENT-ID': "API_KEY",
'X-WM-CLIENT-SECRET': "API_KEY"
}
conn.request("POST", "/v3/whatsapp/group/image/message/1", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
"https://api.whatsmate.net/v3/whatsapp/group/image/message/1",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\"group_name\":\"string\",\"image\":\"string\",\"caption\":\"string\"}",
CURLOPT_HTTPHEADER => [
"Accept: application/json",
"Content-Type: application/json",
"X-WM-CLIENT-ID: API_KEY",
"X-WM-CLIENT-SECRET: API_KEY"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
const data = JSON.stringify({
"group_name": "string",
"image": "string",
"caption": "string"
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://api.whatsmate.net/v3/whatsapp/group/image/message/1");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.setRequestHeader("Accept", "application/json");
xhr.setRequestHeader("X-WM-CLIENT-ID", "API_KEY");
xhr.setRequestHeader("X-WM-CLIENT-SECRET", "API_KEY");
xhr.send(data);
HttpResponse response = Unirest.post("https://api.whatsmate.net/v3/whatsapp/group/image/message/1")
.header("Content-Type", "application/json")
.header("Accept", "application/json")
.header("X-WM-CLIENT-ID", "API_KEY")
.header("X-WM-CLIENT-SECRET", "API_KEY")
.body("{\"group_name\":\"string\",\"image\":\"string\",\"caption\":\"string\"}")
.asString();
curl --request POST \
--url https://api.whatsmate.net/v3/whatsapp/group/image/message/1 \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'X-WM-CLIENT-ID: API_KEY' \
--header 'X-WM-CLIENT-SECRET: API_KEY' \
--data '{"group_name":"string","image":"string","caption":"string"}'
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.whatsmate.net/v3/whatsapp/group/image/message/1"
payload := strings.NewReader("{\"group_name\":\"string\",\"image\":\"string\",\"caption\":\"string\"}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Accept", "application/json")
req.Header.Add("X-WM-CLIENT-ID", "API_KEY")
req.Header.Add("X-WM-CLIENT-SECRET", "API_KEY")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.whatsmate.net/v3/whatsapp/group/image/message/1")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request["Accept"] = 'application/json'
request["X-WM-CLIENT-ID"] = 'API_KEY'
request["X-WM-CLIENT-SECRET"] = 'API_KEY'
request.body = "{\"group_name\":\"string\",\"image\":\"string\",\"caption\":\"string\"}"
response = http.request(request)
puts response.read_body
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\"group_name\":\"string\",\"image\":\"string\",\"caption\":\"string\"}")
val request = Request.Builder()
.url("https://api.whatsmate.net/v3/whatsapp/group/image/message/1")
.post(body)
.addHeader("Content-Type", "application/json")
.addHeader("Accept", "application/json")
.addHeader("X-WM-CLIENT-ID", "API_KEY")
.addHeader("X-WM-CLIENT-SECRET", "API_KEY")
.build()
val response = client.newCall(request).execute()
POST /v3/whatsapp/group/image/message/{instance_number}
Send a WhatsApp image message to a group.
Body parameter
{
"group_name": "string",
"image": "string",
"caption": "string"
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| instance_number | path | integer | true | Your gateway's instance ID (positive integer) |
| body | body | WhatsappGroupMediaRequest | true | none |
Example responses
200 Response
{
"status": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Message queued for delivery | JobResponse |
| 400 | Bad Request | Bad request | ErrorResponse |
| 401 | Unauthorized | Invalid or missing authentication credentials | ErrorResponse |
Send document to WhatsApp group
Code samples
import http.client
conn = http.client.HTTPSConnection("api.whatsmate.net")
payload = "{\"group_name\":\"string\",\"document\":\"string\",\"filename\":\"document.pdf\"}"
headers = {
'Content-Type': "application/json",
'Accept': "application/json",
'X-WM-CLIENT-ID': "API_KEY",
'X-WM-CLIENT-SECRET': "API_KEY"
}
conn.request("POST", "/v3/whatsapp/group/document/message/1", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
"https://api.whatsmate.net/v3/whatsapp/group/document/message/1",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\"group_name\":\"string\",\"document\":\"string\",\"filename\":\"document.pdf\"}",
CURLOPT_HTTPHEADER => [
"Accept: application/json",
"Content-Type: application/json",
"X-WM-CLIENT-ID: API_KEY",
"X-WM-CLIENT-SECRET: API_KEY"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
const data = JSON.stringify({
"group_name": "string",
"document": "string",
"filename": "document.pdf"
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://api.whatsmate.net/v3/whatsapp/group/document/message/1");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.setRequestHeader("Accept", "application/json");
xhr.setRequestHeader("X-WM-CLIENT-ID", "API_KEY");
xhr.setRequestHeader("X-WM-CLIENT-SECRET", "API_KEY");
xhr.send(data);
HttpResponse response = Unirest.post("https://api.whatsmate.net/v3/whatsapp/group/document/message/1")
.header("Content-Type", "application/json")
.header("Accept", "application/json")
.header("X-WM-CLIENT-ID", "API_KEY")
.header("X-WM-CLIENT-SECRET", "API_KEY")
.body("{\"group_name\":\"string\",\"document\":\"string\",\"filename\":\"document.pdf\"}")
.asString();
curl --request POST \
--url https://api.whatsmate.net/v3/whatsapp/group/document/message/1 \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'X-WM-CLIENT-ID: API_KEY' \
--header 'X-WM-CLIENT-SECRET: API_KEY' \
--data '{"group_name":"string","document":"string","filename":"document.pdf"}'
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.whatsmate.net/v3/whatsapp/group/document/message/1"
payload := strings.NewReader("{\"group_name\":\"string\",\"document\":\"string\",\"filename\":\"document.pdf\"}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Accept", "application/json")
req.Header.Add("X-WM-CLIENT-ID", "API_KEY")
req.Header.Add("X-WM-CLIENT-SECRET", "API_KEY")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.whatsmate.net/v3/whatsapp/group/document/message/1")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request["Accept"] = 'application/json'
request["X-WM-CLIENT-ID"] = 'API_KEY'
request["X-WM-CLIENT-SECRET"] = 'API_KEY'
request.body = "{\"group_name\":\"string\",\"document\":\"string\",\"filename\":\"document.pdf\"}"
response = http.request(request)
puts response.read_body
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\"group_name\":\"string\",\"document\":\"string\",\"filename\":\"document.pdf\"}")
val request = Request.Builder()
.url("https://api.whatsmate.net/v3/whatsapp/group/document/message/1")
.post(body)
.addHeader("Content-Type", "application/json")
.addHeader("Accept", "application/json")
.addHeader("X-WM-CLIENT-ID", "API_KEY")
.addHeader("X-WM-CLIENT-SECRET", "API_KEY")
.build()
val response = client.newCall(request).execute()
POST /v3/whatsapp/group/document/message/{instance_number}
Send a WhatsApp document to a group.
Body parameter
{
"group_name": "string",
"document": "string",
"filename": "document.pdf"
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| instance_number | path | integer | true | Your gateway's instance ID (positive integer) |
| body | body | WhatsappGroupDocumentRequest | true | none |
Example responses
200 Response
{
"status": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Message queued for delivery | JobResponse |
| 400 | Bad Request | Bad request | ErrorResponse |
| 401 | Unauthorized | Invalid or missing authentication credentials | ErrorResponse |
Send URL to WhatsApp group
Code samples
import http.client
conn = http.client.HTTPSConnection("api.whatsmate.net")
payload = "{\"group_name\":\"string\",\"group_admin\":\"14155552671\",\"url\":\"string\"}"
headers = {
'Content-Type': "application/json",
'Accept': "application/json",
'X-WM-CLIENT-ID': "API_KEY",
'X-WM-CLIENT-SECRET': "API_KEY"
}
conn.request("POST", "/v3/whatsapp/group/url/message/1", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
"https://api.whatsmate.net/v3/whatsapp/group/url/message/1",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\"group_name\":\"string\",\"group_admin\":\"14155552671\",\"url\":\"string\"}",
CURLOPT_HTTPHEADER => [
"Accept: application/json",
"Content-Type: application/json",
"X-WM-CLIENT-ID: API_KEY",
"X-WM-CLIENT-SECRET: API_KEY"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
const data = JSON.stringify({
"group_name": "string",
"group_admin": "14155552671",
"url": "string"
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://api.whatsmate.net/v3/whatsapp/group/url/message/1");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.setRequestHeader("Accept", "application/json");
xhr.setRequestHeader("X-WM-CLIENT-ID", "API_KEY");
xhr.setRequestHeader("X-WM-CLIENT-SECRET", "API_KEY");
xhr.send(data);
HttpResponse response = Unirest.post("https://api.whatsmate.net/v3/whatsapp/group/url/message/1")
.header("Content-Type", "application/json")
.header("Accept", "application/json")
.header("X-WM-CLIENT-ID", "API_KEY")
.header("X-WM-CLIENT-SECRET", "API_KEY")
.body("{\"group_name\":\"string\",\"group_admin\":\"14155552671\",\"url\":\"string\"}")
.asString();
curl --request POST \
--url https://api.whatsmate.net/v3/whatsapp/group/url/message/1 \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'X-WM-CLIENT-ID: API_KEY' \
--header 'X-WM-CLIENT-SECRET: API_KEY' \
--data '{"group_name":"string","group_admin":"14155552671","url":"string"}'
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.whatsmate.net/v3/whatsapp/group/url/message/1"
payload := strings.NewReader("{\"group_name\":\"string\",\"group_admin\":\"14155552671\",\"url\":\"string\"}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Accept", "application/json")
req.Header.Add("X-WM-CLIENT-ID", "API_KEY")
req.Header.Add("X-WM-CLIENT-SECRET", "API_KEY")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.whatsmate.net/v3/whatsapp/group/url/message/1")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request["Accept"] = 'application/json'
request["X-WM-CLIENT-ID"] = 'API_KEY'
request["X-WM-CLIENT-SECRET"] = 'API_KEY'
request.body = "{\"group_name\":\"string\",\"group_admin\":\"14155552671\",\"url\":\"string\"}"
response = http.request(request)
puts response.read_body
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\"group_name\":\"string\",\"group_admin\":\"14155552671\",\"url\":\"string\"}")
val request = Request.Builder()
.url("https://api.whatsmate.net/v3/whatsapp/group/url/message/1")
.post(body)
.addHeader("Content-Type", "application/json")
.addHeader("Accept", "application/json")
.addHeader("X-WM-CLIENT-ID", "API_KEY")
.addHeader("X-WM-CLIENT-SECRET", "API_KEY")
.build()
val response = client.newCall(request).execute()
POST /v3/whatsapp/group/url/message/{instance_number}
Send a URL message to a WhatsApp group.
Body parameter
{
"group_name": "string",
"group_admin": "14155552671",
"url": "string"
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| instance_number | path | integer | true | Your gateway's instance ID (positive integer) |
| body | body | object | true | none |
| » group_name | body | string | true | Name of the WhatsApp group |
| » group_admin | body | string | true | Phone number of the group creator (no "+" sign) |
| » url | body | string | true | URL to send |
Example responses
200 Response
{
"status": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Message queued for delivery | JobResponse |
| 400 | Bad Request | Bad request | ErrorResponse |
| 401 | Unauthorized | Invalid or missing authentication credentials | ErrorResponse |
| 469 | Unknown | API quota exceeded | ErrorResponse |
Telegram - Single Recipient
Send messages to registered Telegram users
Send text message to single Telegram recipient
Code samples
import http.client
conn = http.client.HTTPSConnection("api.whatsmate.net")
payload = "{\"number\":\"14155552671\",\"message\":\"string\"}"
headers = {
'Content-Type': "application/json",
'Accept': "application/json",
'X-WM-CLIENT-ID': "API_KEY",
'X-WM-CLIENT-SECRET': "API_KEY"
}
conn.request("POST", "/v3/telegram/single/text/message/1", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
"https://api.whatsmate.net/v3/telegram/single/text/message/1",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\"number\":\"14155552671\",\"message\":\"string\"}",
CURLOPT_HTTPHEADER => [
"Accept: application/json",
"Content-Type: application/json",
"X-WM-CLIENT-ID: API_KEY",
"X-WM-CLIENT-SECRET: API_KEY"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
const data = JSON.stringify({
"number": "14155552671",
"message": "string"
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://api.whatsmate.net/v3/telegram/single/text/message/1");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.setRequestHeader("Accept", "application/json");
xhr.setRequestHeader("X-WM-CLIENT-ID", "API_KEY");
xhr.setRequestHeader("X-WM-CLIENT-SECRET", "API_KEY");
xhr.send(data);
HttpResponse response = Unirest.post("https://api.whatsmate.net/v3/telegram/single/text/message/1")
.header("Content-Type", "application/json")
.header("Accept", "application/json")
.header("X-WM-CLIENT-ID", "API_KEY")
.header("X-WM-CLIENT-SECRET", "API_KEY")
.body("{\"number\":\"14155552671\",\"message\":\"string\"}")
.asString();
curl --request POST \
--url https://api.whatsmate.net/v3/telegram/single/text/message/1 \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'X-WM-CLIENT-ID: API_KEY' \
--header 'X-WM-CLIENT-SECRET: API_KEY' \
--data '{"number":"14155552671","message":"string"}'
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.whatsmate.net/v3/telegram/single/text/message/1"
payload := strings.NewReader("{\"number\":\"14155552671\",\"message\":\"string\"}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Accept", "application/json")
req.Header.Add("X-WM-CLIENT-ID", "API_KEY")
req.Header.Add("X-WM-CLIENT-SECRET", "API_KEY")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.whatsmate.net/v3/telegram/single/text/message/1")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request["Accept"] = 'application/json'
request["X-WM-CLIENT-ID"] = 'API_KEY'
request["X-WM-CLIENT-SECRET"] = 'API_KEY'
request.body = "{\"number\":\"14155552671\",\"message\":\"string\"}"
response = http.request(request)
puts response.read_body
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\"number\":\"14155552671\",\"message\":\"string\"}")
val request = Request.Builder()
.url("https://api.whatsmate.net/v3/telegram/single/text/message/1")
.post(body)
.addHeader("Content-Type", "application/json")
.addHeader("Accept", "application/json")
.addHeader("X-WM-CLIENT-ID", "API_KEY")
.addHeader("X-WM-CLIENT-SECRET", "API_KEY")
.build()
val response = client.newCall(request).execute()
POST /v3/telegram/single/text/message/{instance_number}
Send a Telegram text message to a single recipient.
Body parameter
{
"number": "14155552671",
"message": "string"
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| instance_number | path | integer | true | Your gateway's instance ID (positive integer) |
| body | body | TelegramTextRequest | true | none |
Example responses
200 Response
{
"status": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Message queued for delivery | JobResponse |
| 400 | Bad Request | Bad request | ErrorResponse |
| 401 | Unauthorized | Invalid or missing authentication credentials | ErrorResponse |
Send image to single Telegram recipient
Code samples
import http.client
conn = http.client.HTTPSConnection("api.whatsmate.net")
payload = "{\"number\":\"14155552671\",\"image\":\"string\",\"caption\":\"string\"}"
headers = {
'Content-Type': "application/json",
'Accept': "application/json",
'X-WM-CLIENT-ID': "API_KEY",
'X-WM-CLIENT-SECRET': "API_KEY"
}
conn.request("POST", "/v3/telegram/single/image/message/1", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
"https://api.whatsmate.net/v3/telegram/single/image/message/1",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\"number\":\"14155552671\",\"image\":\"string\",\"caption\":\"string\"}",
CURLOPT_HTTPHEADER => [
"Accept: application/json",
"Content-Type: application/json",
"X-WM-CLIENT-ID: API_KEY",
"X-WM-CLIENT-SECRET: API_KEY"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
const data = JSON.stringify({
"number": "14155552671",
"image": "string",
"caption": "string"
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://api.whatsmate.net/v3/telegram/single/image/message/1");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.setRequestHeader("Accept", "application/json");
xhr.setRequestHeader("X-WM-CLIENT-ID", "API_KEY");
xhr.setRequestHeader("X-WM-CLIENT-SECRET", "API_KEY");
xhr.send(data);
HttpResponse response = Unirest.post("https://api.whatsmate.net/v3/telegram/single/image/message/1")
.header("Content-Type", "application/json")
.header("Accept", "application/json")
.header("X-WM-CLIENT-ID", "API_KEY")
.header("X-WM-CLIENT-SECRET", "API_KEY")
.body("{\"number\":\"14155552671\",\"image\":\"string\",\"caption\":\"string\"}")
.asString();
curl --request POST \
--url https://api.whatsmate.net/v3/telegram/single/image/message/1 \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'X-WM-CLIENT-ID: API_KEY' \
--header 'X-WM-CLIENT-SECRET: API_KEY' \
--data '{"number":"14155552671","image":"string","caption":"string"}'
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.whatsmate.net/v3/telegram/single/image/message/1"
payload := strings.NewReader("{\"number\":\"14155552671\",\"image\":\"string\",\"caption\":\"string\"}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Accept", "application/json")
req.Header.Add("X-WM-CLIENT-ID", "API_KEY")
req.Header.Add("X-WM-CLIENT-SECRET", "API_KEY")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.whatsmate.net/v3/telegram/single/image/message/1")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request["Accept"] = 'application/json'
request["X-WM-CLIENT-ID"] = 'API_KEY'
request["X-WM-CLIENT-SECRET"] = 'API_KEY'
request.body = "{\"number\":\"14155552671\",\"image\":\"string\",\"caption\":\"string\"}"
response = http.request(request)
puts response.read_body
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\"number\":\"14155552671\",\"image\":\"string\",\"caption\":\"string\"}")
val request = Request.Builder()
.url("https://api.whatsmate.net/v3/telegram/single/image/message/1")
.post(body)
.addHeader("Content-Type", "application/json")
.addHeader("Accept", "application/json")
.addHeader("X-WM-CLIENT-ID", "API_KEY")
.addHeader("X-WM-CLIENT-SECRET", "API_KEY")
.build()
val response = client.newCall(request).execute()
POST /v3/telegram/single/image/message/{instance_number}
Send a Telegram image message to a single recipient.
Body parameter
{
"number": "14155552671",
"image": "string",
"caption": "string"
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| instance_number | path | integer | true | Your gateway's instance ID (positive integer) |
| body | body | TelegramMediaRequest | true | none |
Example responses
200 Response
{
"status": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Message queued for delivery | JobResponse |
| 400 | Bad Request | Bad request | ErrorResponse |
| 401 | Unauthorized | Invalid or missing authentication credentials | ErrorResponse |
Send document to single Telegram recipient
Code samples
import http.client
conn = http.client.HTTPSConnection("api.whatsmate.net")
payload = "{\"number\":\"14155552671\",\"document\":\"string\",\"filename\":\"document.pdf\",\"caption\":\"string\"}"
headers = {
'Content-Type': "application/json",
'Accept': "application/json",
'X-WM-CLIENT-ID': "API_KEY",
'X-WM-CLIENT-SECRET': "API_KEY"
}
conn.request("POST", "/v3/telegram/single/document/message/1", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
"https://api.whatsmate.net/v3/telegram/single/document/message/1",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\"number\":\"14155552671\",\"document\":\"string\",\"filename\":\"document.pdf\",\"caption\":\"string\"}",
CURLOPT_HTTPHEADER => [
"Accept: application/json",
"Content-Type: application/json",
"X-WM-CLIENT-ID: API_KEY",
"X-WM-CLIENT-SECRET: API_KEY"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
const data = JSON.stringify({
"number": "14155552671",
"document": "string",
"filename": "document.pdf",
"caption": "string"
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://api.whatsmate.net/v3/telegram/single/document/message/1");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.setRequestHeader("Accept", "application/json");
xhr.setRequestHeader("X-WM-CLIENT-ID", "API_KEY");
xhr.setRequestHeader("X-WM-CLIENT-SECRET", "API_KEY");
xhr.send(data);
HttpResponse response = Unirest.post("https://api.whatsmate.net/v3/telegram/single/document/message/1")
.header("Content-Type", "application/json")
.header("Accept", "application/json")
.header("X-WM-CLIENT-ID", "API_KEY")
.header("X-WM-CLIENT-SECRET", "API_KEY")
.body("{\"number\":\"14155552671\",\"document\":\"string\",\"filename\":\"document.pdf\",\"caption\":\"string\"}")
.asString();
curl --request POST \
--url https://api.whatsmate.net/v3/telegram/single/document/message/1 \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'X-WM-CLIENT-ID: API_KEY' \
--header 'X-WM-CLIENT-SECRET: API_KEY' \
--data '{"number":"14155552671","document":"string","filename":"document.pdf","caption":"string"}'
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.whatsmate.net/v3/telegram/single/document/message/1"
payload := strings.NewReader("{\"number\":\"14155552671\",\"document\":\"string\",\"filename\":\"document.pdf\",\"caption\":\"string\"}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Accept", "application/json")
req.Header.Add("X-WM-CLIENT-ID", "API_KEY")
req.Header.Add("X-WM-CLIENT-SECRET", "API_KEY")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.whatsmate.net/v3/telegram/single/document/message/1")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request["Accept"] = 'application/json'
request["X-WM-CLIENT-ID"] = 'API_KEY'
request["X-WM-CLIENT-SECRET"] = 'API_KEY'
request.body = "{\"number\":\"14155552671\",\"document\":\"string\",\"filename\":\"document.pdf\",\"caption\":\"string\"}"
response = http.request(request)
puts response.read_body
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\"number\":\"14155552671\",\"document\":\"string\",\"filename\":\"document.pdf\",\"caption\":\"string\"}")
val request = Request.Builder()
.url("https://api.whatsmate.net/v3/telegram/single/document/message/1")
.post(body)
.addHeader("Content-Type", "application/json")
.addHeader("Accept", "application/json")
.addHeader("X-WM-CLIENT-ID", "API_KEY")
.addHeader("X-WM-CLIENT-SECRET", "API_KEY")
.build()
val response = client.newCall(request).execute()
POST /v3/telegram/single/document/message/{instance_number}
Send a Telegram document to a single recipient.
Body parameter
{
"number": "14155552671",
"document": "string",
"filename": "document.pdf",
"caption": "string"
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| instance_number | path | integer | true | Your gateway's instance ID (positive integer) |
| body | body | TelegramDocumentRequest | true | none |
Example responses
200 Response
{
"status": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Message queued for delivery | JobResponse |
| 400 | Bad Request | Bad request | ErrorResponse |
| 401 | Unauthorized | Invalid or missing authentication credentials | ErrorResponse |
Send audio to single Telegram recipient
Code samples
import http.client
conn = http.client.HTTPSConnection("api.whatsmate.net")
payload = "{\"number\":\"14155552671\",\"audio\":\"string\",\"filename\":\"audio.mp3\",\"caption\":\"string\"}"
headers = {
'Content-Type': "application/json",
'Accept': "application/json",
'X-WM-CLIENT-ID': "API_KEY",
'X-WM-CLIENT-SECRET': "API_KEY"
}
conn.request("POST", "/v3/telegram/single/audio/message/1", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
"https://api.whatsmate.net/v3/telegram/single/audio/message/1",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\"number\":\"14155552671\",\"audio\":\"string\",\"filename\":\"audio.mp3\",\"caption\":\"string\"}",
CURLOPT_HTTPHEADER => [
"Accept: application/json",
"Content-Type: application/json",
"X-WM-CLIENT-ID: API_KEY",
"X-WM-CLIENT-SECRET: API_KEY"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
const data = JSON.stringify({
"number": "14155552671",
"audio": "string",
"filename": "audio.mp3",
"caption": "string"
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://api.whatsmate.net/v3/telegram/single/audio/message/1");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.setRequestHeader("Accept", "application/json");
xhr.setRequestHeader("X-WM-CLIENT-ID", "API_KEY");
xhr.setRequestHeader("X-WM-CLIENT-SECRET", "API_KEY");
xhr.send(data);
HttpResponse response = Unirest.post("https://api.whatsmate.net/v3/telegram/single/audio/message/1")
.header("Content-Type", "application/json")
.header("Accept", "application/json")
.header("X-WM-CLIENT-ID", "API_KEY")
.header("X-WM-CLIENT-SECRET", "API_KEY")
.body("{\"number\":\"14155552671\",\"audio\":\"string\",\"filename\":\"audio.mp3\",\"caption\":\"string\"}")
.asString();
curl --request POST \
--url https://api.whatsmate.net/v3/telegram/single/audio/message/1 \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'X-WM-CLIENT-ID: API_KEY' \
--header 'X-WM-CLIENT-SECRET: API_KEY' \
--data '{"number":"14155552671","audio":"string","filename":"audio.mp3","caption":"string"}'
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.whatsmate.net/v3/telegram/single/audio/message/1"
payload := strings.NewReader("{\"number\":\"14155552671\",\"audio\":\"string\",\"filename\":\"audio.mp3\",\"caption\":\"string\"}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Accept", "application/json")
req.Header.Add("X-WM-CLIENT-ID", "API_KEY")
req.Header.Add("X-WM-CLIENT-SECRET", "API_KEY")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.whatsmate.net/v3/telegram/single/audio/message/1")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request["Accept"] = 'application/json'
request["X-WM-CLIENT-ID"] = 'API_KEY'
request["X-WM-CLIENT-SECRET"] = 'API_KEY'
request.body = "{\"number\":\"14155552671\",\"audio\":\"string\",\"filename\":\"audio.mp3\",\"caption\":\"string\"}"
response = http.request(request)
puts response.read_body
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\"number\":\"14155552671\",\"audio\":\"string\",\"filename\":\"audio.mp3\",\"caption\":\"string\"}")
val request = Request.Builder()
.url("https://api.whatsmate.net/v3/telegram/single/audio/message/1")
.post(body)
.addHeader("Content-Type", "application/json")
.addHeader("Accept", "application/json")
.addHeader("X-WM-CLIENT-ID", "API_KEY")
.addHeader("X-WM-CLIENT-SECRET", "API_KEY")
.build()
val response = client.newCall(request).execute()
POST /v3/telegram/single/audio/message/{instance_number}
Send a Telegram audio file (e.g., MP3) to a single recipient.
Body parameter
{
"number": "14155552671",
"audio": "string",
"filename": "audio.mp3",
"caption": "string"
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| instance_number | path | integer | true | Your gateway's instance ID (positive integer) |
| body | body | TelegramAudioRequest | true | none |
Example responses
200 Response
{
"status": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Message queued for delivery | JobResponse |
| 400 | Bad Request | Bad request | ErrorResponse |
| 401 | Unauthorized | Invalid or missing authentication credentials | ErrorResponse |
Send voice note to single Telegram recipient
Code samples
import http.client
conn = http.client.HTTPSConnection("api.whatsmate.net")
payload = "{\"number\":\"14155552671\",\"voice_note\":\"string\",\"filename\":\"voice.opus\",\"caption\":\"string\"}"
headers = {
'Content-Type': "application/json",
'Accept': "application/json",
'X-WM-CLIENT-ID': "API_KEY",
'X-WM-CLIENT-SECRET': "API_KEY"
}
conn.request("POST", "/v3/telegram/single/voice_note/message/1", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
"https://api.whatsmate.net/v3/telegram/single/voice_note/message/1",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\"number\":\"14155552671\",\"voice_note\":\"string\",\"filename\":\"voice.opus\",\"caption\":\"string\"}",
CURLOPT_HTTPHEADER => [
"Accept: application/json",
"Content-Type: application/json",
"X-WM-CLIENT-ID: API_KEY",
"X-WM-CLIENT-SECRET: API_KEY"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
const data = JSON.stringify({
"number": "14155552671",
"voice_note": "string",
"filename": "voice.opus",
"caption": "string"
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://api.whatsmate.net/v3/telegram/single/voice_note/message/1");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.setRequestHeader("Accept", "application/json");
xhr.setRequestHeader("X-WM-CLIENT-ID", "API_KEY");
xhr.setRequestHeader("X-WM-CLIENT-SECRET", "API_KEY");
xhr.send(data);
HttpResponse response = Unirest.post("https://api.whatsmate.net/v3/telegram/single/voice_note/message/1")
.header("Content-Type", "application/json")
.header("Accept", "application/json")
.header("X-WM-CLIENT-ID", "API_KEY")
.header("X-WM-CLIENT-SECRET", "API_KEY")
.body("{\"number\":\"14155552671\",\"voice_note\":\"string\",\"filename\":\"voice.opus\",\"caption\":\"string\"}")
.asString();
curl --request POST \
--url https://api.whatsmate.net/v3/telegram/single/voice_note/message/1 \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'X-WM-CLIENT-ID: API_KEY' \
--header 'X-WM-CLIENT-SECRET: API_KEY' \
--data '{"number":"14155552671","voice_note":"string","filename":"voice.opus","caption":"string"}'
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.whatsmate.net/v3/telegram/single/voice_note/message/1"
payload := strings.NewReader("{\"number\":\"14155552671\",\"voice_note\":\"string\",\"filename\":\"voice.opus\",\"caption\":\"string\"}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Accept", "application/json")
req.Header.Add("X-WM-CLIENT-ID", "API_KEY")
req.Header.Add("X-WM-CLIENT-SECRET", "API_KEY")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.whatsmate.net/v3/telegram/single/voice_note/message/1")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request["Accept"] = 'application/json'
request["X-WM-CLIENT-ID"] = 'API_KEY'
request["X-WM-CLIENT-SECRET"] = 'API_KEY'
request.body = "{\"number\":\"14155552671\",\"voice_note\":\"string\",\"filename\":\"voice.opus\",\"caption\":\"string\"}"
response = http.request(request)
puts response.read_body
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\"number\":\"14155552671\",\"voice_note\":\"string\",\"filename\":\"voice.opus\",\"caption\":\"string\"}")
val request = Request.Builder()
.url("https://api.whatsmate.net/v3/telegram/single/voice_note/message/1")
.post(body)
.addHeader("Content-Type", "application/json")
.addHeader("Accept", "application/json")
.addHeader("X-WM-CLIENT-ID", "API_KEY")
.addHeader("X-WM-CLIENT-SECRET", "API_KEY")
.build()
val response = client.newCall(request).execute()
POST /v3/telegram/single/voice_note/message/{instance_number}
Send a Telegram voice note (e.g., opus) to a single recipient.
Body parameter
{
"number": "14155552671",
"voice_note": "string",
"filename": "voice.opus",
"caption": "string"
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| instance_number | path | integer | true | Your gateway's instance ID (positive integer) |
| body | body | TelegramVoiceNoteRequest | true | none |
Example responses
200 Response
{
"status": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Message queued for delivery | JobResponse |
| 400 | Bad Request | Bad request | ErrorResponse |
| 401 | Unauthorized | Invalid or missing authentication credentials | ErrorResponse |
Telegram - Group
Send messages to Telegram groups
Send text message to Telegram group
Code samples
import http.client
conn = http.client.HTTPSConnection("api.whatsmate.net")
payload = "{\"group_name\":\"string\",\"group_admin\":\"14155552671\",\"message\":\"string\"}"
headers = {
'Content-Type': "application/json",
'Accept': "application/json",
'X-WM-CLIENT-ID': "API_KEY",
'X-WM-CLIENT-SECRET': "API_KEY"
}
conn.request("POST", "/v3/telegram/group/text/message/1", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
"https://api.whatsmate.net/v3/telegram/group/text/message/1",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\"group_name\":\"string\",\"group_admin\":\"14155552671\",\"message\":\"string\"}",
CURLOPT_HTTPHEADER => [
"Accept: application/json",
"Content-Type: application/json",
"X-WM-CLIENT-ID: API_KEY",
"X-WM-CLIENT-SECRET: API_KEY"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
const data = JSON.stringify({
"group_name": "string",
"group_admin": "14155552671",
"message": "string"
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://api.whatsmate.net/v3/telegram/group/text/message/1");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.setRequestHeader("Accept", "application/json");
xhr.setRequestHeader("X-WM-CLIENT-ID", "API_KEY");
xhr.setRequestHeader("X-WM-CLIENT-SECRET", "API_KEY");
xhr.send(data);
HttpResponse response = Unirest.post("https://api.whatsmate.net/v3/telegram/group/text/message/1")
.header("Content-Type", "application/json")
.header("Accept", "application/json")
.header("X-WM-CLIENT-ID", "API_KEY")
.header("X-WM-CLIENT-SECRET", "API_KEY")
.body("{\"group_name\":\"string\",\"group_admin\":\"14155552671\",\"message\":\"string\"}")
.asString();
curl --request POST \
--url https://api.whatsmate.net/v3/telegram/group/text/message/1 \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'X-WM-CLIENT-ID: API_KEY' \
--header 'X-WM-CLIENT-SECRET: API_KEY' \
--data '{"group_name":"string","group_admin":"14155552671","message":"string"}'
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.whatsmate.net/v3/telegram/group/text/message/1"
payload := strings.NewReader("{\"group_name\":\"string\",\"group_admin\":\"14155552671\",\"message\":\"string\"}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Accept", "application/json")
req.Header.Add("X-WM-CLIENT-ID", "API_KEY")
req.Header.Add("X-WM-CLIENT-SECRET", "API_KEY")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.whatsmate.net/v3/telegram/group/text/message/1")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request["Accept"] = 'application/json'
request["X-WM-CLIENT-ID"] = 'API_KEY'
request["X-WM-CLIENT-SECRET"] = 'API_KEY'
request.body = "{\"group_name\":\"string\",\"group_admin\":\"14155552671\",\"message\":\"string\"}"
response = http.request(request)
puts response.read_body
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\"group_name\":\"string\",\"group_admin\":\"14155552671\",\"message\":\"string\"}")
val request = Request.Builder()
.url("https://api.whatsmate.net/v3/telegram/group/text/message/1")
.post(body)
.addHeader("Content-Type", "application/json")
.addHeader("Accept", "application/json")
.addHeader("X-WM-CLIENT-ID", "API_KEY")
.addHeader("X-WM-CLIENT-SECRET", "API_KEY")
.build()
val response = client.newCall(request).execute()
POST /v3/telegram/group/text/message/{instance_number}
Send a Telegram text message to a group.
Body parameter
{
"group_name": "string",
"group_admin": "14155552671",
"message": "string"
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| instance_number | path | integer | true | Your gateway's instance ID (positive integer) |
| body | body | TelegramGroupTextRequest | true | none |
Example responses
200 Response
{
"status": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Message queued for delivery | JobResponse |
| 400 | Bad Request | Bad request | ErrorResponse |
| 401 | Unauthorized | Invalid or missing authentication credentials | ErrorResponse |
Send image to Telegram group
Code samples
import http.client
conn = http.client.HTTPSConnection("api.whatsmate.net")
payload = "{\"group_name\":\"string\",\"group_admin\":\"14155552671\",\"image\":\"string\",\"caption\":\"string\"}"
headers = {
'Content-Type': "application/json",
'Accept': "application/json",
'X-WM-CLIENT-ID': "API_KEY",
'X-WM-CLIENT-SECRET': "API_KEY"
}
conn.request("POST", "/v3/telegram/group/image/message/1", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
"https://api.whatsmate.net/v3/telegram/group/image/message/1",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\"group_name\":\"string\",\"group_admin\":\"14155552671\",\"image\":\"string\",\"caption\":\"string\"}",
CURLOPT_HTTPHEADER => [
"Accept: application/json",
"Content-Type: application/json",
"X-WM-CLIENT-ID: API_KEY",
"X-WM-CLIENT-SECRET: API_KEY"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
const data = JSON.stringify({
"group_name": "string",
"group_admin": "14155552671",
"image": "string",
"caption": "string"
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://api.whatsmate.net/v3/telegram/group/image/message/1");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.setRequestHeader("Accept", "application/json");
xhr.setRequestHeader("X-WM-CLIENT-ID", "API_KEY");
xhr.setRequestHeader("X-WM-CLIENT-SECRET", "API_KEY");
xhr.send(data);
HttpResponse response = Unirest.post("https://api.whatsmate.net/v3/telegram/group/image/message/1")
.header("Content-Type", "application/json")
.header("Accept", "application/json")
.header("X-WM-CLIENT-ID", "API_KEY")
.header("X-WM-CLIENT-SECRET", "API_KEY")
.body("{\"group_name\":\"string\",\"group_admin\":\"14155552671\",\"image\":\"string\",\"caption\":\"string\"}")
.asString();
curl --request POST \
--url https://api.whatsmate.net/v3/telegram/group/image/message/1 \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'X-WM-CLIENT-ID: API_KEY' \
--header 'X-WM-CLIENT-SECRET: API_KEY' \
--data '{"group_name":"string","group_admin":"14155552671","image":"string","caption":"string"}'
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.whatsmate.net/v3/telegram/group/image/message/1"
payload := strings.NewReader("{\"group_name\":\"string\",\"group_admin\":\"14155552671\",\"image\":\"string\",\"caption\":\"string\"}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Accept", "application/json")
req.Header.Add("X-WM-CLIENT-ID", "API_KEY")
req.Header.Add("X-WM-CLIENT-SECRET", "API_KEY")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.whatsmate.net/v3/telegram/group/image/message/1")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request["Accept"] = 'application/json'
request["X-WM-CLIENT-ID"] = 'API_KEY'
request["X-WM-CLIENT-SECRET"] = 'API_KEY'
request.body = "{\"group_name\":\"string\",\"group_admin\":\"14155552671\",\"image\":\"string\",\"caption\":\"string\"}"
response = http.request(request)
puts response.read_body
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\"group_name\":\"string\",\"group_admin\":\"14155552671\",\"image\":\"string\",\"caption\":\"string\"}")
val request = Request.Builder()
.url("https://api.whatsmate.net/v3/telegram/group/image/message/1")
.post(body)
.addHeader("Content-Type", "application/json")
.addHeader("Accept", "application/json")
.addHeader("X-WM-CLIENT-ID", "API_KEY")
.addHeader("X-WM-CLIENT-SECRET", "API_KEY")
.build()
val response = client.newCall(request).execute()
POST /v3/telegram/group/image/message/{instance_number}
Send a Telegram image message to a group.
Body parameter
{
"group_name": "string",
"group_admin": "14155552671",
"image": "string",
"caption": "string"
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| instance_number | path | integer | true | Your gateway's instance ID (positive integer) |
| body | body | TelegramGroupMediaRequest | true | none |
Example responses
200 Response
{
"status": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Message queued for delivery | JobResponse |
| 400 | Bad Request | Bad request | ErrorResponse |
| 401 | Unauthorized | Invalid or missing authentication credentials | ErrorResponse |
Send document to Telegram group
Code samples
import http.client
conn = http.client.HTTPSConnection("api.whatsmate.net")
payload = "{\"group_name\":\"string\",\"group_admin\":\"14155552671\",\"document\":\"string\",\"filename\":\"document.pdf\",\"caption\":\"string\"}"
headers = {
'Content-Type': "application/json",
'Accept': "application/json",
'X-WM-CLIENT-ID': "API_KEY",
'X-WM-CLIENT-SECRET': "API_KEY"
}
conn.request("POST", "/v3/telegram/group/document/message/1", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
"https://api.whatsmate.net/v3/telegram/group/document/message/1",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\"group_name\":\"string\",\"group_admin\":\"14155552671\",\"document\":\"string\",\"filename\":\"document.pdf\",\"caption\":\"string\"}",
CURLOPT_HTTPHEADER => [
"Accept: application/json",
"Content-Type: application/json",
"X-WM-CLIENT-ID: API_KEY",
"X-WM-CLIENT-SECRET: API_KEY"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
const data = JSON.stringify({
"group_name": "string",
"group_admin": "14155552671",
"document": "string",
"filename": "document.pdf",
"caption": "string"
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://api.whatsmate.net/v3/telegram/group/document/message/1");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.setRequestHeader("Accept", "application/json");
xhr.setRequestHeader("X-WM-CLIENT-ID", "API_KEY");
xhr.setRequestHeader("X-WM-CLIENT-SECRET", "API_KEY");
xhr.send(data);
HttpResponse response = Unirest.post("https://api.whatsmate.net/v3/telegram/group/document/message/1")
.header("Content-Type", "application/json")
.header("Accept", "application/json")
.header("X-WM-CLIENT-ID", "API_KEY")
.header("X-WM-CLIENT-SECRET", "API_KEY")
.body("{\"group_name\":\"string\",\"group_admin\":\"14155552671\",\"document\":\"string\",\"filename\":\"document.pdf\",\"caption\":\"string\"}")
.asString();
curl --request POST \
--url https://api.whatsmate.net/v3/telegram/group/document/message/1 \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'X-WM-CLIENT-ID: API_KEY' \
--header 'X-WM-CLIENT-SECRET: API_KEY' \
--data '{"group_name":"string","group_admin":"14155552671","document":"string","filename":"document.pdf","caption":"string"}'
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.whatsmate.net/v3/telegram/group/document/message/1"
payload := strings.NewReader("{\"group_name\":\"string\",\"group_admin\":\"14155552671\",\"document\":\"string\",\"filename\":\"document.pdf\",\"caption\":\"string\"}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Accept", "application/json")
req.Header.Add("X-WM-CLIENT-ID", "API_KEY")
req.Header.Add("X-WM-CLIENT-SECRET", "API_KEY")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.whatsmate.net/v3/telegram/group/document/message/1")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request["Accept"] = 'application/json'
request["X-WM-CLIENT-ID"] = 'API_KEY'
request["X-WM-CLIENT-SECRET"] = 'API_KEY'
request.body = "{\"group_name\":\"string\",\"group_admin\":\"14155552671\",\"document\":\"string\",\"filename\":\"document.pdf\",\"caption\":\"string\"}"
response = http.request(request)
puts response.read_body
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\"group_name\":\"string\",\"group_admin\":\"14155552671\",\"document\":\"string\",\"filename\":\"document.pdf\",\"caption\":\"string\"}")
val request = Request.Builder()
.url("https://api.whatsmate.net/v3/telegram/group/document/message/1")
.post(body)
.addHeader("Content-Type", "application/json")
.addHeader("Accept", "application/json")
.addHeader("X-WM-CLIENT-ID", "API_KEY")
.addHeader("X-WM-CLIENT-SECRET", "API_KEY")
.build()
val response = client.newCall(request).execute()
POST /v3/telegram/group/document/message/{instance_number}
Send a Telegram document to a group.
Body parameter
{
"group_name": "string",
"group_admin": "14155552671",
"document": "string",
"filename": "document.pdf",
"caption": "string"
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| instance_number | path | integer | true | Your gateway's instance ID (positive integer) |
| body | body | TelegramGroupDocumentRequest | true | none |
Example responses
200 Response
{
"status": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Message queued for delivery | JobResponse |
| 400 | Bad Request | Bad request | ErrorResponse |
| 401 | Unauthorized | Invalid or missing authentication credentials | ErrorResponse |
Send audio to Telegram group
Code samples
import http.client
conn = http.client.HTTPSConnection("api.whatsmate.net")
payload = "{\"group_name\":\"string\",\"group_admin\":\"14155552671\",\"audio\":\"string\",\"filename\":\"audio.mp3\",\"caption\":\"string\"}"
headers = {
'Content-Type': "application/json",
'Accept': "application/json",
'X-WM-CLIENT-ID': "API_KEY",
'X-WM-CLIENT-SECRET': "API_KEY"
}
conn.request("POST", "/v3/telegram/group/audio/message/1", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
"https://api.whatsmate.net/v3/telegram/group/audio/message/1",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\"group_name\":\"string\",\"group_admin\":\"14155552671\",\"audio\":\"string\",\"filename\":\"audio.mp3\",\"caption\":\"string\"}",
CURLOPT_HTTPHEADER => [
"Accept: application/json",
"Content-Type: application/json",
"X-WM-CLIENT-ID: API_KEY",
"X-WM-CLIENT-SECRET: API_KEY"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
const data = JSON.stringify({
"group_name": "string",
"group_admin": "14155552671",
"audio": "string",
"filename": "audio.mp3",
"caption": "string"
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://api.whatsmate.net/v3/telegram/group/audio/message/1");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.setRequestHeader("Accept", "application/json");
xhr.setRequestHeader("X-WM-CLIENT-ID", "API_KEY");
xhr.setRequestHeader("X-WM-CLIENT-SECRET", "API_KEY");
xhr.send(data);
HttpResponse response = Unirest.post("https://api.whatsmate.net/v3/telegram/group/audio/message/1")
.header("Content-Type", "application/json")
.header("Accept", "application/json")
.header("X-WM-CLIENT-ID", "API_KEY")
.header("X-WM-CLIENT-SECRET", "API_KEY")
.body("{\"group_name\":\"string\",\"group_admin\":\"14155552671\",\"audio\":\"string\",\"filename\":\"audio.mp3\",\"caption\":\"string\"}")
.asString();
curl --request POST \
--url https://api.whatsmate.net/v3/telegram/group/audio/message/1 \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'X-WM-CLIENT-ID: API_KEY' \
--header 'X-WM-CLIENT-SECRET: API_KEY' \
--data '{"group_name":"string","group_admin":"14155552671","audio":"string","filename":"audio.mp3","caption":"string"}'
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.whatsmate.net/v3/telegram/group/audio/message/1"
payload := strings.NewReader("{\"group_name\":\"string\",\"group_admin\":\"14155552671\",\"audio\":\"string\",\"filename\":\"audio.mp3\",\"caption\":\"string\"}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Accept", "application/json")
req.Header.Add("X-WM-CLIENT-ID", "API_KEY")
req.Header.Add("X-WM-CLIENT-SECRET", "API_KEY")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.whatsmate.net/v3/telegram/group/audio/message/1")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request["Accept"] = 'application/json'
request["X-WM-CLIENT-ID"] = 'API_KEY'
request["X-WM-CLIENT-SECRET"] = 'API_KEY'
request.body = "{\"group_name\":\"string\",\"group_admin\":\"14155552671\",\"audio\":\"string\",\"filename\":\"audio.mp3\",\"caption\":\"string\"}"
response = http.request(request)
puts response.read_body
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\"group_name\":\"string\",\"group_admin\":\"14155552671\",\"audio\":\"string\",\"filename\":\"audio.mp3\",\"caption\":\"string\"}")
val request = Request.Builder()
.url("https://api.whatsmate.net/v3/telegram/group/audio/message/1")
.post(body)
.addHeader("Content-Type", "application/json")
.addHeader("Accept", "application/json")
.addHeader("X-WM-CLIENT-ID", "API_KEY")
.addHeader("X-WM-CLIENT-SECRET", "API_KEY")
.build()
val response = client.newCall(request).execute()
POST /v3/telegram/group/audio/message/{instance_number}
Send a Telegram audio file to a group.
Body parameter
{
"group_name": "string",
"group_admin": "14155552671",
"audio": "string",
"filename": "audio.mp3",
"caption": "string"
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| instance_number | path | integer | true | Your gateway's instance ID (positive integer) |
| body | body | TelegramGroupAudioRequest | true | none |
Example responses
200 Response
{
"status": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Message queued for delivery | JobResponse |
| 400 | Bad Request | Bad request | ErrorResponse |
| 401 | Unauthorized | Invalid or missing authentication credentials | ErrorResponse |
Send voice note to Telegram group
Code samples
import http.client
conn = http.client.HTTPSConnection("api.whatsmate.net")
payload = "{\"group_name\":\"string\",\"group_admin\":\"14155552671\",\"voice_note\":\"string\",\"filename\":\"voice.opus\",\"caption\":\"string\"}"
headers = {
'Content-Type': "application/json",
'Accept': "application/json",
'X-WM-CLIENT-ID': "API_KEY",
'X-WM-CLIENT-SECRET': "API_KEY"
}
conn.request("POST", "/v3/telegram/group/voice_note/message/1", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
"https://api.whatsmate.net/v3/telegram/group/voice_note/message/1",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\"group_name\":\"string\",\"group_admin\":\"14155552671\",\"voice_note\":\"string\",\"filename\":\"voice.opus\",\"caption\":\"string\"}",
CURLOPT_HTTPHEADER => [
"Accept: application/json",
"Content-Type: application/json",
"X-WM-CLIENT-ID: API_KEY",
"X-WM-CLIENT-SECRET: API_KEY"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
const data = JSON.stringify({
"group_name": "string",
"group_admin": "14155552671",
"voice_note": "string",
"filename": "voice.opus",
"caption": "string"
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://api.whatsmate.net/v3/telegram/group/voice_note/message/1");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.setRequestHeader("Accept", "application/json");
xhr.setRequestHeader("X-WM-CLIENT-ID", "API_KEY");
xhr.setRequestHeader("X-WM-CLIENT-SECRET", "API_KEY");
xhr.send(data);
HttpResponse response = Unirest.post("https://api.whatsmate.net/v3/telegram/group/voice_note/message/1")
.header("Content-Type", "application/json")
.header("Accept", "application/json")
.header("X-WM-CLIENT-ID", "API_KEY")
.header("X-WM-CLIENT-SECRET", "API_KEY")
.body("{\"group_name\":\"string\",\"group_admin\":\"14155552671\",\"voice_note\":\"string\",\"filename\":\"voice.opus\",\"caption\":\"string\"}")
.asString();
curl --request POST \
--url https://api.whatsmate.net/v3/telegram/group/voice_note/message/1 \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'X-WM-CLIENT-ID: API_KEY' \
--header 'X-WM-CLIENT-SECRET: API_KEY' \
--data '{"group_name":"string","group_admin":"14155552671","voice_note":"string","filename":"voice.opus","caption":"string"}'
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.whatsmate.net/v3/telegram/group/voice_note/message/1"
payload := strings.NewReader("{\"group_name\":\"string\",\"group_admin\":\"14155552671\",\"voice_note\":\"string\",\"filename\":\"voice.opus\",\"caption\":\"string\"}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Accept", "application/json")
req.Header.Add("X-WM-CLIENT-ID", "API_KEY")
req.Header.Add("X-WM-CLIENT-SECRET", "API_KEY")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.whatsmate.net/v3/telegram/group/voice_note/message/1")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request["Accept"] = 'application/json'
request["X-WM-CLIENT-ID"] = 'API_KEY'
request["X-WM-CLIENT-SECRET"] = 'API_KEY'
request.body = "{\"group_name\":\"string\",\"group_admin\":\"14155552671\",\"voice_note\":\"string\",\"filename\":\"voice.opus\",\"caption\":\"string\"}"
response = http.request(request)
puts response.read_body
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\"group_name\":\"string\",\"group_admin\":\"14155552671\",\"voice_note\":\"string\",\"filename\":\"voice.opus\",\"caption\":\"string\"}")
val request = Request.Builder()
.url("https://api.whatsmate.net/v3/telegram/group/voice_note/message/1")
.post(body)
.addHeader("Content-Type", "application/json")
.addHeader("Accept", "application/json")
.addHeader("X-WM-CLIENT-ID", "API_KEY")
.addHeader("X-WM-CLIENT-SECRET", "API_KEY")
.build()
val response = client.newCall(request).execute()
POST /v3/telegram/group/voice_note/message/{instance_number}
Send a Telegram voice note to a group.
Body parameter
{
"group_name": "string",
"group_admin": "14155552671",
"voice_note": "string",
"filename": "voice.opus",
"caption": "string"
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| instance_number | path | integer | true | Your gateway's instance ID (positive integer) |
| body | body | TelegramGroupVoiceNoteRequest | true | none |
Example responses
200 Response
{
"status": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Message queued for delivery | JobResponse |
| 400 | Bad Request | Bad request | ErrorResponse |
| 401 | Unauthorized | Invalid or missing authentication credentials | ErrorResponse |
Translation
Text translation services
Translate text
Code samples
import http.client
conn = http.client.HTTPSConnection("api.whatsmate.net")
payload = "{\"fromLang\":\"en\",\"toLang\":\"es\",\"text\":\"Hello, world!\"}"
headers = {
'Content-Type': "application/json",
'Accept': "text/plain; charset=utf-8",
'X-WM-CLIENT-ID': "API_KEY",
'X-WM-CLIENT-SECRET': "API_KEY"
}
conn.request("POST", "/v1/translation/translate", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
"https://api.whatsmate.net/v1/translation/translate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\"fromLang\":\"en\",\"toLang\":\"es\",\"text\":\"Hello, world!\"}",
CURLOPT_HTTPHEADER => [
"Accept: text/plain; charset=utf-8",
"Content-Type: application/json",
"X-WM-CLIENT-ID: API_KEY",
"X-WM-CLIENT-SECRET: API_KEY"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
const data = JSON.stringify({
"fromLang": "en",
"toLang": "es",
"text": "Hello, world!"
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://api.whatsmate.net/v1/translation/translate");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.setRequestHeader("Accept", "text/plain; charset=utf-8");
xhr.setRequestHeader("X-WM-CLIENT-ID", "API_KEY");
xhr.setRequestHeader("X-WM-CLIENT-SECRET", "API_KEY");
xhr.send(data);
HttpResponse response = Unirest.post("https://api.whatsmate.net/v1/translation/translate")
.header("Content-Type", "application/json")
.header("Accept", "text/plain; charset=utf-8")
.header("X-WM-CLIENT-ID", "API_KEY")
.header("X-WM-CLIENT-SECRET", "API_KEY")
.body("{\"fromLang\":\"en\",\"toLang\":\"es\",\"text\":\"Hello, world!\"}")
.asString();
curl --request POST \
--url https://api.whatsmate.net/v1/translation/translate \
--header 'Accept: text/plain; charset=utf-8' \
--header 'Content-Type: application/json' \
--header 'X-WM-CLIENT-ID: API_KEY' \
--header 'X-WM-CLIENT-SECRET: API_KEY' \
--data '{"fromLang":"en","toLang":"es","text":"Hello, world!"}'
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.whatsmate.net/v1/translation/translate"
payload := strings.NewReader("{\"fromLang\":\"en\",\"toLang\":\"es\",\"text\":\"Hello, world!\"}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Accept", "text/plain; charset=utf-8")
req.Header.Add("X-WM-CLIENT-ID", "API_KEY")
req.Header.Add("X-WM-CLIENT-SECRET", "API_KEY")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.whatsmate.net/v1/translation/translate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request["Accept"] = 'text/plain; charset=utf-8'
request["X-WM-CLIENT-ID"] = 'API_KEY'
request["X-WM-CLIENT-SECRET"] = 'API_KEY'
request.body = "{\"fromLang\":\"en\",\"toLang\":\"es\",\"text\":\"Hello, world!\"}"
response = http.request(request)
puts response.read_body
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\"fromLang\":\"en\",\"toLang\":\"es\",\"text\":\"Hello, world!\"}")
val request = Request.Builder()
.url("https://api.whatsmate.net/v1/translation/translate")
.post(body)
.addHeader("Content-Type", "application/json")
.addHeader("Accept", "text/plain; charset=utf-8")
.addHeader("X-WM-CLIENT-ID", "API_KEY")
.addHeader("X-WM-CLIENT-SECRET", "API_KEY")
.build()
val response = client.newCall(request).execute()
POST /v1/translation/translate
Translate text from one language to another.
Body parameter
{
"fromLang": "en",
"toLang": "es",
"text": "Hello, world!"
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| body | body | TranslationRequest | true | none |
Example responses
200 Response
"string"
400 Response
{
"error_message": "string"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Translated text | string |
| 400 | Bad Request | Bad request | ErrorResponse |
| 401 | Unauthorized | Invalid or missing authentication credentials | ErrorResponse |
| 444 | Unknown | Trial quota exceeded | ErrorResponse |
| 469 | Unknown | Paid quota exceeded | ErrorResponse |
PDF-to-Text
Extract text from PDF documents
Extract text from PDF (synchronous)
Code samples
import http.client
conn = http.client.HTTPSConnection("api.whatsmate.net")
headers = {
'Accept': "text/plain; charset=utf-8",
'X-WM-CLIENT-ID': "API_KEY",
'X-WM-CLIENT-SECRET': "API_KEY"
}
conn.request("GET", "/v1/pdf/extract?url=https%3A%2F%2Fexample.com%2Fdocument.pdf", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
"https://api.whatsmate.net/v1/pdf/extract?url=https%3A%2F%2Fexample.com%2Fdocument.pdf",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Accept: text/plain; charset=utf-8",
"X-WM-CLIENT-ID: API_KEY",
"X-WM-CLIENT-SECRET: API_KEY"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.whatsmate.net/v1/pdf/extract?url=https%3A%2F%2Fexample.com%2Fdocument.pdf");
xhr.setRequestHeader("Accept", "text/plain; charset=utf-8");
xhr.setRequestHeader("X-WM-CLIENT-ID", "API_KEY");
xhr.setRequestHeader("X-WM-CLIENT-SECRET", "API_KEY");
xhr.send(data);
HttpResponse response = Unirest.get("https://api.whatsmate.net/v1/pdf/extract?url=https%3A%2F%2Fexample.com%2Fdocument.pdf")
.header("Accept", "text/plain; charset=utf-8")
.header("X-WM-CLIENT-ID", "API_KEY")
.header("X-WM-CLIENT-SECRET", "API_KEY")
.asString();
curl --request GET \
--url 'https://api.whatsmate.net/v1/pdf/extract?url=https%3A%2F%2Fexample.com%2Fdocument.pdf' \
--header 'Accept: text/plain; charset=utf-8' \
--header 'X-WM-CLIENT-ID: API_KEY' \
--header 'X-WM-CLIENT-SECRET: API_KEY'
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.whatsmate.net/v1/pdf/extract?url=https%3A%2F%2Fexample.com%2Fdocument.pdf"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Accept", "text/plain; charset=utf-8")
req.Header.Add("X-WM-CLIENT-ID", "API_KEY")
req.Header.Add("X-WM-CLIENT-SECRET", "API_KEY")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.whatsmate.net/v1/pdf/extract?url=https%3A%2F%2Fexample.com%2Fdocument.pdf")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["Accept"] = 'text/plain; charset=utf-8'
request["X-WM-CLIENT-ID"] = 'API_KEY'
request["X-WM-CLIENT-SECRET"] = 'API_KEY'
response = http.request(request)
puts response.read_body
val client = OkHttpClient()
val request = Request.Builder()
.url("https://api.whatsmate.net/v1/pdf/extract?url=https%3A%2F%2Fexample.com%2Fdocument.pdf")
.get()
.addHeader("Accept", "text/plain; charset=utf-8")
.addHeader("X-WM-CLIENT-ID", "API_KEY")
.addHeader("X-WM-CLIENT-SECRET", "API_KEY")
.build()
val response = client.newCall(request).execute()
GET /v1/pdf/extract
Extract text from a PDF file synchronously.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| url | query | string(uri) | true | URL of the PDF file to process |
Example responses
200 Response
"string"
400 Response
{
"error_message": "string"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Extracted text | string |
| 400 | Bad Request | Bad request | ErrorResponse |
| 401 | Unauthorized | Invalid or missing authentication credentials | ErrorResponse |
| 500 | Internal Server Error | Invalid PDF or processing error | ErrorResponse |
Submit PDF extraction job (asynchronous)
Code samples
import http.client
conn = http.client.HTTPSConnection("api.whatsmate.net")
headers = {
'Accept': "application/json",
'X-WM-CLIENT-ID': "API_KEY",
'X-WM-CLIENT-SECRET': "API_KEY"
}
conn.request("GET", "/v1/pdf/job/submit?url=https%3A%2F%2Fexample.com%2Fdocument.pdf", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
"https://api.whatsmate.net/v1/pdf/job/submit?url=https%3A%2F%2Fexample.com%2Fdocument.pdf",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Accept: application/json",
"X-WM-CLIENT-ID: API_KEY",
"X-WM-CLIENT-SECRET: API_KEY"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.whatsmate.net/v1/pdf/job/submit?url=https%3A%2F%2Fexample.com%2Fdocument.pdf");
xhr.setRequestHeader("Accept", "application/json");
xhr.setRequestHeader("X-WM-CLIENT-ID", "API_KEY");
xhr.setRequestHeader("X-WM-CLIENT-SECRET", "API_KEY");
xhr.send(data);
HttpResponse response = Unirest.get("https://api.whatsmate.net/v1/pdf/job/submit?url=https%3A%2F%2Fexample.com%2Fdocument.pdf")
.header("Accept", "application/json")
.header("X-WM-CLIENT-ID", "API_KEY")
.header("X-WM-CLIENT-SECRET", "API_KEY")
.asString();
curl --request GET \
--url 'https://api.whatsmate.net/v1/pdf/job/submit?url=https%3A%2F%2Fexample.com%2Fdocument.pdf' \
--header 'Accept: application/json' \
--header 'X-WM-CLIENT-ID: API_KEY' \
--header 'X-WM-CLIENT-SECRET: API_KEY'
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.whatsmate.net/v1/pdf/job/submit?url=https%3A%2F%2Fexample.com%2Fdocument.pdf"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Accept", "application/json")
req.Header.Add("X-WM-CLIENT-ID", "API_KEY")
req.Header.Add("X-WM-CLIENT-SECRET", "API_KEY")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.whatsmate.net/v1/pdf/job/submit?url=https%3A%2F%2Fexample.com%2Fdocument.pdf")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["Accept"] = 'application/json'
request["X-WM-CLIENT-ID"] = 'API_KEY'
request["X-WM-CLIENT-SECRET"] = 'API_KEY'
response = http.request(request)
puts response.read_body
val client = OkHttpClient()
val request = Request.Builder()
.url("https://api.whatsmate.net/v1/pdf/job/submit?url=https%3A%2F%2Fexample.com%2Fdocument.pdf")
.get()
.addHeader("Accept", "application/json")
.addHeader("X-WM-CLIENT-ID", "API_KEY")
.addHeader("X-WM-CLIENT-SECRET", "API_KEY")
.build()
val response = client.newCall(request).execute()
GET /v1/pdf/job/submit
Submit a job to extract text from a PDF asynchronously.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| url | query | string(uri) | true | URL of the PDF file to process |
Example responses
200 Response
{
"status": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Job submitted | JobResponse |
| 400 | Bad Request | Bad request | ErrorResponse |
| 401 | Unauthorized | Invalid or missing authentication credentials | ErrorResponse |
Check PDF job status
Code samples
import http.client
conn = http.client.HTTPSConnection("api.whatsmate.net")
headers = {
'Accept': "application/json",
'X-WM-CLIENT-ID': "API_KEY",
'X-WM-CLIENT-SECRET': "API_KEY"
}
conn.request("GET", "/v1/pdf/job/check/123e4567-e89b-12d3-a456-426614174000", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
"https://api.whatsmate.net/v1/pdf/job/check/123e4567-e89b-12d3-a456-426614174000",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Accept: application/json",
"X-WM-CLIENT-ID: API_KEY",
"X-WM-CLIENT-SECRET: API_KEY"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.whatsmate.net/v1/pdf/job/check/123e4567-e89b-12d3-a456-426614174000");
xhr.setRequestHeader("Accept", "application/json");
xhr.setRequestHeader("X-WM-CLIENT-ID", "API_KEY");
xhr.setRequestHeader("X-WM-CLIENT-SECRET", "API_KEY");
xhr.send(data);
HttpResponse response = Unirest.get("https://api.whatsmate.net/v1/pdf/job/check/123e4567-e89b-12d3-a456-426614174000")
.header("Accept", "application/json")
.header("X-WM-CLIENT-ID", "API_KEY")
.header("X-WM-CLIENT-SECRET", "API_KEY")
.asString();
curl --request GET \
--url https://api.whatsmate.net/v1/pdf/job/check/123e4567-e89b-12d3-a456-426614174000 \
--header 'Accept: application/json' \
--header 'X-WM-CLIENT-ID: API_KEY' \
--header 'X-WM-CLIENT-SECRET: API_KEY'
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.whatsmate.net/v1/pdf/job/check/123e4567-e89b-12d3-a456-426614174000"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Accept", "application/json")
req.Header.Add("X-WM-CLIENT-ID", "API_KEY")
req.Header.Add("X-WM-CLIENT-SECRET", "API_KEY")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.whatsmate.net/v1/pdf/job/check/123e4567-e89b-12d3-a456-426614174000")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["Accept"] = 'application/json'
request["X-WM-CLIENT-ID"] = 'API_KEY'
request["X-WM-CLIENT-SECRET"] = 'API_KEY'
response = http.request(request)
puts response.read_body
val client = OkHttpClient()
val request = Request.Builder()
.url("https://api.whatsmate.net/v1/pdf/job/check/123e4567-e89b-12d3-a456-426614174000")
.get()
.addHeader("Accept", "application/json")
.addHeader("X-WM-CLIENT-ID", "API_KEY")
.addHeader("X-WM-CLIENT-SECRET", "API_KEY")
.build()
val response = client.newCall(request).execute()
GET /v1/pdf/job/check/{jobId}
Check the status of a PDF extraction job.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| jobId | path | string(uuid) | true | The job ID returned from job submission |
Example responses
200 Response
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"status": "submitted"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Job status | JobStatusResponse |
| 400 | Bad Request | Job ID not specified or job not found | ErrorResponse |
Retrieve extracted PDF text
Code samples
import http.client
conn = http.client.HTTPSConnection("api.whatsmate.net")
headers = {
'Accept': "text/plain; charset=utf-8",
'X-WM-CLIENT-ID': "API_KEY",
'X-WM-CLIENT-SECRET': "API_KEY"
}
conn.request("GET", "/v1/pdf/job/retrieve_text/123e4567-e89b-12d3-a456-426614174000", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
"https://api.whatsmate.net/v1/pdf/job/retrieve_text/123e4567-e89b-12d3-a456-426614174000",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Accept: text/plain; charset=utf-8",
"X-WM-CLIENT-ID: API_KEY",
"X-WM-CLIENT-SECRET: API_KEY"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.whatsmate.net/v1/pdf/job/retrieve_text/123e4567-e89b-12d3-a456-426614174000");
xhr.setRequestHeader("Accept", "text/plain; charset=utf-8");
xhr.setRequestHeader("X-WM-CLIENT-ID", "API_KEY");
xhr.setRequestHeader("X-WM-CLIENT-SECRET", "API_KEY");
xhr.send(data);
HttpResponse response = Unirest.get("https://api.whatsmate.net/v1/pdf/job/retrieve_text/123e4567-e89b-12d3-a456-426614174000")
.header("Accept", "text/plain; charset=utf-8")
.header("X-WM-CLIENT-ID", "API_KEY")
.header("X-WM-CLIENT-SECRET", "API_KEY")
.asString();
curl --request GET \
--url https://api.whatsmate.net/v1/pdf/job/retrieve_text/123e4567-e89b-12d3-a456-426614174000 \
--header 'Accept: text/plain; charset=utf-8' \
--header 'X-WM-CLIENT-ID: API_KEY' \
--header 'X-WM-CLIENT-SECRET: API_KEY'
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.whatsmate.net/v1/pdf/job/retrieve_text/123e4567-e89b-12d3-a456-426614174000"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Accept", "text/plain; charset=utf-8")
req.Header.Add("X-WM-CLIENT-ID", "API_KEY")
req.Header.Add("X-WM-CLIENT-SECRET", "API_KEY")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.whatsmate.net/v1/pdf/job/retrieve_text/123e4567-e89b-12d3-a456-426614174000")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["Accept"] = 'text/plain; charset=utf-8'
request["X-WM-CLIENT-ID"] = 'API_KEY'
request["X-WM-CLIENT-SECRET"] = 'API_KEY'
response = http.request(request)
puts response.read_body
val client = OkHttpClient()
val request = Request.Builder()
.url("https://api.whatsmate.net/v1/pdf/job/retrieve_text/123e4567-e89b-12d3-a456-426614174000")
.get()
.addHeader("Accept", "text/plain; charset=utf-8")
.addHeader("X-WM-CLIENT-ID", "API_KEY")
.addHeader("X-WM-CLIENT-SECRET", "API_KEY")
.build()
val response = client.newCall(request).execute()
GET /v1/pdf/job/retrieve_text/{jobId}
Retrieve the extracted text from a completed PDF job.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| jobId | path | string(uuid) | true | The job ID returned from job submission |
Example responses
200 Response
"string"
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"status": "submitted"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | OK - Returns extracted text if job completed (text/plain) or job status if still processing (application/json) | JobStatusResponse |
| 400 | Bad Request | Job ID not specified or job not found | ErrorResponse |
| 500 | Internal Server Error | Text no longer exists | ErrorResponse |
Schemas
JobResponse
{
"status": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| status | string | false | none | Current job status (queued, submitted, Processing, Completed) |
| id | string(uuid) | false | none | Unique job identifier |
JobStatusResponse
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"status": "submitted"
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| id | string(uuid) | false | none | none |
| status | string | false | none | none |
Enumerated Values
| Property | Value |
|---|---|
| status | submitted |
| status | Processing |
| status | Completed |
ErrorResponse
{
"error_message": "string"
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| error_message | string | false | none | Human-readable error description |
WhatsappTextRequest
{
"number": "14155552671",
"message": "Hello from WhatsMate!"
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| number | string | true | none | Recipient's phone number with country code (no "+" sign) |
| message | string | true | none | Text message to send |
WhatsappGroupTextRequest
{
"group_name": "My WhatsApp Group",
"group_admin": "14155552671",
"message": "string"
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| group_name | string | true | none | Name of the WhatsApp group |
| group_admin | string | true | none | Phone number of the group creator (with country code) |
| message | string | true | none | Text message to send |
WhatsappMediaRequest
{
"number": "14155552671",
"image": "string",
"caption": "string"
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| number | string | true | none | Recipient's phone number with country code (no "+" sign) |
| image | string(base64) | true | none | Base64-encoded image (max 6 MB after encoding) |
| caption | string | false | none | Optional caption for the image |
WhatsappDocumentRequest
{
"number": "14155552671",
"document": "string",
"filename": "document.pdf"
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| number | string | true | none | Recipient's phone number with country code (no "+" sign) |
| document | string(base64) | true | none | Base64-encoded document (PDF, MP3, etc., max 9 MB after encoding) |
| filename | string | true | none | File name presented to receiver (special characters will be removed) |
WhatsappGroupMediaRequest
{
"group_name": "string",
"image": "string",
"caption": "string"
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| group_name | string | true | none | Name of the WhatsApp group |
| image | string(base64) | true | none | Base64-encoded image (max 6 MB after encoding) |
| caption | string | false | none | Optional caption for the image |
WhatsappGroupDocumentRequest
{
"group_name": "string",
"document": "string",
"filename": "document.pdf"
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| group_name | string | true | none | Name of the WhatsApp group |
| document | string(base64) | true | none | Base64-encoded document (max 9 MB after encoding) |
| filename | string | true | none | File name presented to receiver (special characters will be removed) |
TelegramTextRequest
{
"number": "14155552671",
"message": "string"
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| number | string | true | none | Recipient's phone number with country code (no "+" sign) |
| message | string | true | none | Text message to send |
TelegramGroupTextRequest
{
"group_name": "string",
"group_admin": "14155552671",
"message": "string"
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| group_name | string | true | none | Name of the Telegram group |
| group_admin | string | true | none | Phone number of the group creator (no "+" sign) |
| message | string | true | none | Text message to send |
TelegramMediaRequest
{
"number": "14155552671",
"image": "string",
"caption": "string"
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| number | string | true | none | Recipient's phone number with country code (no "+" sign) |
| image | string(base64) | true | none | Base64-encoded image (max 6 MB after encoding) |
| caption | string | false | none | Optional caption for the image |
TelegramDocumentRequest
{
"number": "14155552671",
"document": "string",
"filename": "document.pdf",
"caption": "string"
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| number | string | true | none | Recipient's phone number with country code (no "+" sign) |
| document | string(base64) | true | none | Base64-encoded document (max 9 MB after encoding) |
| filename | string | true | none | File name presented to receiver (special characters will be removed) |
| caption | string | false | none | Optional caption for the document |
TelegramGroupMediaRequest
{
"group_name": "string",
"group_admin": "14155552671",
"image": "string",
"caption": "string"
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| group_name | string | true | none | Name of the Telegram group |
| group_admin | string | true | none | Phone number of the group creator (no "+" sign) |
| image | string(base64) | true | none | Base64-encoded image (max 6 MB after encoding) |
| caption | string | false | none | Optional caption for the image |
TelegramGroupDocumentRequest
{
"group_name": "string",
"group_admin": "14155552671",
"document": "string",
"filename": "document.pdf",
"caption": "string"
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| group_name | string | true | none | Name of the Telegram group |
| group_admin | string | true | none | Phone number of the group creator (no "+" sign) |
| document | string(base64) | true | none | Base64-encoded document (max 9 MB after encoding) |
| filename | string | true | none | File name presented to receiver (special characters will be removed) |
| caption | string | false | none | Optional caption for the document |
TelegramVoiceNoteRequest
{
"number": "14155552671",
"voice_note": "string",
"filename": "voice.opus",
"caption": "string"
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| number | string | true | none | Recipient's phone number with country code (no "+" sign) |
| voice_note | string(base64) | true | none | Base64-encoded voice note file (opus, max 3 MB after encoding) |
| filename | string | true | none | File name presented to receiver (special characters will be removed) |
| caption | string | false | none | Optional caption for the voice note |
TelegramGroupVoiceNoteRequest
{
"group_name": "string",
"group_admin": "14155552671",
"voice_note": "string",
"filename": "voice.opus",
"caption": "string"
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| group_name | string | true | none | Name of the Telegram group |
| group_admin | string | true | none | Phone number of the group creator (no "+" sign) |
| voice_note | string(base64) | true | none | Base64-encoded voice note file (opus, max 3 MB after encoding) |
| filename | string | true | none | File name presented to receiver (special characters will be removed) |
| caption | string | false | none | Optional caption for the voice note |
TelegramAudioRequest
{
"number": "14155552671",
"audio": "string",
"filename": "audio.mp3",
"caption": "string"
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| number | string | true | none | Recipient's phone number with country code (no "+" sign) |
| audio | string(base64) | true | none | Base64-encoded audio file (e.g., MP3, max 3 MB after encoding) |
| filename | string | true | none | File name presented to receiver (special characters will be removed) |
| caption | string | false | none | Optional caption for the audio |
TelegramGroupAudioRequest
{
"group_name": "string",
"group_admin": "14155552671",
"audio": "string",
"filename": "audio.mp3",
"caption": "string"
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| group_name | string | true | none | Name of the Telegram group |
| group_admin | string | true | none | Phone number of the group creator (no "+" sign) |
| audio | string(base64) | true | none | Base64-encoded audio file (e.g., MP3, max 3 MB after encoding) |
| filename | string | true | none | File name presented to receiver (special characters will be removed) |
| caption | string | false | none | Optional caption for the audio |
HealthStatusResponse
{}
Health status of the gateway instance (structure depends on backend)
Properties
None
RegistrationStatusResponse
{}
Registration status of a phone number (structure depends on backend)
Properties
None
TranslationRequest
{
"fromLang": "en",
"toLang": "es",
"text": "Hello, world!"
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| fromLang | string | true | none | Source language code (e.g., "en" for English) |
| toLang | string | true | none | Target language code (e.g., "es" for Spanish) |
| text | string | true | none | Text to translate (max 3500 characters) |
LanguageCodesResponse
{
"en": "English",
"es": "Spanish",
"zh": "Chinese"
}
Map of language codes to language names
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| additionalProperties | string | false | none | none |