Login
This API is for login to user account
GRAPHQL
Headers
| Fields | Type | Description | Example | Data Management |
|---|---|---|---|---|
| URL | string | {base_url}/users | ||
| GRAPHQL | string | QUERY | ||
| content-type | string | JSON | application/json |
Request
{
login_with_otp(email: "johndoe@gmail.com", otp: "12345") {
token
}
}
Request Parameters
| Fields | Type | Description | Required |
|---|---|---|---|
| string | email of the user | ✔ | |
| otp | string | OTP received on the registered email | ✔ |
Success
{
"data": {
"login_with_otp": {
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiYWRtaW4iLCJhY2NvdW50VHlwZSI6ImFkbWluIiwiaWF0IjoxNjUyMzI4MjAyLCJleHAiOjE2NTIzNDk4MDJ9.qPBFexWB-bYK3P5o9SvoJIiUABnJJ80baKqfw8Uj6Hw"
}
}
}
Error
{
"errors": [
{
"message": "Email not registered",
"locations": [
{
"line": 2,
"column": 3
}
],
"path": ["login_with_otp"]
}
],
"data": {
"login_with_otp": null
}
}
{
"errors": [
{
"message": "Incorrect OTP",
"locations": [
{
"line": 2,
"column": 3
}
],
"path": ["login_with_otp"]
}
],
"data": {
"login_with_otp": null
}
}