Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

OpenSpecimen exposes REST APIs that can be consumed to developed custom interfaces and for integration with other databases. The REST APIs will be consumed by the OpenSpecimen user interface.

Common Characteristics of REST Resources

...

  1. Invoke sessions API with appropriate values for username, password, and domain

    HTTP MethodPOST
    URLhttp[s]://<host>:<port>/openspecimen/rest/ng/sessions
    Body


    Code Block
    {
      "loginName": "admin@admin.com",
      "password": "Login!@3",
      "domainName": "openspecimen"
    }


    Response

    HTTP 200 OK response with following body

    Code Block
    {
      "id": 1,
      "firstName": "Admin",
      "lastName": "Admin",
      "loginName": "admin@admin.com",
      "token": "NTQ1ZjZkYjktNTUyNi00YzM4LTlkNmEtYjllM2VjNDA0ZmIz",
      "admin": true,
      "instituteAdmin": false
    }



  2. Use the token field value returned by sessions API as X-OS-API-TOKEN HTTP header value in every API request made to OpenSpecimen. The token value is used by OpenSpecimen to establish - a) the user is authenticated, and b) to retrieve user details from database for authorisation and other purposes in request handling.

Unauthenticated APIs

Given below is list of APIs that do not require user authentication

...