Page cover image

🔏Auth to API

To make API requests you need to obtain Bearer Token

Make POST request to obtain Bearer Token

POST https://api.mel.store/api/mel-store/auth/login
curl --location 'https://api.mel.store/api/mel-store/auth/login' \
--header 'Content-Type: application/json' \
--data-raw '{
    "email": "<your_email>",
    "password": "<your_pasword>"
}'

If user and password is valid you would get response with access_token which needed for access to API

Example Response:

{
    "access_token": "1|XhRVCj1qssKzDEjfUumtlPwOljh7O6kOy9Z2n5ss",
    "refresh_token": "1|XhRVCj1qssKzDEjfUumtlPwOljh7O6kOy9Z2n5ss",
    "token_type": "Bearer",
    "expires_in": 5184000
}

If your token is invalid or expired you will get 401 Unauthorized status code, you can try/catch in your integrations such error and obtain other bearer or fetch sometimes a new bearer token

Last updated