Search
Close this search box.

< / >

APIs Configuration

23. Upload audio

URL:

https://wv{{wolkvox_server}}.wolkvox.com/api/v2/configuration.php?api=upload_audio

Description:

The “Upload Audio” API allows users to upload audio files to wolkvox Manager either in bulk or individually, with a limit of up to 50 audio files per request. These audio files can be used in various sections of wolkvox Manager and in wolkvox Studio components, such as the ‘Play Audio’ component, which plays pre-recorded messages within the configured flows.

Benefits:

✅ Bulk audio upload, reducing the time spent managing sound files in wolkvox Manager.
✅ Facilitates audio customization in different sections of the system, enhancing the user experience.
✅ Greater automation, as it allows integration with other systems to upload audio files programmatically.

With this API, wolkvox users have greater control and efficiency in managing audio files within their operations.

¿How It Works?

  • The consumption of this API is done via the ‘POST’ method
  • The body of the API must be of type ‘form-data’.
  • To consume this API, replace ‘{{wolkvox_server}}’ in the URL with the server nomenclature of your operation.
  • You must use ‘wolkvox-token: {{token}}’ in the Header to utilize the authorization token.
  • Note that the same token cannot be consumed simultaneously; therefore, you can schedule the next API call to occur only after the previous one has been successful.
  • In terms of timing, you can track your operation by making a request every 5 minutes.

 

Limits

  • Maximum records that can be downloaded per request: 60,000 records.
  • Maximum records that can be uploaded per request: 10,000 records.
  • Maximum date range for queries: 31 days.
  • Maximum result size: 256 MB.
  • Maximum API consumption time: 60 seconds.
  • Maximum simultaneous consumption of a token: 2 concurrent requests.
  • Daily token limit: Number of licenses multiplied by 1,000 daily tokens.
  • Each audio file cannot exceed 5MB in size.
 
Note: 
When using the API to upload audio files, files can be handled in two ways depending on the quantity and desired structure:
  1. To upload a single file in each field, use a ‘Key’ with a unique identifier. Example: ‘file1’, ‘file2’, etc.
  2. If you need to upload multiple files in the same field, the ‘Key’ should be defined as an array by adding ‘[]’ at the end. Example: ‘file[]’.
 

Code Examples:

In our Postman workspace (click here to access), you will find code examples that facilitate integration with our APIs in various programming languages, such as cURL, Python, JavaScript, and more.

This functionality is ideal for quick integrations and allows you to adapt API calls according to your system’s programming language.

How to Use the Code Examples:

  1. Navigate to our Postman workspace.
  2. Select the API you wish to query.
  3. Edit the necessary API parameters according to your objectives.
  4. In the “Code” tab, select your preferred programming language.
  5. You will receive an autogenerated code snippet, ready to use with the previously configured parameters and authentication.
 

Request

NAMEDESCRIPTIONTYPE
wolkvox-token
wolkvox Manager access token.
String
file
“File” type field where you must upload the file to be submitted.
File

Response

NAMEDESCRIPTIONTYPE
code
Response code.
int
errorError.String
msg
Response description.
String
data
Array of objects containing information about each notification.
String
filename
Name of the successfully uploaded file.
String
Possible response codes
				
					$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://wv{{wolkvox_server}}.wolkvox.com/api/v2/configuration.php?api=upload_audio',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => array('{{file1}}'=> new CURLFILE('/path/to/file')),
  CURLOPT_HTTPHEADER => array(
    'wolkvox-token: {{wolkvox-token}}'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

				
			

RESPONSE

				
					{
    "code": "201",
    "error": null,
    "msg": "X audio file(s) uploaded successfully",
    "data": [
        {
            "filename": "filename.extension"
        }
    ]
}
				
			
We use cookies, if you continue browsing we will assume that you agree. You can read more about the use of cookies in our privacy policies and treatment of personal data