ckan / ckanapi

A command line interface and Python module for accessing the CKAN Action API
Other
176 stars 74 forks source link

Handling versioned api #134

Open dannyfraser opened 6 years ago

dannyfraser commented 6 years ago

This line suggests that ckanapi doesn't support APIs with different versions, for example http://data.europa.eu/euodp/data/api/3 .

Does RemoteCKAN need a new parameter in the constructor to specify the API version?

dannyfraser commented 6 years ago

Further research shows that the default behaviour is

If you don’t specify the version number then you will default to version 1 of the Model, Search and Util APIs and version 3 of the Action API.

https://docs.ckan.org/en/ckan-1.6/apiv3.html

wardi commented 6 years ago

ckanapi only uses the action api and so far there has been no update to the action api version. It's not a bad idea to add a parameter to allow a client to select the version, on the chance that we do come out with an action api v4 in the future.

zotya commented 5 years ago

I had a similar issue, but my problem was, that the url for action api is not located on 'api/action/'. I made a fork, and implemented a configurable url for the action api: https://github.com/eea/ckanapi/commit/cee14cdde5a79216b6cb5ad1b7298d5364dcadd8

Now, when I initialize the RemoteCKAN, I can set the url for api:

ckanapi.RemoteCKAN(self.__address,
            self.__apikey,
            self.__user_agent,
            base_url='myapilocation/action/')