This is an API back-end used by The Liberation Pledge website. Presently is has just one endpoint: /pledgers
, which is used to return information about the most recent pledgers.
The Liberation Pledge website is hosted on SquareSpace.
Example request:
GET http://liberationpledge-api.dxetech.org/pledgers?limit=10
See the Facebook Data example_request.html for an example of how to make a request to this endpoint from JavaScript without jQuery.
See server.py for the full functionality.
WIP
This app is deployed with Dokku. Learn about how DxE Tech deploys with Dokku. The Dokku git remote is:
dokku@dxetech.org:liberationpledge-api
You will need the following environment variables, both locally and in production:
GOOGLE_API_CLIENT_EMAIL
GOOGLE_API_PRIVATE_KEY
LIBERATION_PLEDGE_SHEET_ID
This comes from here.
- Visit https://console.developers.google.com/project
- Create a project.
- On the left bar navigate to 'APIs & auth' > 'APIs' > 'Drive API'
- Click 'Enable API'
- On the left bar navigate to 'APIs & auth' > 'APIs' > 'Credentials'
- Click 'Add Credentials', select 'Service Account', json filetype, and 'Create' You'll then download a json file containing the credentials.
In order for the to actually access the specific spreadsheet, you have to give permissions in the same way you would give a user access to a spreadsheet. Go to the spreadsheet, on the top right click 'Share', and enter the email address found under client_email
in the api credentials
file you just downloaded.
A python libaray wrapping the Google Sheets API for interfacing with spreadsheets is gspread.
The documentation is here on readthedocs. One important detail about the API is that all cells are returned as strings despite the underlying spreadsheet cell format.
liberationpledge-api is licensed under GNU GPL version 3.0. For the full license see the LICENSE file.