Skip to content

Commit

Permalink
Add more API docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Veikkosuhonen committed Apr 29, 2024
1 parent a94f8ac commit b094303
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 3 deletions.
81 changes: 78 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ Jami API should now be available at http://localhost:3000/. Configure the port f

## API

e.g. `POST /`
`POST /`

- Body

```json
{
Expand All @@ -29,7 +31,7 @@ e.g. `POST /`
}
```

Response
- Response

```json
{
Expand All @@ -49,8 +51,81 @@ Response
}
```

`GET /:userId`

- Response

```json
{
"id": "hy-hlo-12345678",
"iamGroups": ["hy-employees", "grp-toska"],
}
```

`GET /access-to-all`

- Response

```json
{
"500-M009": {
"read": true,
"write": true,
"admin": true
},
"T920101": {
"read": true,
"write": true,
"admin": true
},
// ...
"specialGroup": {
"allProgrammes": true
}
}
```

`GET /organisation-data`

- Response: the FACULTIES object from [./src/organisation/faculties.ts](./src/organisation/faculties.ts)

`GET /all-access`

- Response: all user's iam groups and their computed access rights:

```json
[
{
"id": "hy-hlo-12345678",
"iamGroups": ["hy-employees", "grp-toska"],
"500-M009": {
"read": true,
"write": true,
"admin": true
},
"T920101": {
"read": true,
"write": false,
"admin": false
},
"specialGroup": {
"superAdmin": true
}
},
// ...
]
```

`GET /iam-groups`

- Response: all unique iam groups in Jami DB:

```json
["grp-toska", "hy-employees"]
```

### Other routes

`GET` `/ping`, `/access-to-all`, `/organisation-data`, `/all-access`, `/iam-groups`, `/:userId`
`GET` `/ping`

`POST` `user-organisations`
Empty file removed src/organisation/index.ts
Empty file.

0 comments on commit b094303

Please sign in to comment.