Voice status

Post a voice status (story) to WhatsApp.

POST
https://api.wawp.net/v2/status/voice?instance_id=123456789&access_token=YOUR_ACCESS_TOKEN&file%5Burl%5D=https%3A%2F%2Fwawp.net%2Fsamples%2Ffile_example_OOG_1MG.ogg&file%5Bfilename%5D=note.ogg&file%5Bmimetype%5D=audio%2Fogg%3B+codecs%3Dopus&convert=true&caption=Listen+to+this%21

Authentication Required

Login to swap the placeholders with your real Instance ID and Access Token.

Log In
Test /v2/status/voice endpoint
POST
POST

No query parameters required

This endpoint doesn't expect data in the URL.

Best practices

  • Use clear audio; background noise can be distracting.

  • Add a background color that matches your brand.

Request Parameters

Configure the parameters required to interact with this endpoint. All query and body arguments are listed below with their details.

Request Body

Sent as a JSON object
string

WhatsApp Instance ID

Example:
string

API Access Token

Example:
string

URL to the audio file (ogg/opus recommended)

Example:
string

Name of the file

Example:
string

MIME type

Example:
boolean

Enable auto-conversion

Example:
string

Caption for the voice status

Example:

Request Samples

Use these ready-to-go code snippets to integrate our API into your project quickly and efficiently. Choose your preferred language and library.

1const baseUrl = "https://api.wawp.net";
2const endpoint = "/v2/status/voice";
3const params = new URLSearchParams({
4 "instance_id": "123456789",
5 "access_token": "YOUR_ACCESS_TOKEN"
6}).toString();
7const body = {
8 "file[url]": "https://wawp.net/samples/file_example_OOG_1MG.ogg",
9 "file[filename]": "note.ogg",
10 "file[mimetype]": "audio/ogg; codecs=opus",
11 "convert": "true",
12 "caption": "Listen to this!"
13};
14
15fetch(`${baseUrl}${endpoint}${params ? '?' + params : ''}`, {
16 method: "POST",
17 headers: { "Content-Type": "application/json" },
18 body: JSON.stringify(body)
19})
20 .then(async (response) => {
21 if (response.ok) {
22 const data = await response.json();
23 console.log("Success:", data);
24 return data;
25 }
26
27 // Error Handling
28 if (response.status === 400) {
29 console.error("Error 400: Bad Request - Missing Required Parameter(s)");
30 }
31 if (response.status === 400) {
32 console.error("Error 400: Bad Request (XML Format)");
33 }
34 if (response.status === 400) {
35 console.error("Error 400: Bad Request (Plain Text)");
36 }
37 if (response.status === 401) {
38 console.error("Error 401: Unauthorized - Invalid or Missing Access Token");
39 }
40 if (response.status === 401) {
41 console.error("Error 401: Unauthorized (XML Format)");
42 }
43 if (response.status === 404) {
44 console.error("Error 404: Not Found - Session Does Not Exist");
45 }
46 if (response.status === 404) {
47 console.error("Error 404: Not Found (XML Format)");
48 }
49 if (response.status === 500) {
50 console.error("Error 500: Internal Server Error - Unexpected Failure");
51 }
52 if (response.status === 500) {
53 console.error("Error 500: Internal Server Error (HTML)");
54 }
55 if (response.status === 502) {
56 console.error("Error 502: Bad Gateway - Connection Failed to Upstream");
57 }
58 if (response.status === 502) {
59 console.error("Error 502: Bad Gateway (XML Format)");
60 }
61
62 const errorText = await response.text();
63 console.error(`Error ${response.status}: ${errorText}`);
64 })
65 .catch((error) => console.error("Network Error:", error));
Interactive Samples
Ln 65, Col 1javascript

Expected Responses

Explore all possible responses and outcomes from the server. We have documented each status code with data examples to make success and error handling easier.

Success - Request completed successfully
Type:
application/json
boolean *
string *

Example

{
"success": true,
"message": "Operation completed successfully"
}
Bad Request - Missing Required Parameter(s)
Unauthorized - Invalid or Missing Access Token
Not Found - Session Does Not Exist
Internal Server Error - Unexpected Failure
Bad Gateway - Connection Failed to Upstream
Previous TopicImage status
Next TopicVideo status

Command Palette

Search for a command to run...