Skip to content

Backend communication

Augusto Crespo edited this page Jul 12, 2021 · 2 revisions

URL of the backend: https://oss-foundations-api.herokuapp.com

In order to create a good synchronization between frontend and backend, the requests that can be send are:

Requests that do not require authentication

Get foundations:

It retrieves the foundations in the database (only final foundations, not pending approval)

GET (URL)/foundations

Request to modify a foundation:

PUT (URL)/foundations//edit/${idFoundation}, foundation

Params: foundation: the data of the foundation to edit

Propose a new foundation

POST (URL)/foundations/pending, foundation

Params: foundation: the data of the foundation to edit

Requests that do require authentication an admin role

For this kind of requests it is needed to send a header with the bearer authentication token.

Get all the foundations:

It retrieves all the foundations in the database

GET (URL)/foundations/all

Edit an existing foundation:

PUT (URL)/foundations/${idFoundation}, foundation

Params: foundation: the data of the foundation to edit

Add a new foundation

POST (URL)/foundations/, foundation

Params: foundation: the data of the foundation to edit

Delete an existing foundation

DELETE(URL)/foundations/, idFoundation

Params: foundation: the data of the foundation to edit


For more information, you can check the file "api.js" in the Data folder.