list_licensees

List

Returns a key's licensees, oldest first, up to 100 per request. The list omits cancelled licensees. The key must be enabled for sublicensing.

Endpoint​

GET /keys/{key}/licensees

See the API reference for this endpoint.

This operation needs a Management Key. Pass it as the required user_token keyword argument; the client sends it in the Authorization header. See setup.

Import​

from ideal_postcodes import IdealPostcodes

Call list_licensees on the IdealPostcodes client. Path parameters are positional; query and body parameters are keyword-only.

Path Parameters​

NameTypeRequiredDescription
keystryesAPI Key The API Key. Begins ak_.

Query Parameters​

NameTypeRequiredDescription
starting_afterstrnoID of the licensee after which to list results. Pass the id of the last licensee on the previous page.
limitintnoLimit Specifies the maximum number of records to retrieve. By default the limit is 10. Requesting a larger result set adds latency.
querystrnoFilter results by licensee name. Can be shortened to q=

Response Type​

from ideal_postcodes.types import ListLicenseesResult

Errors​

Unsuccessful HTTP responses raise APIError or a subclass, with the HTTP status and the API error code and message. Connection failures and timeouts raise TransportError. Unexpected responses raise ProtocolError. All derive from ClientError. A result that does not match the spec is returned unvalidated with a ResponseValidationWarning. See error handling.

Example​

list_licensees.pypython
from ideal_postcodes import IdealPostcodes

with IdealPostcodes("ak_test") as client:
    licensees = client.list_licensees("ak_test", user_token="uk_example")