Impossible to do a simple API call

Hi,
I have built a form (pk 45240) and I would like to run simply:

curl -X GET “https://kc.kobotoolbox.org/api/v1/data/45240

But I have {“detail”: “Not found”}%

I’m using it inside https://kc.humanitarianresponse.info. If I run

curl -X GET “https://kc.humanitarianresponse.info/api/v1/data/45240

I have always But I have {“detail”: “Not found”}%

Am I using a wrong pk? How to collect it?

Thank you very much,

Andrea

Hi Andrea,

The fix is an easy one: Your API call is missing an authentication method. The easiest one is to add -u username:password at the end. What you would need is the following then:

curl -X GET https://kc.kobotoolbox.org/api/v1/data/45240 -u yourusername:yourpassword

To get a list of the pk for all your deployed forms type in

curl -X GET https://kc.kobotoolbox.org/api/v1/forms -u yourusername:yourpassword

Hope this helps.

Best,

Tino

···

On Sat, Oct 31, 2015 at 2:05 PM, Andrea Borruso abor...@gmail.com wrote:

Hi,
I have built a form (pk 45240) and I would like to run simply:

curl -X GET “https://kc.kobotoolbox.org/api/v1/data/45240

But I have {“detail”: “Not found”}%

I’m using it inside https://kc.humanitarianresponse.info. If I run

curl -X GET “https://kc.humanitarianresponse.info/api/v1/data/45240

I have always But I have {“detail”: “Not found”}%

Am I using a wrong pk? How to collect it?

Thank you very much,

Andrea

You received this message because you are subscribed to the Google Groups “Kobo Users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to kobo-users+...@googlegroups.com.

To post to this group, send email to kobo-...@googlegroups.com.

Visit this group at http://groups.google.com/group/kobo-users.

For more options, visit https://groups.google.com/d/optout.