Get the current session
curl --request GET \
--url https://api.glassmarkets.io/v1/session/ \
--header 'Authorization: <api-key>'import requests
url = "https://api.glassmarkets.io/v1/session/"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.glassmarkets.io/v1/session/', 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
Get the current session
Returns the logged-in user and a CSRF token for browser sessions. Returns 401 when the token is missing, expired or revoked, so it also works as a token check.
Get the current session
curl --request GET \
--url https://api.glassmarkets.io/v1/session/ \
--header 'Authorization: <api-key>'import requests
url = "https://api.glassmarkets.io/v1/session/"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.glassmarkets.io/v1/session/', 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>"
}Authorizations
Token-based authentication with required prefix "Token ". Example: "Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b"

