Skip to content

API Reference

Paul Yakovlev edited this page Feb 13, 2021 · 7 revisions

https://us-central1-lml-stranding-map.cloudfunctions.net/api

The backend API is an Express server that is deployed with Firebase Functions. Although it appears on the Firebase console, its endpoints are not listed as Functions.

/firebaseupload

Writes stranding records provided in request body to firebase database.

URL: https://us-central1-lml-stranding-map.cloudfunctions.net/api/firebaseupload

Method: POST

Parameters:

  • userToken String: Authentication token generated by Firebase Auth to ensure only logged in users are able to use this endpoint.

  • record Geojson object: Stranding report that will be updated/written to the database.

Clients (who uses this endpoint):

/algoliasearch

Takes filter parameters in the request body and performs a search on the algolia index with those parameters, returns search results.

URL: https://us-central1-lml-stranding-map.cloudfunctions.net/api/algoliasearch

Method: POST

Parameters: A javascript object containing the following attributes:

  • facetFilters Array of strings: Which facets to search by.

  • hitsPerPage Integer: How many results to return. Set to 1000.

  • attributesToRetrieve Array of strings: Which attributes to include in results. Set to [“*”] (include all).

Clients (who uses this endpoint):

/hello

Returns ‘Hello from Firebase!’. Used for testing.

URL: https://us-central1-lml-stranding-map.cloudfunctions.net/api/hello

Method: GET

Clone this wiki locally