> For the complete documentation index, see [llms.txt](https://docs.devolutions.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.devolutions.net/server/fr/web-interface/utilities/api-documentation.md).

# Documentation de l'API

Accédez à la documentation de l'API REST de Devolutions Server à partir d'Aide et outils, avec un exemple de script bash montrant comment se connecter, récupérer des entrées et se déconnecter.

Des instructions détaillées sur l'API REST de Devolutions Server sont disponibles dans la section ***Applis et outils connexes*** de l'interface Web de Devolutions Server, sous ***Aide et outils*** – ***Documentation de l'API***.

Pour vous connecter et utiliser l'API REST, consultez l'exemple de script bash ci-dessous. Pour chaque appel d'API au serveur, assurez-vous de ce qui suit :

* Remplacez `https://url` par l'URL spécifique de Devolutions Server.
* Remplacez `GUID-OF-VAULT` et `GUID-OF-ENTRY` par les GUID correspondants.

{% hint style="info" %}
Dans cette version de l'API, les mots de passe peuvent uniquement être récupérés à partir d'entrées de type Identifiants. Notez que les entrées de sous-type (PasswordList, par exemple) ne sont pas prises en charge.
{% endhint %}

```bash

# Log in and get the token
authResponse=$(curl -s -X POST "https://url/api/v1/login" \
    -H "Content-Type: application/json" \
    -d '{
        "appKey": "appkey",
        "appSecret": "appsecret"
    }')
token=$(echo $authResponse | jq -r '.tokenId')

# Check if the token was successfully obtained
if [ -z "$token" ] || [ "$token" = "null" ]; then
  echo "Failed to login or obtain token."
  exit 1
fi

# Request data using the token
response=$(curl -s -X GET "https://url/api/v1/vault/GUID-OF-VAULT/entry/GUID-OF-ENTRY" \
    -H "Content-Type: application/json" \
    -H "tokenId: $token")

echo $response | jq

# Log out
curl -s -X POST "https://url/api/v1/logout" \
    -H "Content-Type: application/json" \
    -H "tokenId: $token" \
    -H "Content-Length: 0"
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.devolutions.net/server/fr/web-interface/utilities/api-documentation.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
