# Récupérer son token

Pour que l'API fonctionne il vous faut votre token qui permettra d'identifier et de sécuriser toutes les requêtes.

Pour l'obtenir merci de nous contacter : <dev@campus-skills.com>, ce token est strictement confidentiel et vous permettra de récupérer les données de la plateforme Campus Skills via une authentification par Bearer Token, c'est à dire que toutes vos requêtes doivent contenir le header :

```javascript
{
    Authorization: Bearer $token
}
```

Sans ça vous aurez un retour du type

{% hint style="danger" %}
{ "error": "invalid token", "reason": "Your token is invalid please contact the administrator" }
{% endhint %}

### Tester son token

<mark style="color:blue;">`GET`</mark> `{{URL}}/api/sync/v1/test`

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

```json
{
    "value": "token valid",
    "name": "Nom de votre CFA sur la plateforme"
}
```

{% 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://docs.campus-skills.com/recuperer-son-token.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.
