[ckan-dev] Problems using CKAN API - package_create()

Washington Nascimento washington.nascimento at splendaconsult.com.br
Tue Oct 14 15:38:35 UTC 2014


Hey Ross!

 

Thank you man! It worked, but do you know why the first one has worked?

 

Thank you so much! :D

 

From: ckan-dev [mailto:ckan-dev-bounces at lists.okfn.org] On Behalf Of Ross
Jones
Sent: terça-feira, 14 de outubro de 2014 12:27
To: CKAN Development Discussions
Subject: Re: [ckan-dev] Problems using CKAN API - package_create()

 

Don’t pass an id field, it is created for you and is a UUID.

 

Ross

 

 

On 14 Oct 2014, at 16:24, Washington Nascimento
<washington.nascimento at splendaconsult.com.br
<mailto:washington.nascimento at splendaconsult.com.br> > wrote:





Sure,

 

This is the json we are using;

 

{"name":"saude-bucal-brasil-sorridente","id":"saude-bucal-brasil-sorridente"
,"title":"Sa\u00fade Bucal - Brasil
Sorridente","author":"MS/SAS","maintainer":"MS/SAS","notes":"Descri\u00e7\u0
0e3o Grupo PGI: S\u00e9rie hist\u00f3rica de indicadores dos resultados
governamentais relativos \u00e0 Sa\u00fade Bucal - Brasil
Sorridente","version":"1.0","url":" <http://pgi.gov.br/pgi>
http://pgi.gov.br/pgi","state":"active","resources":[{"format":"XML","name":
"N\u00famero de equipes do programa de sa\u00fade bucal","url":"
<http://pgi.gov.br/pgiadmin/xml/serie/20.xml>
http://pgi.gov.br/pgiadmin/xml/serie/20.xml"},{"format":"CSV","name":"N\u00f
amero de equipes do programa de sa\u00fade bucal","url":"
<http://pgi.gov.br/pgiadmin/csv/serie/20.csv>
http://pgi.gov.br/pgiadmin/csv/serie/20.csv"},{"format":"JSON","name":"N\u00
famero de equipes do programa de sa\u00fade bucal","url":"
<http://pgi.gov.br/pgiadmin/json/serie/20.json>
http://pgi.gov.br/pgiadmin/json/serie/20.json"}],"tags":[{"name":"PGI"}]}

 

Thank you!

 

From: ckan-dev [mailto:ckan-dev-bounces at lists.okfn.org] On Behalf Of Ross
Jones
Sent: terça-feira, 14 de outubro de 2014 12:23
To: CKAN Development Discussions
Subject: Re: [ckan-dev] Problems using CKAN API - package_create()

 

Hi,

 

Could you put the JSON you’re sending into a pastebin, or something similar?

It may well be that CKAN overuses 409 and in fact it is a different error
(like a missing name field or something).

 

Ross

 

 

On 14 Oct 2014, at 16:15, Washington Nascimento <
<mailto:washington.nascimento at splendaconsult.com.br>
washington.nascimento at splendaconsult.com.br> wrote:






Hello Rachel,

 

Thank you for the response. It’s not the case, we are trying to insert a new
Dataset that was never there. We installed a new CKAN in a new machine, just
to test it, but nothing.

 

The url that we are using to is:

 

 <http://server-name/api/action/package_create>
http://server-name/api/action/package_create

 

In the body of the POST request we are passing the json.

 

Thank you

 

From: ckan-dev [ <mailto:ckan-dev-bounces at lists.okfn.org>
mailto:ckan-dev-bounces at lists.okfn.org] On Behalf Of Rachel Knowler
Sent: terça-feira, 14 de outubro de 2014 12:12
To:  <mailto:ckan-dev at lists.okfn.org> ckan-dev at lists.okfn.org
Subject: Re: [ckan-dev] Problems using CKAN API - package_create()

 

Hi Washington,

Just to check, are you trying to create a dataset with the same name as a
dataset that did exist before, but that you deleted? In this case the
original dataset is still in the database, only deactivated, so you can't
add it again. You need to purge it following these instructions:
<http://docs.ckan.org/en/latest/sysadmin-guide.html#permanently-deleting-dat
asets>
http://docs.ckan.org/en/latest/sysadmin-guide.html#permanently-deleting-data
sets

If that's not the case, maybe someone else will know what your problem is.

Cheers,
Rachel

On 14.10.2014 16:59, Washington Nascimento wrote:

Hello everyone.

 

I am trying to use CKAN API to insert new datasets into CKAN.

 

My problem is that i can insert one dataset, when i try to insert another
one I am having the following error:

 

409 Conflict

 

I know this error occurs when the Dataset already exists and I try to insert
again, the problem is that the second Dataset does not exists.

 

Does anyone has passed for this error?

 

Thank you!


 

--

Washington Nascimento








_______________________________________________
ckan-dev mailing list
 <mailto:ckan-dev at lists.okfn.org> ckan-dev at lists.okfn.org
 <https://lists.okfn.org/mailman/listinfo/ckan-dev>
https://lists.okfn.org/mailman/listinfo/ckan-dev
Unsubscribe:  <https://lists.okfn.org/mailman/options/ckan-dev>
https://lists.okfn.org/mailman/options/ckan-dev







-- 
Liip AG // Limmatstrasse 183 // CH-8005 Zürich
Tel +41 43 500 39 80 // Mob +41 78 658 26 12 //  <http://www.liip.ch/>
www.liip.ch

_______________________________________________
ckan-dev mailing list
 <mailto:ckan-dev at lists.okfn.org> ckan-dev at lists.okfn.org
 <https://lists.okfn.org/mailman/listinfo/ckan-dev>
https://lists.okfn.org/mailman/listinfo/ckan-dev
Unsubscribe:  <https://lists.okfn.org/mailman/options/ckan-dev>
https://lists.okfn.org/mailman/options/ckan-dev

 

_______________________________________________
ckan-dev mailing list
 <mailto:ckan-dev at lists.okfn.org> ckan-dev at lists.okfn.org
 <https://lists.okfn.org/mailman/listinfo/ckan-dev>
https://lists.okfn.org/mailman/listinfo/ckan-dev
Unsubscribe:  <https://lists.okfn.org/mailman/options/ckan-dev>
https://lists.okfn.org/mailman/options/ckan-dev

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20141014/4d4aa9b4/attachment-0003.html>


More information about the ckan-dev mailing list