User Login
URL
POST https://api.magicrail.io/users/login
Description
This endpoint authenticates user credentials and generates an access token.
Headers
Ensure these headers are included in the request.
- Content-Type:
application/json
Request Body
Provide the email address and password for the user.
- email:
string
- password:
string
Success Response
Description of a successful login and the reception of an access token.
- 🟢 200 OK: Successfully logged in and received access token.
Error Responses
Descriptions of common error responses.
- 🔴 400 Bad Request: Bad request, invalid email or password.
- 🔴 403 Forbidden: Forbidden, email not verified.
Example Call and response
An example showing how to make a request and an example response.
Example Call:
curl -X POST \
-H "Content-Type: application/json" \
-d '{
"email": "[email protected]",
"password": "yourPassword"
}' \
https://api.magicrail.io/users/login
Example Response:
{
"token": {
"accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiIxMjM0NTY3ODkwIiwiaWF"
},
"user": {
"id": "1234567890"
}
}