Skip to content

Latest commit

 

History

History
41 lines (34 loc) · 1.12 KB

API.md

File metadata and controls

41 lines (34 loc) · 1.12 KB

API documentation

This is not intended to cover whole API.

All responses come in JSON format.

Login endpoint

  • URL: /api/login
  • Method: POST
  • Data params: email, password
  • Response: success (boolean), role, id, token

Example:

curl -X POST -d email="[email protected]" -d password="password" https://rekisteri.asteriski.fi/api/login

You can use response data to query member details.

Member details endpoint

  • URL: /api/member/details
  • Method: GET
  • URL params: memberID (id in login response)
  • Headers: Authorization (token in login response)
  • Response: Member object

Example:

curl -X GET -H "Authorization: JWT 1234abcd" "https://rekisteri.asteriski.fi/api/member/details?memberID=123"

All members endpoint

  • URL: /api/admin/list
  • Method: GET
  • URL params: id (id in login response), access (role in login response)
  • Headers: Authorization (token in login response)
  • Response: Array of member objects
  • Other: id must be someone with Admin/Board privileges

Example:

curl -X GET -H "Authorization: JWT 1234abcd" "https://rekisteri.asteriski.fi/api/admin/list?id=1234&access=Admin"