Log in
curl --request POST \
--url https://api.glassmarkets.io/v1/login/ \
--header 'Content-Type: application/json' \
--data '
{
"email": "<string>",
"password": "<string>",
"cookie_auth": false,
"remember_me": false
}
'import requests
url = "https://api.glassmarkets.io/v1/login/"
payload = {
"email": "<string>",
"password": "<string>",
"cookie_auth": False,
"remember_me": 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({
email: '<string>',
password: '<string>',
cookie_auth: false,
remember_me: false
})
};
fetch('https://api.glassmarkets.io/v1/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/login/"
payload := strings.NewReader("{\n \"email\": \"<string>\",\n \"password\": \"<string>\",\n \"cookie_auth\": false,\n \"remember_me\": 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/login/")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"<string>\",\n \"password\": \"<string>\",\n \"cookie_auth\": false,\n \"remember_me\": false\n}")
.asString();{
"expiry": "2025-03-19T06:16:11.133643-04:00",
"token": "ad3dfe261c87c5556bc090aef5c2e9b6be8a647f00476d7c7bcd0412f889",
"user": {
"username": "email@address.com",
"first_name": "Firstname",
"id": 1,
"last_name": "Lastname",
"email": "email@address.com"
}
}Authentication
Log in
Exchanges your email and password for a session token. Send the token as Authorization: Token <token> on every other request.
The token expires one day after its last use, and at most 30 days after login. With remember_me, it stays valid for at least 7 days. expiry in the response is the current expiry time.
If your account has two-factor authentication, the response is 202 with a challenge_id. Complete the login with POST /v1/totp/login/, or POST /v1/email-2fa/login/ when the response includes method: email. cookie_auth is for the GlassMarkets web app and needs a trusted browser origin. Login is rate-limited.
Log in
curl --request POST \
--url https://api.glassmarkets.io/v1/login/ \
--header 'Content-Type: application/json' \
--data '
{
"email": "<string>",
"password": "<string>",
"cookie_auth": false,
"remember_me": false
}
'import requests
url = "https://api.glassmarkets.io/v1/login/"
payload = {
"email": "<string>",
"password": "<string>",
"cookie_auth": False,
"remember_me": 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({
email: '<string>',
password: '<string>',
cookie_auth: false,
remember_me: false
})
};
fetch('https://api.glassmarkets.io/v1/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/login/"
payload := strings.NewReader("{\n \"email\": \"<string>\",\n \"password\": \"<string>\",\n \"cookie_auth\": false,\n \"remember_me\": 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/login/")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"<string>\",\n \"password\": \"<string>\",\n \"cookie_auth\": false,\n \"remember_me\": false\n}")
.asString();{
"expiry": "2025-03-19T06:16:11.133643-04:00",
"token": "ad3dfe261c87c5556bc090aef5c2e9b6be8a647f00476d7c7bcd0412f889",
"user": {
"username": "email@address.com",
"first_name": "Firstname",
"id": 1,
"last_name": "Lastname",
"email": "email@address.com"
}
}Body
application/jsonapplication/x-www-form-urlencodedmultipart/form-data

