Complete an email verification login
curl --request POST \
--url https://api.glassmarkets.io/v1/email-2fa/login/ \
--header 'Content-Type: application/json' \
--data '
{
"challenge_id": "<string>",
"code": "<string>",
"cookie_auth": false
}
'import requests
url = "https://api.glassmarkets.io/v1/email-2fa/login/"
payload = {
"challenge_id": "<string>",
"code": "<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({challenge_id: '<string>', code: '<string>', cookie_auth: false})
};
fetch('https://api.glassmarkets.io/v1/email-2fa/login/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.glassmarkets.io/v1/email-2fa/login/"
payload := strings.NewReader("{\n \"challenge_id\": \"<string>\",\n \"code\": \"<string>\",\n \"cookie_auth\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.glassmarkets.io/v1/email-2fa/login/")
.header("Content-Type", "application/json")
.body("{\n \"challenge_id\": \"<string>\",\n \"code\": \"<string>\",\n \"cookie_auth\": false\n}")
.asString();{
"user": {
"username": "<string>",
"first_name": "<string>",
"id": 123,
"last_name": "<string>",
"email": "jsmith@example.com",
"is_staff": true,
"can_manage_tokenomics": true
},
"expiry": "2023-11-07T05:31:56Z",
"token": "<string>",
"csrf_token": "<string>"
}{
"challenge_id": [
"This field is required."
]
}{
"detail": "Request was throttled. Expected available in 42 seconds."
}Authentication
Complete an email verification login
Exchanges a password-login challenge and the emailed six-digit code for a session. Codes expire after ten minutes and work once.
Complete an email verification login
curl --request POST \
--url https://api.glassmarkets.io/v1/email-2fa/login/ \
--header 'Content-Type: application/json' \
--data '
{
"challenge_id": "<string>",
"code": "<string>",
"cookie_auth": false
}
'import requests
url = "https://api.glassmarkets.io/v1/email-2fa/login/"
payload = {
"challenge_id": "<string>",
"code": "<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({challenge_id: '<string>', code: '<string>', cookie_auth: false})
};
fetch('https://api.glassmarkets.io/v1/email-2fa/login/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.glassmarkets.io/v1/email-2fa/login/"
payload := strings.NewReader("{\n \"challenge_id\": \"<string>\",\n \"code\": \"<string>\",\n \"cookie_auth\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.glassmarkets.io/v1/email-2fa/login/")
.header("Content-Type", "application/json")
.body("{\n \"challenge_id\": \"<string>\",\n \"code\": \"<string>\",\n \"cookie_auth\": false\n}")
.asString();{
"user": {
"username": "<string>",
"first_name": "<string>",
"id": 123,
"last_name": "<string>",
"email": "jsmith@example.com",
"is_staff": true,
"can_manage_tokenomics": true
},
"expiry": "2023-11-07T05:31:56Z",
"token": "<string>",
"csrf_token": "<string>"
}{
"challenge_id": [
"This field is required."
]
}{
"detail": "Request was throttled. Expected available in 42 seconds."
}Body
application/jsonapplication/x-www-form-urlencodedmultipart/form-data

