[ckan-dev] adding a resource to a dataset via API

Rufus Pollock rufus.pollock at okfn.org
Mon Aug 27 09:55:04 UTC 2012


On 25 August 2012 07:11, Jim Craner <jim at codeforamerica.org> wrote:
> Hi,
>
> I'm a little stumped after reading the API docs here:
> http://docs.ckan.org/en/latest/api-v2.html#model-api
>
> If I have an existing Dataset on our CKAN site (e.g., "Daily Water
> Totals By Month") with multiple existing resources ("January.csv,"
> "February.csv," etc.) and I want to add a new resource to it via API
> ("March.csv"), what is the location?  Do Datasets have hashes or other
> IDs since I can change the name?

Resources don't have a separate REST endpoint at present. To add a
resource you get the Dataset object add to the list of resources and
POST back.

On the second point: yes, datasets do have an ID (a uuid) which allows
you to do things like change their names and which is completely
permanent (unlikely the name which *can* change though you should try
not to change it!)

Rufus
>
> Thanks!
> Jim
>
>
>
> --
> -----
> Jim Craner, 2012 Fellow
> Code for America
> jim at codeforamerica.org
> (+1) 773-809-4546
> http://codeforamerica.org
>
> _______________________________________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org
> http://lists.okfn.org/mailman/listinfo/ckan-dev



-- 
Co-Founder, Open Knowledge Foundation
Promoting Open Knowledge in a Digital Age
http://www.okfn.org/ - http://blog.okfn.org/




More information about the ckan-dev mailing list