Using CAT access API
November 21, 2023 ยท View on GitHub
Author: Tomasz Wolinewicz, twoln@umk.pl
We document how you can access CAT data without using the provided GUIs
Introduction
Various programs may want to access CAT data thus becoming another CAT UI. CAT access API is here to enable and ease this access. Please be aware that CAT data is restricted by Terms of Use. The link to ToU is always sent within CAT results. Please respect the rules.
Data access is provided by HTTP calls to the script user/API.php. You may use both GET and POST.
The main mandatory argument is
This documentation is for version 2 of the API.
Most calls require an additional argument as well, where you need to provide an internal CAT identifier of the object that you require. The values of these identifiers are available via the CAT list calls.
List of available actions
- listLanguages
- listCountries
- listAllIdentityProviders
- listIdentityProviders
- listProfiles
- profileAttributes
- listDevices
- generateInstaller
- downloadInstaller
- sendLogo
JSON structure
With the exception of sendLogo, which sends an image, data returned by each called is sent as a JSON encoded array.
The main array has three entries:
In most cases
Actions in detail
-
listLanguages
- mandatory arguments:
- none
- optional arguments:
- none
- data:
- Array of triples: {"lang", "display", "locale"}.
- mandatory arguments:
-
listCountries
- mandatory arguments:
- none
- optional arguments:
- lang
- data:
- Array of tuples: {"federation", "display"}.
- mandatory arguments:
-
listAllIdentityProviders
- mandatory arguments:
- none
- optional arguments:
- lang
- data:
- The main purpose of this action is to provide listing for DiscoJuice, therefore
the structure of the result is tailored to DiscoJuice's needs.
The result is an array of tuples {"entityID", "title", "country", "geo", "icon", "idp"}.
geo andicon are optional.idp is provided for conformance reasons, but is just a copy ofentityID .geo can be either a {"lon", "lat"} tuple or an array of such tuples.
- The main purpose of this action is to provide listing for DiscoJuice, therefore
the structure of the result is tailored to DiscoJuice's needs.
The result is an array of tuples {"entityID", "title", "country", "geo", "icon", "idp"}.
- mandatory arguments:
-
listIdentityProviders
- mandatory arguments:
- federation - the identifier of a country to be listed.
- optional arguments:
- lang
- data:
- Array of tuples: {"idp", "display"}.
- mandatory arguments:
-
listProfiles
- mandatory arguments:
- idp - the identifier of an IdP
- optional arguments:
- lang
- sort - if equal to 1 sort profiles by name (case-ignore)
- data:
- Array of tuples: {"profile", "display", "idp_name", "logo"}.
logo can be0 or1 and shows if logo is available.
- Array of tuples: {"profile", "display", "idp_name", "logo"}.
- mandatory arguments:
-
profileAttributes
- mandatory arguments:
- profile - the identifier of the profile to be shown
- optional arguments:
- lang
- data:
- Array of tuples: {"local_email", "local_phone", "local_url", "description", "devices"}.
All
local_ entries anddescription are optional.devices is an array of tuples {"id", "display", "status", "redirect", "eap_customtext", "device_customtext"}.
- Array of tuples: {"local_email", "local_phone", "local_url", "description", "devices"}.
All
- mandatory arguments:
-
listDevices
- mandatory arguments:
- profile - the identifier of the profile for which the devices will be listed
- optional arguments:
- lang
- data:
- array of tuples {"device", "display", "status", "redirect", "eap_customtext", "device_customtext"}.
- mandatory arguments:
-
generateInstaller
- mandatory arguments:
- device - identifier of the device; profile - identifier of the profile
- optional arguments:
- lang
- data:
- array of tuples {"profile", "device", "link", "mime"}.
- mandatory arguments:
-
downloadInstaller
- mandatory arguments:
- device - identifier of the device; profile - identifier of the profile
- optional arguments:
- lang
- generatedfor - either 'user' or 'admin' - defaults to user
- data:
- installer file
- mandatory arguments:
-
sendLogo
- mandatory arguments:
- idp - the identifier of the identity provider
- optional arguments:
- lang
- data:
- logo image
- mandatory arguments: