Authentication
APIs related to Login and Registration
Login
POST https://example.com/api/login
This endpoint allows you to authenticate a user using email and password. After successful authentication, you will receive an access token which you can use for authentication of other endpoints
Headers
Name
Type
Description
Accept
string
application/json
Request Body
Name
Type
Description
string
Email of user
password
string
Password of user
{
"accessToken": "7|vC2gUQC8ajaMOa2juAnaiE4ZLgmH5dcbCDY8Hwsy"
}{
"message": "Incorrect password"
}{
"message": "User not found"
}{
"message": "The given data was invalid.",
"errors": {
"email": [
"The email field is required."
],
"password": [
"The password field is required."
]
}
}Logout
POST https://example.com/api/logout
This endpoint will destroy the token for the current user in the server so that any future request with the same token cannot be made.
Headers
Name
Type
Description
Authorization
string
Bearer 7|vC2gUQC8ajaMOa2juAnaiE4ZLgmH5dcbCDY8Hwsy
Accept
string
application/json
Last updated
Was this helpful?