Image
All the information is given in JSON format and the server has to receive all the data in JSON fromat too.
Flowerpot structure with example:
User structure with example adding flowerpots to it:Save a user in the database.
http://url/api/users
This method is used to register a new user in to the database, it has to receive a JSON with the following information:
Get all the users saved in the database.
http://url/api/users
This method is used to get all the users of the database, it doesn´t have to receive anything from the body and it returns a list with all the users found.
Example
Modify a user by its ID.
http://url/api/users/id
This method is used to modify a user by its ID, it recives in the URL the user ID and if the ID exists it returns a JSON with the new user modified, if the ID doesn´t exist it doesn´t return anything only a BAD REQUEST. It needs a JSON with the new user in the body.
Delete a user from the database by its ID.
http://url/api/users/id
This method is used to delete a user by its ID, it recives in the URL the user ID and returns a String saying "Deleted" if the user has been deleted or "NOT Deleted" in the opposite case.It doesn´t need any JSON in the body.
http://url/api/flowerpots
This method creates a new flowerpot in the database, it needs to receive a JSON with the information of the flowerpot, it´s obligatory to send the MAC address in the JSON.
Example
http://url/api/flowerpots
This methods retruns the a JSON with all the flowerpots saved in the database.
Example
http://url/api/flowerpots/macAddress
This method modifies the fields of a given flowerpot, it has to receive a JSON with de data.
Example
http://url/api/flowerpots/macAddress
This method is used to delete a flowerpot by its MAC address.
http://url/api/login
This method is used to login in the API, it needs a user and a password to get in.
Example
Example


