Using the console

The console is a simple but effective graphical interface to discover and query the Mobilic API.

The console is accessible from the following link : https://mobilic.beta.gouv.fr/developers/playground

Presentation

The console consists of 4 parts:

  • the query editor, which takes up most of the left-hand side. This is where the operations are written.

  • the responses returned by the API on the right half the documentation drawer which details the actions of the API, openable from the button on the far right

  • the request header editor + operation variables on the bottom left

Authentification

La plupart des requêtes à l'API nécessitent d'être authentifié via un jeton d'accès.

Pour ajouter un jeton d'accès obtenu par authentification aux en-têtes d'une requête il suffit d'ajouter la ligne suivante dans l'éditeur correspondant (en bas à gauche), comme montré sur la capture d'écran précédente :

Most requests to the API require authentication via an access token.

To add an access token obtained through authentication to the headers of a request simply add the following line in the corresponding editor (bottom left) :

{
  "Authorization": "Bearer <access_token>"
}

Basic example

Reprenons l'exemple de l'action de login détaillé ici.

Dans l'éditeur de requêtes il n'y a pas besoin de constituer le corps JSON de la requête HTTP, il suffit simplement d'y écrire l'opération GraphQL.

Let's take the example of the login action detailed here.

In the request editor there is no need to build the JSON body of the HTTP request, it is enough to write the GraphQL operation in it.

Then simply submit the request by clicking on the middle button, having first filled in the OAuth access token in the HTTP headers :

{
  "Authorization" : "Bearer {access_token}"
}

Editing operation variables

It is possible to use operation variables using the variable editor at the bottom left.

Last updated