Complete a two-factor login
curl --request POST \
--url https://api.glassmarkets.io/v1/totp/login/ \
--header 'Content-Type: application/json' \
--data '
{
"code": "<string>",
"challenge_id": "<string>",
"cookie_auth": false
}
'import requests
url = "https://api.glassmarkets.io/v1/totp/login/"
payload = {
"code": "<string>",
"challenge_id": "<string>",
"cookie_auth": False
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({code: '<string>', challenge_id: '<string>', cookie_auth: false})
};
fetch('https://api.glassmarkets.io/v1/totp/login/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"user": {
"username": "<string>",
"first_name": "<string>",
"id": 123,
"last_name": "<string>",
"email": "jsmith@example.com",
"is_staff": true
},
"expiry": "2023-11-07T05:31:56Z",
"token": "<string>",
"csrf_token": "<string>"
}Authentication
Complete a two-factor login
Completes a login that returned 202: send its challenge_id with a code from your authenticator app or a recovery code. Returns a session token, like POST /v1/login/.
Complete a two-factor login
curl --request POST \
--url https://api.glassmarkets.io/v1/totp/login/ \
--header 'Content-Type: application/json' \
--data '
{
"code": "<string>",
"challenge_id": "<string>",
"cookie_auth": false
}
'import requests
url = "https://api.glassmarkets.io/v1/totp/login/"
payload = {
"code": "<string>",
"challenge_id": "<string>",
"cookie_auth": False
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({code: '<string>', challenge_id: '<string>', cookie_auth: false})
};
fetch('https://api.glassmarkets.io/v1/totp/login/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"user": {
"username": "<string>",
"first_name": "<string>",
"id": 123,
"last_name": "<string>",
"email": "jsmith@example.com",
"is_staff": true
},
"expiry": "2023-11-07T05:31:56Z",
"token": "<string>",
"csrf_token": "<string>"
}Body
application/jsonapplication/x-www-form-urlencodedmultipart/form-data

