The Base Host URL is http://BASE_URL/api add thes url before the follwinf urls in the API.
Method: POST
Url: /oauth/login
Param: email
, password
Success:
{
"message": "success",
"data": {
"token": "the user token"
}
}
Erorr:
validation Errors
or unauthorised
{
"message": "error",
"data": "unauthorised"
}
Method: POST
Url: /oauth/register
Param: name, email, password, confirm_password
Success:
{
"message": "success",
"data": {
"token": "the user token",
"user": "the user data"
}
}
Erorr:
validation Errors
or unexpected error
{
"message": "error",
"data": "unexpected error"
}
This route can't access it without be authenticated.
Method: POST
Url: /oauth/register
Param: name, email, password, confirm_password
Success:
{
"message": "success",
"data": "Logged out successfully"
}
Erorr:
{
"message": "Unauthenticated",
}
This route can't access it without be authenticated.
Method: GET
Url: /oauth/user
Param: Send the access token with the header as Autherization
ex: Authorization Brearer token
Success:
{
"message": "success",
"data": {
"id": 1,
"name": "My Name",
"email": "[email protected]",
"email_verified_at": "2019-07-20 11:44:15",
"created_at": "2019-07-20 17:03:37",
"updated_at": "2019-07-20 23:44:15"
}
}
Erorr:
{
"message": "Unauthenticated",
}