Hello, i want to connect my users seamlessly to my server by using the login endpoint but I don’t understand what data I should pass in parameters. Could anyone help me by showing an example of what a basic payload should look like?
Hi Mattéo,
please find some curl examples below (one with a valid password, the other one with an invalid one to also see the different responses):
# curl -sX POST -d '{ "login_id": "username", "password": "invalid" }' https://mm.yourdomain.tld/api/v4/users/login | jq .
{
"id": "api.user.login.invalid_credentials_email_username",
"message": "Enter a valid email or username and/or password.",
"detailed_error": "",
"request_id": "sfthnmf84jdnid8rcstfkwj8oy",
"status_code": 401
}
# curl -sX POST -d '{ "login_id": "username", "password": "valid" }' https://mm.yourdomain.tld/api/v4/users/login | jq .
{
"id": "<userid>",
"create_at": 1658807802080,
"update_at": 1684162956787,
"delete_at": 0,
"username": "username",
"auth_data": "",
"auth_service": "",
"email": "your@mail.tld",
[...]
```