QR Login using AJAX Polling
Create QRcode image
Endpoint:
Method: POST
Type:
URL: http://127.0.0.1:8000/api/login/create/qrcode
More example Requests/Responses:
Headers:
Key | Value | Description |
---|---|---|
Accept | application/json |
{
"status": 1,
"msg": "http://127.0.0.1:8000/assets/img/qrcodeimg/LAMi2MpANGoMxZeDYzHNzXnyaNltVg.png",
"key": "LAMi2MpANGoMxZeDYzHNzXnyaNltVg"
}
Status Code: 200
Poll this API to check QR has been scanned or not.
Endpoint:
Method: POST
Type: FORMDATA
URL: http://127.0.0.1:8000/api/login/scan/qrcode
Headers:
Key | Value | Description |
---|---|---|
Accept | application/json |
Body:
Key | Value | Description |
---|---|---|
key | LAMi2MpANGoMxZeDYzHNzXnyaNltVg | key from Create Qrcode api |
More example Requests/Responses:
Headers:
Key | Value | Description |
---|---|---|
Accept | application/json |
Body:
Key | Value | Description |
---|---|---|
key | LAMi2MpANGoMxZeDYzHNzXnyaNltVg | key from Create Qrcode api |
{
"status": 0,
"msg": ""
}
Status Code: 200
Headers:
Key | Value | Description |
---|---|---|
Accept | application/json |
Body:
Key | Value | Description |
---|---|---|
key | LAMi2MpANGoMxZeDYzHNzXnyaNltVg | key from Create Qrcode api |
{
"status": 1,
"msg": "success"
}
Status Code: 200
Use QRScanner app to scan the QR code and attach the user passcode in headers and hit this url
Endpoint:
Method: POST
Type:
URL: http://127.0.0.1:8000/api/login/mobile/scan/qrcode
Headers:
Key | Value | Description |
---|---|---|
userpasscode | b8rv4pvqBg | user's passcode attached from authenticated qrscanner app |
Query params:
Key | Value | Description |
---|---|---|
key | LAMi2MpANGoMxZeDYzHNzXnyaNltVg | key from create qrcode app |
type | 1 | required |
More example Requests/Responses:
Headers:
Key | Value | Description |
---|---|---|
userpasscode | b8rv4pvqBg | user's passcode attached from authenticated qrscanner app |
Query:
Key | Value | Description |
---|---|---|
key | dfhcSlugAQ9dyu7ZtAYAHGcWGzltBB | key from create qrcode app |
type | 1 | required |
{
"status": 2,
"msg": "expired"
}
Status Code: 200
Headers:
Key | Value | Description |
---|---|---|
userpasscode | b8rv4pvqBg | user's passcode attached from authenticated qrscanner app |
Query:
Key | Value | Description |
---|---|---|
key | LAMi2MpANGoMxZeDYzHNzXnyaNltVg | key from create qrcode app |
type | 1 | required |
{
"status": 1,
"msg": "http://127.0.0.1:8000/api/login/qrcodedoLogin?key=LAMi2MpANGoMxZeDYzHNzXnyaNltVg&type=scan&login=b8rv4pvqBg&sign=ALwnx7oK47jb"
}
Status Code: 200
Endpoint:
Method: POST
Type:
URL: http://127.0.0.1:8000/api/login/qrcodedoLogin
Query params:
Key | Value | Description |
---|---|---|
key | LAMi2MpANGoMxZeDYzHNzXnyaNltVg | QR code key |
type | scan | scanned successfully |
login | b8rv4pvqBg | user's passcode |
sign | ALwnx7oK47jb | unique identification: system generated |
More example Requests/Responses:
Query:
Key | Value | Description |
---|---|---|
key | LAMi2MpANGoMxZeDYzHNzXnyaNltVg | QR code key |
type | scan | scanned successfully |
login | b8rv4pvqBg | user's passcode |
sign | ALwnx7oK47jb | unique identification: system generated |
{
"status": 1,
"msg": "Login successful"
}
Status Code: 200
Poll this API to check QR has been logged in or not.
Endpoint:
Method: POST
Type: FORMDATA
URL: http://127.0.0.1:8000/api/login/entry/login
Body:
Key | Value | Description |
---|---|---|
key | dfhcSlugAQ9dyu7ZtAYAHGcWGzltBB | QR code key |
deviceid | rewsjjj | device id |
More example Requests/Responses:
Headers:
Key | Value | Description |
---|---|---|
Accept | application/json |
Body:
Key | Value | Description |
---|---|---|
key | LAMi2MpANGoMxZeDYzHNzXnyaNltVg | QR code key |
deviceid | 12434sf3 | device id |
{
"success": true,
"message": "logged in successfully ",
"response_code": 200,
"connected_device": "7 device connected ",
"access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC8xMjcuMC4wLjE6ODAwMFwvYXBpXC9sb2dpblwvZW50cnlcL2xvZ2luIiwiaWF0IjoxNjMzOTQ1ODE0LCJleHAiOjE2MzY1NzM4MTQsIm5iZiI6MTYzMzk0NTgxNCwianRpIjoiN1FRekR4M0dxWjlpTXVaRiIsInN1YiI6MzQsInBydiI6Ijg3ZTBhZjFlZjlmZDE1ODEyZmRlYzk3MTUzYTE0ZTBiMDQ3NTQ2YWEiLCJuYW1lIjoic2FoaWwgdHJpYWwiLCJyb2xlcyI6W3siaWQiOjUsIm5hbWUiOiJ0aWVydXNlciIsImRpc3BsYXlfbmFtZSI6InRpZXIgdXNlciIsImRlc2NyaXB0aW9uIjoidGllciB1c2VyIHBlcm1pc3Npb24iLCJjcmVhdGVkX2F0IjpudWxsLCJ1cGRhdGVkX2F0IjpudWxsLCJwaXZvdCI6eyJ1c2VyX2lkIjozNCwicm9sZV9pZCI6NX19XX0.9Pq1earu0ko9tMQEIpDpTalg5MqbUGbVktXWfHBoXBg",
"token_type": "bearer",
"expires_in": 2628000,
"device_info": "PostmanRuntime#~12434sf3",
"user": {
"id": 34,
"provider_name": null,
"provider_id": null,
"name": "sahil trial",
"email": "[email protected]",
"contact": null,
"gender": null,
"dob": null,
"zipcode": "99583",
"address": null,
"country": "",
"google_id": null,
"last_login": null,
"email_verified_at": "2020-07-24 04:16:20",
"is_active": 1,
"created_at": "2020-07-20 22:45:37",
"updated_at": "2021-07-16 17:02:07",
"stripe_id": "cus_JdQYPv5NAylLHw",
"card_brand": "visa",
"card_last_four": "4242",
"trial_ends_at": null,
"avatar": null,
"roles": [
{
"id": 5,
"name": "tieruser",
"display_name": "tier user",
"description": "tier user permission",
"created_at": null,
"updated_at": null,
"pivot": {
"user_id": 34,
"role_id": 5
}
}
]
},
"termandcondition": false,
"rooms": [
{
"id": 33,
"user_id": 34,
"hotel_room": "Room8",
"session_id": null,
"created_on": "2021-07-13 12:33:42",
"modified_on": "2021-08-06 15:05:07"
},
{
"id": 32,
"user_id": 34,
"hotel_room": "Room7",
"session_id": null,
"created_on": "2021-07-13 12:33:42",
"modified_on": "2021-07-13 12:33:42"
},
{
"id": 31,
"user_id": 34,
"hotel_room": "Room6",
"session_id": null,
"created_on": "2021-07-13 12:33:42",
"modified_on": "2021-07-13 12:33:42"
},
{
"id": 30,
"user_id": 34,
"hotel_room": "Room5",
"session_id": null,
"created_on": "2021-07-13 12:33:42",
"modified_on": "2021-07-13 12:33:42"
},
{
"id": 29,
"user_id": 34,
"hotel_room": "Room4",
"session_id": null,
"created_on": "2021-07-13 12:33:42",
"modified_on": "2021-07-13 12:33:42"
},
{
"id": 28,
"user_id": 34,
"hotel_room": "Room3",
"session_id": null,
"created_on": "2021-07-13 12:33:42",
"modified_on": "2021-07-13 12:33:42"
},
{
"id": 27,
"user_id": 34,
"hotel_room": "Room2",
"session_id": null,
"created_on": "2021-07-13 12:33:42",
"modified_on": "2021-07-13 12:33:42"
},
{
"id": 26,
"user_id": 34,
"hotel_room": "Room1",
"session_id": null,
"created_on": "2021-07-13 12:33:42",
"modified_on": "2021-07-13 12:33:42"
}
],
"userrole": "tieruser"
}
Status Code: 200
Available Variables:
Key | Value | Type |
---|---|---|
baseUrl | http://127.0.0.1:8000 |
Made with ♥ by thedevsaddam | Generated at: 2021-10-11 15:41:06 by docgen