[ckan-dev] CKAN API 'extras' field

Carl Lange carl at derilinx.com
Thu Feb 11 13:36:36 UTC 2016


Hi Mike,

Here's a working example:
https://github.com/ckan/ckan/issues/2769#issuecomment-173758267

Cheers,
Carl

On 11 February 2016 at 13:27, Mike Sinclair <mm.sinclair08 at gmail.com> wrote:

> I have it working via CKANAPI since it's just python. I'm not sure of the
> syntax of the 'upload' value for plain resource_create API call in the docs.
>
> Mike
>>
> On Thu, Feb 11, 2016 at 5:27 AM, Mike Sinclair <info at opengovgear.com>
> wrote:
>
>> I have it working via CKANAPI since it's just python. I'm not sure of the
>> syntax of the 'upload' value for plain resource_create API call in the docs.
>>
>> Mike
>>>>
>> On Thu, Feb 11, 2016 at 5:17 AM, Pedro G Silva <
>> pedro.gracio at deimos.com.pt> wrote:
>>
>>>
>>> http://docs.ckan.org/en/latest/api/index.html#ckan.logic.action.create.resource_create
>>>
>>> On Thu, Feb 11, 2016 at 1:16 PM, Pedro G Silva <
>>> pedro.gracio at deimos.com.pt> wrote:
>>>
>>>> I don't believe there is a format for that, I'm pretty sure ckan can
>>>> take any file. Any specifics on the error? Although its commented on the
>>>> code it does work, I've done it before. You can check more about the inputs
>>>> here
>>>> http://docs.ckan.org/en/latest/api/index.html#ckan.logic.action.create.resource_view_create
>>>>
>>>> On Thu, Feb 11, 2016 at 1:12 PM, Mike Sinclair <mm.sinclair08 at gmail.com
>>>> > wrote:
>>>>
>>>>> For the 'upload' value in the API. Do you happen to know the format
>>>>> for that. I tried specifying the path of a local file but that didn't work.
>>>>>
>>>>> Mike
>>>>>>>>>>
>>>>> On Thu, Feb 11, 2016 at 4:02 AM, Mike Sinclair <
>>>>> mm.sinclair08 at gmail.com> wrote:
>>>>>
>>>>>> Thank you!
>>>>>>
>>>>>> Kinda verbose but it works. :)
>>>>>>
>>>>>> Mike
>>>>>>>>>>>>
>>>>>> On Thu, Feb 11, 2016 at 4:00 AM, Mike Sinclair <info at opengovgear.com>
>>>>>> wrote:
>>>>>>
>>>>>>> Thank you!
>>>>>>>
>>>>>>> Ah, nice and verbose. Second question..
>>>>>>>
>>>>>>> For some reason when I upload datasets through the api, they don't
>>>>>>> show up in their proper org and they are not found in the dataset listing.
>>>>>>> However, if I use the direct URL I can see the dataset.
>>>>>>> They are public and belong to the correct org.
>>>>>>>
>>>>>>> Mike
>>>>>>>>>>>>>>
>>>>>>> On Thu, Feb 11, 2016 at 3:45 AM, Pedro G Silva <
>>>>>>> pedro.gracio at deimos.com.pt> wrote:
>>>>>>>
>>>>>>>>
>>>>>>>>    - extras:
>>>>>>>>    [
>>>>>>>>       -
>>>>>>>>       {
>>>>>>>>          - key: "Datatype",
>>>>>>>>          - value: "Grid"
>>>>>>>>          },
>>>>>>>>       -
>>>>>>>>       {
>>>>>>>>          - key: "Start Time",
>>>>>>>>          - value: "2015-11-27T00:00:00"
>>>>>>>>          },
>>>>>>>>       -
>>>>>>>>       {
>>>>>>>>          - key: "Stop Time",
>>>>>>>>          - value: "2015-12-03T00:00:00"
>>>>>>>>          },
>>>>>>>>       -
>>>>>>>>       {
>>>>>>>>          - key: "spatial",
>>>>>>>>          - value: "{"type":"Polygon","crs":{"type":"EPSG","properties":{"code":4326,"coordinate_order":"Long,Lat"}},"coordinates":[[[-8.8,39.8],[-8.8,40.4],
>>>>>>>>          [-9.4,40.4], [-9.4,39.8], [-8.8,39.8]]]}"
>>>>>>>>          }
>>>>>>>>       ],
>>>>>>>>
>>>>>>>>
>>>>>>>> On Thu, Feb 11, 2016 at 10:58 AM, Mike Sinclair <
>>>>>>>> mm.sinclair08 at gmail.com> wrote:
>>>>>>>>
>>>>>>>>> Is there something I am doing wrong here? extras seem to break it..
>>>>>>>>>
>>>>>>>>> {
>>>>>>>>>     "name": "cemeteries13",
>>>>>>>>>     "title": "Cemeteries13",
>>>>>>>>>     "owner_org": "test",
>>>>>>>>>     "groups": [
>>>>>>>>>     {"name": "arts-and-culture"}
>>>>>>>>>     ],
>>>>>>>>>     "url": "upload",
>>>>>>>>>     "notes": "something here",
>>>>>>>>>     "state": "Active",
>>>>>>>>>     "extras": [
>>>>>>>>>       {"test": "the thing"}]
>>>>>>>>> }
>>>>>>>>>
>>>>>>>>>>>>>>>>>>
>>>>>>>>> _______________________________________________
>>>>>>>>> ckan-dev mailing list
>>>>>>>>> ckan-dev at lists.okfn.org
>>>>>>>>> https://lists.okfn.org/mailman/listinfo/ckan-dev
>>>>>>>>> Unsubscribe: https://lists.okfn.org/mailman/options/ckan-dev
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>>
>>>>>>>>
>>>>>>>> [image: DEIMOS Engenharia, SA] <http://www.deimos.pt>
>>>>>>>> *Pedro Gracio Silva*
>>>>>>>> Aerospace Systems / Production Center
>>>>>>>>
>>>>>>>> *Av. D. Joao II, Lt 1.17.01, 10 • 1998-023 Lisboa, Portugal*
>>>>>>>> Ph: +351 21 893 3020 • Fax: +351 21 896 9099
>>>>>>>>
>>>>>>>>
>>>>>>>> _______________________________________________
>>>>>>>> ckan-dev mailing list
>>>>>>>> ckan-dev at lists.okfn.org
>>>>>>>> https://lists.okfn.org/mailman/listinfo/ckan-dev
>>>>>>>> Unsubscribe: https://lists.okfn.org/mailman/options/ckan-dev
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> ckan-dev mailing list
>>>>> ckan-dev at lists.okfn.org
>>>>> https://lists.okfn.org/mailman/listinfo/ckan-dev
>>>>> Unsubscribe: https://lists.okfn.org/mailman/options/ckan-dev
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>>
>>>>
>>>> [image: DEIMOS Engenharia, SA] <http://www.deimos.pt>
>>>> *Pedro Gracio Silva*
>>>> Aerospace Systems / Production Center
>>>>
>>>> *Av. D. Joao II, Lt 1.17.01, 10 • 1998-023 Lisboa, Portugal*
>>>> Ph: +351 21 893 3020 • Fax: +351 21 896 9099
>>>>
>>>>
>>>
>>>
>>> --
>>>
>>>
>>> [image: DEIMOS Engenharia, SA] <http://www.deimos.pt>
>>> *Pedro Gracio Silva*
>>> Aerospace Systems / Production Center
>>>
>>> *Av. D. Joao II, Lt 1.17.01, 10 • 1998-023 Lisboa, Portugal*
>>> Ph: +351 21 893 3020 • Fax: +351 21 896 9099
>>>
>>>
>>> _______________________________________________
>>> ckan-dev mailing list
>>> ckan-dev at lists.okfn.org
>>> https://lists.okfn.org/mailman/listinfo/ckan-dev
>>> Unsubscribe: https://lists.okfn.org/mailman/options/ckan-dev
>>>
>>>
>>
>
> _______________________________________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org
> https://lists.okfn.org/mailman/listinfo/ckan-dev
> Unsubscribe: https://lists.okfn.org/mailman/options/ckan-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20160211/fcf30d2c/attachment-0003.html>


More information about the ckan-dev mailing list