-
Notifications
You must be signed in to change notification settings - Fork 0
User methods
This endpoint is used for user registration. The user needs to provide a unique username and a password for creating an account.
The request should be a JSON object containing the following fields:
-
username(string, required): The user's desired username. -
password(string, required): The user's desired password.
Example:
{
"username": "example_user",
"password": "example_password"
}If the registration is successful, the server will return a JSON object with the following fields:
-
token(string): A token that the user can use to authenticate and access protected resources. -
message(string): A success message indicating that the registration was successful. -
isSuccess(boolean): A boolean value indicating whether the registration was successful or not.
Example:
{
"token" : "example_token",
"message": "User registered successfully",
"isSuccess": true
}This endpoint is used for user login. The user needs to provide their registered username and password to authenticate themselves and receive a token to access protected resources.
The request should be a JSON object containing the following fields:
-
username(string, required): The user's registered username. -
password(string, required): The user's registered password.
Example:
{
"username": "example_user",
"password": "example_password"
}If the login is successful, the server will return a JSON object with the following fields:
-
token(string): A token that the user can use to authenticate and access protected resources. -
message(string): A message indicating that the login was successful. -
isSuccess(boolean): A boolean value indicating whether the login was successful or not.
Example:
{
"token": "example_token",
"message": "Login successful",
"isSuccess": true
}This endpoint is used for verifying user tokens.
The request should be a JSON object containing the following fields:
- token (string, required): The user's token to be verified.
Example:
{
"token": "example_token"
}If the verification is successful, the server will return a JSON object with the following fields:
token (null): A null value indicating that the token was successfully verified.
- message (string): A success message indicating that the verification was successful.
- isSuccess (boolean): A boolean value indicating whether the verification was successful or not.
Example:
{
"token": null,
"message": "Verification is successful",
"isSuccess": true
}