Skip to content
This repository has been archived by the owner on Dec 9, 2019. It is now read-only.

Latest commit

 

History

History
39 lines (29 loc) · 1.98 KB

README.md

File metadata and controls

39 lines (29 loc) · 1.98 KB

RailroadPM.org Participant Kit - REST APIs

Using the REST APIs requires knowledge of web software development.

The RailroadPM system uses GitHub as its data store, and Netlify and their open source content management system Netlify CMS as a user-friendly administrative UI and user management system.

Here's the basic outline of the code you would need to write to call the REST APIs exposed by Netlify and GitHub for RailroadPM.

  1. POST your participant credentials to the authentication endpoint to retrieve a token:

    Request URL: https://admin.rrpm.run/.netlify/identity/token
    Request Method: POST
    Form Data:
      grant_type: password
      username: YourParticipantEmail
      password: YourParticipantPassword
    
  2. Note the access_token in the response upon successful login

    {
      "access_token": "eyJh...",
      "token_type": "bearer",
      "expires_in": 3600,
      "refresh_token": "EcC9..."
    }
  3. Now, use the Bearer token in an authorization header to call the GitHub APIs to upload your data. The GitHub API endpoints are proxied and gatewayed through a Netlify service so that participants are not required to have a GitHub account. The relevant endpoints are:

  4. For more details on how to formulate the GitHub API calls you can refer to the Netlify CMS source code here and here.