Restful API

This API manipulates information about the veterinary medicaments for France area. Most of the code, classes are shared on GitHub website. Please view the source code on these pages Spring API and Jakarta EE API.

Obtain information about a particular Medicament

To get the information about a medicament, we can request a HTTP GET given an id.

HTTP GET: /api/medicament/{id}

The response is JSON format as the example below:

Delete a specific Medicament

To delete a Medicament from the database, we can send HTTP DELETE request given an id.

HTTP DELETE: /api/medicament/{id}

The response is empty and the header status is Ok (200).

Update the data of a specific Medicament

To update the information about a medicament, we can send HTTP PUT request including multi-part content.

HTTP PUT: /api/medicament/update

The response send back the up-to-date information of the Medicament.

Obtain the image associated to a specific Medicament

To trigger the download, we can send HTTP GET request with the id of the Medicament.

HTTP GET: /api/medicament/{id}/image

The header of the response contains the image extension.

Obtain a specific image of the Rcp object

To trigger the download, we can send HTTP GET request with the id of the Medicament and the image number of the Rcp object.

HTTP GET: /api/medicament/{id}/rcp/image/{number}

The header of the response contains the image extension.

Obtain the name and the id of all Medicaments

To get the data, we can send HTTP GET request.

HTTP GET: /api/medicaments/nom-id

The response is JSON data format. The example below shows a snippet:

Find the list of names of the Medicaments

To get the list of names, we can request HTTP POST request.

HTTP POST: /api/medicaments/search

The request must contain JSON body including the values of the search parameters. Find more information about the parameters in MedicamentSearch Java class

An example of JSON body:

The JSON data format response:

Obtain the inputs used on search form

To get the inputs, we can send HTTP GET request.

HTTP GET: /api/search-form

Below is a snippet of JSON response:

Obtain all the inputs to complete or modify the data of a Medicament

To get the inputs, we can send HTTP GET request.

HTTP GET: /api/update-form

The response below shows a partial response:

Edited date: November 19th 2021