Skip to content

Commit 22ecaff

Browse files
authored
Use id instead of username (#243)
1 parent c96db92 commit 22ecaff

29 files changed

Lines changed: 535 additions & 271 deletions

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ If you change or add translations, you need to update the `messages` XLIFF file
579579
580580
You can use:
581581
582-
./bin/phpunit
582+
./vendor/bin/phpunit
583583
584584
## ✨ Code linting
585585

docs/api/README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,17 @@ When `API_KEY` is not set, the API endpoints are disabled and will return a 500
1919
Each endpoint displays information related to the User:
2020

2121
* [Get Users](v1/users/all.md) : `GET /api/v1/users`
22-
* [Get User Details](v1/users/details.md) : `GET /api/v1/users/:username`
22+
* [Get User Details](v1/users/details.md) : `GET /api/v1/users/:user_id`
2323

2424
#### Calendars related
2525

2626
Endpoints for viewing and modifying user calendars.
2727

28-
* [Show All User Calendars](v1/calendars/all.md) : `GET /api/v1/calendars/:username`
29-
* [Show User Calendar Details](v1/calendars/details.md) : `GET /api/v1/calendars/:username/:calendar_id`
30-
* [Create User Calendar](v1/calendars/create.md) : `POST /api/v1/calendars/:username/create`
31-
* [Edit User Calendar](v1/calendars/edit.md) : `POST /api/v1/calendars/:username/:calendar_id/edit`
32-
* [Delete User Calendar](v1/calendars/delete.md) : `POST /api/v1/calendars/:username/:calendar_id/delete`
33-
* [Show User Calendar Shares](v1/calendars/shares.md) : `GET /api/v1/calendars/:username/shares/:calendar_id`
34-
* [Share User Calendar](v1/calendars/share_add.md) : `POST /api/v1/calendars/:username/share/:calendar_id/add`
35-
* [Remove Share User Calendar](v1/calendars/share_remove.md) : `POST /api/v1/calendars/:username/share/:calendar_id/remove`
28+
* [Show All User Calendars](v1/calendars/all.md) : `GET /api/v1/calendars/:user_id`
29+
* [Show User Calendar Details](v1/calendars/details.md) : `GET /api/v1/calendars/:user_id/:calendar_id`
30+
* [Create User Calendar](v1/calendars/create.md) : `POST /api/v1/calendars/:user_id/create`
31+
* [Edit User Calendar](v1/calendars/edit.md) : `PUT /api/v1/calendars/:user_id/:calendar_id`
32+
* [Delete User Calendar](v1/calendars/delete.md) : `DELETE /api/v1/calendars/:user_id/:calendar_id`
33+
* [Show User Calendar Shares](v1/calendars/shares.md) : `GET /api/v1/calendars/:user_id/shares/:calendar_id`
34+
* [Share User Calendar](v1/calendars/share_add.md) : `POST /api/v1/calendars/:user_id/share/:calendar_id/add`
35+
* [Remove Share User Calendar](v1/calendars/share_remove.md) : `POST /api/v1/calendars/:user_id/share/:calendar_id/remove`

docs/api/v1/calendars/all.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Gets a list of all available calendars for a specific user.
44

5-
**URL** : `/api/v1/calendars/:username`
5+
**URL** : `/api/v1/calendars/:user_id`
66

77
**Method** : `GET`
88

@@ -11,7 +11,7 @@ Gets a list of all available calendars for a specific user.
1111
**Params constraints**
1212

1313
```
14-
:username -> "[username in plain text]",
14+
:user_id -> "[user id as an int]",
1515
```
1616

1717
**URL example**

docs/api/v1/calendars/create.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Creates a new calendar for a specific user.
44

5-
**URL** : `/api/v1/calendars/:username/create`
5+
**URL** : `/api/v1/calendars/:user_id/create`
66

77
**Method** : `POST`
88

@@ -11,7 +11,7 @@ Creates a new calendar for a specific user.
1111
**Params constraints**
1212

1313
```
14-
:username -> "[username in plain text]",
14+
:user_id -> "[user id as an int]",
1515
```
1616

1717
**Request Body constraints**

docs/api/v1/calendars/delete.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,23 @@
22

33
Deletes a specific calendar for a specific user.
44

5-
**URL** : `/api/v1/calendars/:username/:calendar_id/delete`
5+
**URL** : `/api/v1/calendars/:user_id/:calendar_id`
66

7-
**Method** : `POST`
7+
**Method** : `DELETE`
88

99
**Auth required** : YES
1010

1111
**Params constraints**
1212

1313
```
14-
:username -> "[username in plain text]",
14+
:user_id -> "[user id as an int]",
1515
:calendar_id -> "[numeric id of a calendar owned by the user]",
1616
```
1717

1818
**URL example**
1919

2020
```
21-
/api/v1/calendars/jdoe/1/delete
21+
/api/v1/calendars/jdoe/1
2222
```
2323

2424
## Success Response

docs/api/v1/calendars/details.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Gets a list of all available calendars for a specific user.
44

5-
**URL** : `/api/v1/calendars/:username/:calendar_id`
5+
**URL** : `/api/v1/calendars/:user_id/:calendar_id`
66

77
**Method** : `GET`
88

@@ -11,7 +11,7 @@ Gets a list of all available calendars for a specific user.
1111
**Params constraints**
1212

1313
```
14-
:username -> "[username in plain text]",
14+
:user_id -> "[user id as an int]",
1515
:calendar_id -> "[numeric id of a calendar owned by the user]",
1616
```
1717

docs/api/v1/calendars/edit.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22

33
Edits an existing calendar for a specific user.
44

5-
**URL** : `/api/v1/calendars/:username/:calendar_id/edit`
5+
**URL** : `/api/v1/calendars/:user_id/:calendar_id`
66

7-
**Method** : `POST`
7+
**Method** : `PUT` or `PATCH`
88

99
**Auth required** : YES
1010

1111
**Params constraints**
1212

1313
```
14-
:username -> "[username in plain text]",
14+
:user_id -> "[user id as an int]",
1515
:calendar_id -> "[numeric id of a calendar owned by the user]",
1616
```
1717

@@ -30,7 +30,7 @@ Edits an existing calendar for a specific user.
3030
**URL example**
3131

3232
```
33-
/api/v1/calendars/jdoe/1/edit
33+
/api/v1/calendars/jdoe/1
3434
```
3535

3636
**Body example**

docs/api/v1/calendars/share_add.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Shares (or updates write access) a calendar owned by the specified user to another user.
44

5-
**URL** : `/api/v1/calendars/:username/share/:calendar_id/add`
5+
**URL** : `/api/v1/calendars/:user_id/share/:calendar_id/add`
66

77
**Method** : `POST`
88

@@ -11,7 +11,7 @@ Shares (or updates write access) a calendar owned by the specified user to anoth
1111
**Params constraints**
1212

1313
```
14-
:username -> "[username in plain text]",
14+
:user_id -> "[user id as an int]",
1515
:calendar_id -> "[numeric id of a calendar owned by the user]",
1616
```
1717

docs/api/v1/calendars/share_remove.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Removes access to a specific shared calendar for a specific user.
44

5-
**URL** : `/api/v1/calendars/:username/share/:calendar_id/remove`
5+
**URL** : `/api/v1/calendars/:user_id/share/:calendar_id/remove`
66

77
**Method** : `POST`
88

@@ -11,7 +11,7 @@ Removes access to a specific shared calendar for a specific user.
1111
**Params constraints**
1212

1313
```
14-
:username -> "[username in plain text]",
14+
:user_id -> "[user id as an int]",
1515
:calendar_id -> "[numeric id of a calendar owned by the user]",
1616
```
1717

docs/api/v1/calendars/shares.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Gets a list of all users with whom a specific user calendar is shared.
44

5-
**URL** : `/api/v1/calendars/:username/shares/:calendar_id`
5+
**URL** : `/api/v1/calendars/:user_id/shares/:calendar_id`
66

77
**Method** : `GET`
88

@@ -11,7 +11,7 @@ Gets a list of all users with whom a specific user calendar is shared.
1111
**Params constraints**
1212

1313
```
14-
:username -> "[username in plain text]",
14+
:user_id -> "[user id as an int]",
1515
:calendar_id -> "[numeric id of a calendar owned by the user]",
1616
```
1717

@@ -35,13 +35,15 @@ Gets a list of all users with whom a specific user calendar is shared.
3535
"data": [
3636
{
3737
"username": "adoe",
38+
"user_id": 5,
3839
"principal_id": 9,
3940
"displayname": "Aiden Doe",
4041
"email": "adoe@example.org",
4142
"write_access": false
4243
},
4344
{
4445
"username": "jdoe",
46+
"user_id": 4,
4547
"principal_id": 3,
4648
"displayname": "John Doe",
4749
"email": "jdoe@example.org",
@@ -101,4 +103,4 @@ or
101103
"message": "Invalid Calendar ID/Username",
102104
"timestamp": "2026-01-23T15:01:33+01:00"
103105
}
104-
```
106+
```

0 commit comments

Comments
 (0)