Getting Audio Files
  • 21 Feb 2024
  • 1 Minute to read
  • Contributors
  • PDF

Getting Audio Files

  • PDF

Article summary

Getting Audio Files

If you are a customer who would like to receive the files stored in MinIO of Virtual Agent product it is possible to do it via necessary credentials.

As the first step to create or get API credentials please refer to the Step 0 here: API Documentation

Exceptions in Step 0 in API Documentation
    1. Client ID format here should be “va_external_dataservice_client_< TenantName >”
    1. Choose and add "dataservice_external API"

1. Get Token for Access

If you are using a version higher than v1.75, authentication step is not necessary.

Sample token request body:

This is an example token request body, here you will enter the credentials you were given, and the URLs below are examples as well.

Base URL: https://eu.va.knovvu.com/
Identity URL: https://identity.eu.va.knovvu.com/
Token Endpoint: https://identity.eu.va.knovvu.com/connect/token

Method: POST

Parameters:
client_id: <your unique client id>
client_secret: <your unique client secret>
grant_type: client_credentials
scope: dataservice_external

MicrosoftTeams-image 1.png

After entering your credentials, click send and you will get a response body.

Sample response body:

{
    "access_token": "your unique token",
    "expires_in": 86400,
    "token_type": "Bearer",
    "scope": "dataservice_external"
}

2. Get File from Minio

The token should be entered in the Authorization part as Bearer Token.

In the Parameters part:

  1. Enter the key for the Minio file.
  2. IsVoiceOutput paramater could be true or false
    true= if the voice file was generated from the orchestrator
    false= if the voice file was sent from your side

Example request:

For v1.75 and above, use the following endpoint:
Method: GET

Endpoint: https://eu.va.knovvu.com/api/external/minio/audio?key=<your unique key>&tenantName=<tenantName>
For below v1.75, use the following endpoint:
Method: GET

Endpoint: https://eu.va.knovvu.com/api/external/minio?key=<your unique key>&isVoiceOutput=<true or false>

MicrosoftTeams-image 2.png

Example Response (v1.75 and above)

The response body will include the requested audio file, and Content-Type of the audio file will be included in response headers.

image.png

3. Write Voice File to Minio

The token should be entered in the Authorization part as Bearer Token.

In the Parameters part:

  1. Enter a unique key that you create (suggested format is 32 alphanumeric characters)
  2. IsVoiceOutput paramater must be "false"

In the Body section, add the file as form-data.

Example request:

Method: POST

Endpoint: https://eu.va.knovvu.com/api/external/minio?key=<your unique key>&isVoiceOutput=false

Example for the Body:

MicrosoftTeams-image 6.png

Response body would turn as "200 OK".


Was this article helpful?

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.