[ckan-dev] datastore API ajax request not working. 409 conflict

Brown, Mathew GCPE:EX Mathew.Brown at gov.bc.ca
Tue Oct 6 16:50:04 UTC 2015


Yesterday I found I was unable to make ajax requests using the (javascript) datastore API. I checked on the demo site and a number of other ckan instances and found this to be the same everywhere. I'm not sure what the problem is, this feature was working a few days ago..

Here is an example of a resource I'm trying to access:

 <!DOCTYPE html>
<met charset="utf-8">


<body>
<script
src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>

<h1>test api</h1>

<script>

   var data = {
    resource_id: '9ba355b1-8c5d-491a-b3e0-b0d45e6effb8', // the resource id
    limit: 5
  };
  $.ajax({
    url: 'http://catalogue.data.gov.bc.ca/api/action/datastore_search',
    data: data,
    dataType: 'jsonp',
    success: function(data) {
      alert('Total results found: ' + data.result.total)
    }
  });


</script>

Does anyone have any ideas why I'm getting a 409 on this?

Note, if I make this request through the browser, there’s no problem

http://catalogue.data.gov.bc.ca/api/action/datastore_search?resource_id=9ba355b1-8c5d-491a-b3e0-b0d45e6effb8

Thanks!





More information about the ckan-dev mailing list