-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RFC] Modify "Archive users not In discord" API endpoint name #149
Comments
@RitikJaiswal75 @apurvkhare @prakashchoudhary07 @sahsisunny @DashDeipayan @heyrandhir Please share your thoughts on this. |
APIs Should represent the resource they are accessing I think it should just be I would prefer the API name to be {
action: "archive"
on: "in_discord"
} |
There exists another API on the same endpoint @prakashchoudhary07 @heyrandhir @apurvkhare What's you thoughts on this? |
Also, I don't understand why we used POST here. POST is supposed to be used when we are creating new resources. But, here we are just updating the existing |
I think we would need to update the previous api then. Based on request body it should perform the unverified action. while as @RitikJaiswal75 suggested based on specific key such as
you can perform your action and similarly assign some other key for unverified action. |
Based on this Discussion:
|
Summary
The API that deals with updating the Archived role to true if the user is not in our discord was put under the PATCH /users endpoint with a request body differentiating it from the previous API that exists for the same route.
But, this API is not following the best API naming convention as it is not representing the resources it is modifying correctly.
This RFC aims at finding the API name that follows a better API naming convention.
Description
We have created a new API that will mark all the users Archived that are not in our discord i.e. set the
archived=true
for users that havein_discord=false
.Initially, the API name was
PATCH /users/update-archived
. As this is not correct because the verb is defined by the actionPATCH
so addingupdate
in the endpoint is not correct.Then, possible route names are proposed.
As in these routes
archived
is not representing a resource another solution proposed was,Put the API under PATCH /users by defining the proper body. This is the current implementation.
Here is the API contact: https://github.com/Real-Dev-Squad/website-api-contracts/tree/main/users#patch-users
The text was updated successfully, but these errors were encountered: