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));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.glassmarkets.io/v1/session/"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.glassmarkets.io/v1/session/")
.header("Authorization", "<api-key>")
.asString();{
"csrf_token": "masked-csrf-token",
"user": {
"username": "email@address.com",
"first_name": "Firstname",
"id": 1,
"last_name": "Lastname",
"email": "email@address.com",
"is_staff": false
}
}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
/
v1
/
session
/
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));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.glassmarkets.io/v1/session/"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.glassmarkets.io/v1/session/")
.header("Authorization", "<api-key>")
.asString();{
"csrf_token": "masked-csrf-token",
"user": {
"username": "email@address.com",
"first_name": "Firstname",
"id": 1,
"last_name": "Lastname",
"email": "email@address.com",
"is_staff": false
}
}
