interface APIClientInterface (View source)

A service responsible for communicating with a CKAN API endpoint

Constants

API_VERSION

The CKAN API version to communicate with

Methods

public
array
getData(Resource $resource, string $action = 'datastore_search', string $id = 'Identifier')

Performs a request to the CKAN API for the given Resource and returns the raw data result

public
array
getPackage(Resource $resource)

Performs a request to the CKAN API for the given Resource and returns the result. Uses the endpoint for "package_show".

public
array
getSearchData(Resource $resource)

Performs a request to the CKAN API for the given Resource and returns the raw data result. Uses the endpoint for "datastore_search".

Details

array getData(Resource $resource, string $action = 'datastore_search', string $id = 'Identifier')

Performs a request to the CKAN API for the given Resource and returns the raw data result

Parameters

Resource $resource
string $action

The CKAN API action to use

string $id

The Resource field to use as the "id" argument

Return Value

array

The output from the CKAN API

Exceptions

RuntimeException

array getPackage(Resource $resource)

Performs a request to the CKAN API for the given Resource and returns the result. Uses the endpoint for "package_show".

Parameters

Resource $resource

Return Value

array

The output from the CKAN API

Exceptions

RuntimeException

array getSearchData(Resource $resource)

Performs a request to the CKAN API for the given Resource and returns the raw data result. Uses the endpoint for "datastore_search".

Parameters

Resource $resource

Return Value

array

The output from the CKAN API

Exceptions

RuntimeException