GET /license_info
get_license_info
Seat counts in a {data, status} envelope, not the JSON:API one. rule decides whether free is a number or -1 for unlimited, and none of the three counts equals the HumanUser row count.
API
How many seats the site has and how many are spoken for. The only call that answers it.
Params
| part | value |
|---|---|
| (none) | takes no parameter. An unknown query parameter is ignored, still 200 |
Sample requests
r = c.get("/license_info")
On the probed site, 104 bytes:
{
"data": {"assigned": 4, "rule": "quantity", "free": 46, "total": 50, "type": "license-count"},
"status": "success"
}
An unknown query parameter changes nothing:
r = c.get("/license_info", params={"prefs": "hours_per_day"})
{
"data": {"assigned": 4, "rule": "quantity", "free": 46, "total": 50, "type": "license-count"},
"status": "success"
}
| key | type | means |
|---|---|---|
total |
integer | seats the site is licensed for |
assigned |
integer | seats spoken for |
free |
integer | total - assigned under rule: quantity; -1 under rule: unlimited |
rule |
string | quantity or unlimited. Read it before reading free |
type |
string | license-count on the probed site |
Response codes
| status | when |
|---|---|
| 200 | always, including with an unrecognised query parameter |
| 401 | Request rejected due to invalid credentials. |
Edge cases
- The envelope is
{"data": ..., "status": "success"}. There is nolinksand nolinks.self, so a client that reads every response through a JSON:API decoder fails on this one. - The site's own
/spec.jsonexample gives the five values as strings ("assigned": "56"). The site returns integers. Type-check rather than trusting the example. freeis-1, not0ornull, whenruleisunlimited. Subtracting it fromtotalgives a number larger than the licence.assignedis not the HumanUser row count and not the size of theGET /subscription_seat/user_subscriptionshash. On the probed site the three were 4, 24 and 14. Do not derive one from another./spec.jsonmarks this call with thesudo_as_loginsecurity scope. A script token reads it without one, and so does a token acting as anAdmin. Acting as anArtistit is401code 110Must sudo as Administrator to query license information, the API naming the scope in its own refusal (probe 027).