# Liste des fichiers audio

## URL

<mark style="color:red;">`GET`</mark> `https://api.voicepartner.fr/v1/audios`

{% hint style="warning" %}
Limite de 360 requêtes par minute. Si vous dépassez ces limites vous recevrez une réponse HTTP 429.
{% endhint %}

#### **Paramètres obligatoires**

<table data-full-width="false"><thead><tr><th width="180">Nom</th><th>Valeur</th></tr></thead><tbody><tr><td><code>apiKey</code></td><td><a href="https://my.voicepartner.fr/app/api">Votre clé API</a></td></tr></tbody></table>

#### Requêtes

{% tabs %}
{% tab title="PHP" %}

```php
<?php

// L'URL de l'API où vous voulez envoyer la requête
$url = 'http://api.voicepartner.fr/v1/audios/YOUR_API_KEY';

// Initialisation de cURL
$curl = curl_init($url);

// Configuration des options de cURL
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, [
    'Cache-Control: no-cache'
]);

// Exécution de la requête cURL et enregistrement de la réponse
$response = curl_exec($curl);

// Vérification s'il y a eu des erreurs pendant l'exécution de la requête
if ($response === false) {
    // Gérer l'erreur ici
    $error = curl_error($curl);
    curl_close($curl);
    die("Erreur cURL: $error");
}

// Fermeture de la session cURL
curl_close($curl);

// Affichage de la réponse
echo $response;
```

{% endtab %}

{% tab title="VB.net" %}

```vbnet
﻿Imports System.Net.Http

Public Class ListeFichierAudio
    Public Async Function GetAudios(client As HttpClient, apiKey As String) As Task
        Dim url As String = $"audios/{apiKey}"

        Try
            Dim response As HttpResponseMessage = Await client.GetAsync(url)
            If response.IsSuccessStatusCode Then
                Dim responseString As String = Await response.Content.ReadAsStringAsync()
                Console.WriteLine("Audios: " & responseString)
            Else
                Console.WriteLine("Error: " & response.ReasonPhrase)
            End If
        Catch ex As Exception
            Console.WriteLine("Exception: " & ex.Message)
        End Try
    End Function
End Class
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

# L'URL de l'API où vous voulez envoyer la requête
url = 'http://api.voicepartner.fr/v1/audios/YOUR_API_KEY'

# Configuration des en-têtes HTTP
headers = {
    'Cache-Control': 'no-cache'
}

# Exécution de la requête GET et enregistrement de la réponse
response = requests.get(url, headers=headers)

# Vérification du statut de la réponse
if response.status_code == 200:
    # Affichage de la réponse
    print(response.text)
else:
    # Gérer l'erreur ici
    print(f"Erreur lors de la requête: {response.status_code}")
```

{% endtab %}

{% tab title="cURL" %}

```
curl http://api.voicepartner.fr/v1/audios/YOUR_API_KEY
```

{% endtab %}

{% tab title="Nodejs" %}

```javascript
const axios = require('axios');

// L'URL de l'API où vous voulez envoyer la requête
const url = 'http://api.voicepartner.fr/v1/audios/YOUR_API_KEY';

axios.get(url)
    .then(response => {
        console.log(response.data);
    })
    .catch(error => {
        console.error('Erreur lors de la requête:', error);
    });
```

{% endtab %}

{% tab title="JAVA" %}

```java
package com.example.API;

import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.http.HttpResponse.BodyHandlers;

public class ListeFichierAudio {
    public static void main(String[] args) {
        // Replace 'YOUR_API_KEY' with your actual API key
        String url = "http://api.voicepartner.fr/v1/audios/YOUR_API_KEY";

        HttpClient client = HttpClient.newHttpClient();
        HttpRequest request = HttpRequest.newBuilder()
                .uri(URI.create(url))
                .build();

        client.sendAsync(request, BodyHandlers.ofString())
                .thenApply(HttpResponse::body)
                .thenAccept(System.out::println)
                .exceptionally(e -> {
                    System.out.println("Erreur lors de la requête: " + e.getMessage());
                    return null;
                })
                .join();
    }
}
```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
	"fmt"
	"io/ioutil"
	"net/http"
)

func main() {
	url := "http://api.voicepartner.fr/v1/audios/YOUR_API_KEY"

	response, err := http.Get(url)
	if err != nil {
		fmt.Printf("Error: %s\n", err.Error())
		return
	}
	defer response.Body.Close()

	body, err := ioutil.ReadAll(response.Body)
	if err != nil {
		fmt.Printf("Error: %s\n", err.Error())
		return
	}

	fmt.Printf("Response: %s\n", string(body))
}
```

{% endtab %}

{% tab title="C#" %}

```csharp
using System;
using System.Net.Http;
using System.Threading.Tasks;

namespace API.ApiClients
{
    public class ListeFichierAudio
    {
        public static async Task Main()
        {
            var url = "http://api.voicepartner.fr/v1/audios/YOUR_API_KEY";

            using (var client = new HttpClient())
            {
                try
                {
                    var response = await client.GetAsync(url);
                    var content = await response.Content.ReadAsStringAsync();
                    Console.WriteLine("Response: " + content);
                }
                catch (Exception ex)
                {
                    Console.WriteLine("Error: " + ex.Message);
                }
            }
        }
    }
}
```

{% endtab %}
{% endtabs %}

#### **Réponse**

{% tabs %}
{% tab title="json" %}

```json
{
    "nb_datas": 58,
    "datas": [
        {
            "name": "filename1",
            "token": "token1",
            "size": "104.5Ko",
            "duration": "0:07",
            "created_at": {
                "date": "2018-04-16 13:26:46.000000",
                "timezone_type": 3,
                "timezone": "Europe/Paris"
            }
        },
        {
            "name": "filename2",
            "token": "token2",
            "size": "762.7Ko",
            "duration": "0:49",
            "created_at": {
                "date": "2018-06-04 07:26:04.000000",
                "timezone_type": 3,
                "timezone": "Europe/Paris"
            }
        },...
    ]
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://www.docpartner.dev/api/voice-partner/message-vocal/liste-des-fichiers-audio.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
