Week 5
Goals for the week
Sl. No. | Initial Goals | Completed |
---|---|---|
1. | Finish the implementation of REST API for modifying user Details | Done |
2. | Solve requested changes on existing PRs | Done |
3. | Finish the implementation of REST API for token related queries | Done |
REST APIs Implemented -
editUserDetails
:
- The API implementation of the
/users/{id}
PUT route to modify user Details is done. - This task included
- Creating a new PUT route in the
index.php
file insidewww/ui/api
directory. - Adding a new method
editUser
in theUserController
class. - Trying to re-use the methods that are already used in the static UI.
- Testing the API via any API platform like postman.
- Creating a new PUT route in the
PR Link : feat(api): Added users/{id} PUT route to modify user details #2262
Testing the PR
-
Pull the changes from the above PR.
-
Use any API platform like postman.
-
Provide the request body as following ----
-
You can expect a response like this
createRestApiToken
and getTokens
- The API implementation of the
/users/tokens
POST route for creating a REST API Token and/users/tokens/{type}
GET route for getting all the REST API Tokens based on typeactive | expired
is done. - This task included
- Creating a new POST route in the
index.php
file insidewww/ui/api
directory for creating a REST API Token. - Creating a new GET route in the
index.php
file insidewww/ui/api
directory for getting all the REST API Tokens based on typeactive | expired
. - Adding new methods
createRestApiToken
andgetTokens
in theUserController
class. - Trying to re-use the methods that are already used in the static UI from the
user_edit
plugin. - Testing the API via any API platform like postman.
- Creating a new POST route in the
PR Link : feat(api): added /users/tokens POST Route and /users/tokens/{type} GET Route #2266
Testing the PR
-
Pull the changes from the above PR.
-
Use any API platform like postman.
-
Testing
/api/v1/users/tokens
-
Provide the request body as following ----
-
You can expect a response like this
-
-
Testing
/api/v1/users/tokens/{type}
-
type =
active
-
type =
expired
-
Conclusions and further plans
- These PRs are currently in review and if any changes are requested, I'll be solving them in the coming week.
- Other than this, I'll pick up any other API implementation based on priority as suggested by the mentors.