API Endpoints

All endpoints require authorisation using the standard HTTP header:

Authorization: Bearer (supplied JWT token)

/api/userinfo

User info.

/api/organisations

List of all organisations the role is associated with using the organisation_reps assignment.

Since issue #251 the endpoint by default returns only organisations where status != 'archived'. To return also archived organisations, use the archived query parameter.

This endpoint accepts two query parameters:

/api/organisations/:organisation_id

This returns properties for a single organisation, which also contains the ftpHomeDirectory property

/api/organisations/check?id=s51PlatformObjectId

Check whether the organisation identified by the id parameter is a subordinate organisation (i.e. is below the user's organisation in the LDAP tree). e.g.

curl -i -X GET \
   -H "Authorization:Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE0ODY3NDEzMTcsImV4cCI6MTUxODI5ODkxNywiYXVkIjoiZHVtYiBjcmVhdHVyZXMiLCJpc3MiOiJvcGVuaW1wX29hdXRoMiIsInN1YiI6ImFkcmlhbkBzdGF0ZTUxLmNvbSJ9.r8PC7D63emfCblrkjyqa8PQbZwlC599rV7DyOj2bDt8" \
 'http://localhost:3000/api/organisations/check?id=27052295850016'

Return values {true} or {false}

/api/user_uid

Simple endpoint to return the UID of the token holder.

/api/instance_login

Data for the instance login used by MSP.

/api/applications_for_target/:target_id

Returns an array of Applications that the user has access to using the given target. Also displays only applications, that are accessible via OAauth2, i.e. that have redirect_uri set. Example of data returned for the state51::Target with id: 84562825560162 :

[
  {
    "id": 77756839960320,
    "name": "Financials",
    "website": "https://support.state51.com/financials",
    "description": "Download your digital sales reports.",
    "redirect_uri": "https://support.state51.com/financials",
    "modify_time": "2023-09-05T16:09:46.000Z"
  },
  {
    "id": 69505721010320,
    "name": "Catalogue",
    "website": "https://support.state51.com/catalogue",
    "description": "View and edit your release formats, sound recordings, and videos.",
    "redirect_uri": "https://support.state51.com/catalogue",
    "modify_time": "2023-09-05T16:05:10.000Z"
  },
  {
    "id": 61709243540320,
    "name": "Release Uploader",
    "website": "https://release.openimp.com",
    "description": "Upload your release formats.",
    "redirect_uri": "https://support.state51.com/release/",
    "modify_time": "2023-01-25T16:52:41.000Z"
  }
]

Created: Thu Mar 28 2024 10:32:42 GMT+0000 (Coordinated Universal Time)
Build ID: 120390