Submit audio file
Submit a new process using audio file upload
You can upload an audio file to start a new processing request /clients/{cid}/processes/audio. The audio file can be wav, mp3 or other non-proprietary audio encoding formats.
The cid path parameter is the project id (created from the UI - check Create a Project and API Token).
Along the audio, you can also include the following query parameters:
Parameter | Description |
---|---|
name | An name that describes the audio |
meta | A JSON string that includes additional user-defined information |
embeddings | A boolean parameter (true/false) used to select whether to return embeddings in the response |
Example request:
curl --request POST \
--url https://api.behavioralsignals.com/clients/your-client-id/processes/audio \
--header 'X-Auth-Token: your-api-token' \
--header 'accept: application/json' \
--header 'content-type: multipart/form-data' \
--form name=my-awesome-audio \
--form embeddings=false \
--form 'meta={"key": "value"}'
Example response:
{
"pid": 1,
"cid": "<your-client-id>",
"name": "my-awesome-audio",
"status": 0,
"statusmsg": "Pending",
"duration": 0,
"datetime": "2024-07-19T11:54:37.900Z",
"meta": "{\"key\": \"value\"}"
}
When the request is sent to the API service, the user will get a JSON response that will either contain the new process that was inserted in the system for processing in case of success or an error code in case an error occurred. On successful insertion, the response contains the unique process ID (long: id) given by the system that is necessary for the user to access the state and the result of the processing. It also includes the fields that were given by the user, fields that show the state of processing and results fields that are set to default values and will be updated during processing by the system.
In case a new incoming request cannot be inserted into the system for processing, an error is returned so the user is informed that their request failed.
Updated 4 months ago