Get consumer sessions
In order to get all sessions per core instance that were set up for service consumers in parallel via an identical Api-Key, the request MUST be sent with the Api-Key in the HTTP request headers.
All associated sessions are returned by the remote service in the JSON response body as a list of objects of the type: session. In addition, an object of the type: customer is returned in the relationships, which contains all data known to the remote service about the customer for which the Api-Key was granted. The object of the type: agreement in the customer relationships contains information about the service level agreement currently granted to the customer.
Request endpoint
GET SERVER:PORT/api/sessions/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
Response status
200
Request headers
Accept:application/vnd.api+json
Content-Type:application/vnd.api+json
Api-Key:KKKKKKKK-KKKK-KKKK-KKKK-KKKKKKKKKKKK
Response headers
Transfer-Encoding:chunked
Connection:keep-alive
Accept:application/vnd.api+json
Cache-Control:no-cache
Date:Tue, 19 Mar 2024 12:52:00 GMT
Content-Type:application/vnd.api+json
Server:nginx/1.25.4
Request body
# intentionally blank
Response body
{
"links": {
"self": "/api/sessions/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
},
"data": [
{
"attributes": {
"note": "A session note",
"client": "172.18.0.1",
"agent": "HTTP.jl/1.8.5",
"timestamps": {
"granted": "2024-03-19T12:52:00.266Z"
},
"limits": {
"maxTokens": 100000,
"maxDigits": 100,
"minTokens": 1000,
"minDigits": 3
}
},
"id": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
"type": "session"
}
],
"relationships": {
"customer": {
"data": {
"attributes": {
"price": {
"metrics": 1.0,
"job": 5.0,
"rebate": 0.0,
"digit": 0.0009
},
"address": {
"postalCode": "70067",
"secondaryAddress": "HO Wile E. Coyote",
"streetAndNumber": "9830 Hagenes Cape",
"city": "East Thanhside",
"country": "MT"
},
"status": "granted",
"phone": "+00 000 00000000",
"email": "hello@acme.com",
"agreement": "basic",
"usage": "permanent",
"company": "Acme Corporation",
"taxation": {
"change": false,
"reversed": false,
"vatin": "AC12345678",
"tax": 0.19
},
"features": {
"analysis": true
},
"roles": {
"administration": false
},
"division": "Outlandish products",
"timestamps": {
"granted": "2021-10-13T13:41:00.803Z"
}
},
"id": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
"type": "customer"
},
"relationships": {
"agreement": {
"data": {
"attributes": {
"status": "published",
"timestamps": {
"published": "2021-10-01T00:00:00.000Z"
},
"limits": {
"maxTokens": 100000,
"maxDigits": 100,
"minTokens": 1000,
"minDigits": 3
}
},
"id": "basic",
"type": "agreement"
}
}
}
}
}
}
HTTPie example
$ http get SERVER:PORT/api/sessions/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX Accept:application/vnd.api+json Content-Type:application/vnd.api+json Api-Key:KKKKKKKK-KKKK-KKKK-KKKK-KKKKKKKKKKKK