Skip to content
Mad Price Ball edited this page Feb 1, 2018 · 5 revisions

List of API endpoints

Public API endpoints

/api/public-data/

  • GET / Public
  • Returns: Data files that have been made publicly available by users.

/api/public-data/sources-by-member/

  • GET / Public
  • Returns: Which activities each member has joined.

/api/public-data/members-by-source/

  • GET / Public
  • Returns: Which members have joined each activity.

Project API Endpoints

These endpoints are used by projects, usually with a Master access token or OAuth2 access token.

/api/direct-sharing/project/members/

  • GET / Master Access Token
  • Returns: Data for all users, including shared data files.

/api/direct-sharing/project/exchange-member/

  • GET / OAuth2 Access Token
  • Returns: Data for a specific user, including shared data files.

/api/direct-sharing/project/message/

  • POST / Master Access Token or OAuth2 Access Token
  • Purpose: Send an email to individual users, or in bulk.

/api/direct-sharing/project/files/upload/

  • POST / Master Access Token or OAuth2 Access Token
  • Purpose: Simple file upload to member account.
    • Large files may time out, in which case the "direct" and "complete" endpoints need to be used (see below).

/api/direct-sharing/project/files/upload/direct/

  • POST / Master Access Token or OAuth2 Access Token
  • Purpose: Initiate file upload to member account.
    • Step 1 in two-step process.
    • Returns a signed S3 URL which the project can upload the file to.

/api/direct-sharing/project/files/upload/complete/

  • POST / Master Access Token or OAuth2 Access Token
  • Purpose: Complete file upload to member account.
    • Step 2 in two-step process.
    • Notifies Open Humans that the file upload is complete.

OAuth2 token API

This API endpoint is used for generating and refreshing access tokens for OAuth2 projects.

/oauth2/token/

  • POST / code + Client ID + Secret
  • Purpose: Creates a user-specific token and refresh token that can be used for ongoing authorization.
    • In an OAuth2 process, users are sent to /direct-sharing/projects/oauth2/authorize/ with Client ID as a parameter. If they authorize, they are returned with a temporary code.
    • This endpoint exchanges this code for tokens, which can be used in other endpoints.
    • Can also be used to exchange refresh tokens for new tokens, enabling ongoing authorization.