8. Web Services

Les web services d’openARIA sont RESTful. Les retours sont au format JSON, encodés en UTF-8.

8.1. Ressource « maintenance »

8.1.1. Synchronisation des utilisateurs via un annuaire

POST /openaria/services/rest_entry.php/maintenance

Exemple de requête :

POST /openaria/services/rest_entry.php/maintenance HTTP/1.1
Host: localhost

{
  "module": "user"
}

Exemple de réponse :

HTTP/1.1 500 Internal Server Error
Content-Type: text/javascript

{
  "http_code": 500,
  "http_code_message": "500 Internal Server Error",
  "message": "Erreur interne"
}
Status Codes:

8.1.2. Synchronisation des voies

POST /openaria/services/rest_entry.php/maintenance

Exemple de requête :

POST /openaria/services/rest_entry.php/maintenance HTTP/1.1
Host: localhost

{
  "module": "voies",
  "data" : {
      "file_name" : "/tmp/synchronsization_voies.csv"
  }
}

8.1.3. Numérisation automatique

POST /openaria/services/rest_entry.php/maintenance

Exemple de requête :

POST /openaria/services/rest_entry.php/maintenance HTTP/1.1
Host: localhost

{
  "module": "import",
  "data": {
    "service": "ACC"
    // Ces deux paramètres sont facultatifs
    "Todo" : "chemin_dossier_source", // ou "" pour utiliser le chemin dans la configuration
    "Done" : "chemin_dossier_destination" // ou "" pour utiliser le chemin dans la configuration
  }
}

8.1.4. Synchronisation des contraintes

POST /openaria/services/rest_entry.php/maintenance

Exemple de requête :

POST /openaria/services/rest_entry.php/maintenance HTTP/1.1
Host: localhost

{
  "module": "contraintes"
}

8.1.5. Gestion des messages asynchrones

POST /openaria/services/rest_entry.php/maintenance

Exemple de requête :

POST /openaria/services/rest_entry.php/maintenance HTTP/1.1
Host: localhost

{
  "module": "messagesasync"
}

8.1.6. Gestion des consultations

POST /openaria/services/rest_entry.php/maintenance

Exemple de requête :

POST /openaria/services/rest_entry.php/maintenance HTTP/1.1
Host: localhost

{
  "module": "ar_consultation"
}

8.2. Ressource « messages »

Cette ressource permet d’interfacer un message.

POST /openaria/services/rest_entry.php/messages

Cas d’utilisation :

Exemple de requête :

POST /openaria/services/rest_entry.php/messages HTTP/1.1
Host: localhost

  {
      "type": "Mise à jour de complétude ERP ACC",
      "date": "16/06/2014 14:12",
      "emetteur": "John Doe",
      "dossier_instruction": "PD12R0001",
      "contenu": {
          "Complétude ERP ACC": "non",
          "Motivation Complétude ERP ACC": "Lorem ipsum dolor sit amet..."
      }
  }