search for labels by their respective names

Hi, im new to kobotoolbox, im tryng to help a ONG by extracting the kobo forms data and organizing it to run some charts for statistics. Im facing a problem because on the api/v1/data path the questions of the formulary are organized with their NAMES and not their label, the name is not good for the user to understand, so is there a way i can search for the labels with the ID as parameter?

Thanks for your time!

Hi Daniel,
We have two APIs, the one you’re using is our legacy KoboCat API, but there is a new one under https://kf.kobotoolbox.org/assets/. In this new API, if you go to https://kf.kobotoolbox.org/assets/ASSETID, you will see under content/survey the mappings for each question that relate names to labels. An example would be the following:

            {
                "$autoname": "number",
                "$kuid": "375f8473",
                "required": false,
                "type": "integer",
                "label": [
                    "number"
                ]
            },

Depending on how the form was built, you will find the “name” or the “$autoname” property in the JSON structure. You can then track down the labels this way.

Hope this helps,

PM

···

On Sat, Jul 14, 2018 at 5:38 PM, Daniel Bezerra de Menezes danielbe...@gmail.com wrote:

Hi, im new to kobotoolbox, im tryng to help a ONG by extracting the kobo forms data and organizing it to run some charts for statistics. Im facing a problem because on the api/v1/data path the questions of the formulary are organized with their NAMES and not their label, the name is not good for the user to understand, so is there a way i can search for the labels with the ID as parameter?

Thanks for your time!

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

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

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

Hi penar, thanks for the fast reply. But unfurtonately i couldnt get any result, i recieve “Detail not found”. Tried this on 3 different urls, one with https://kc.kobotoolbox.org/api/v1/data/assets/164547 ,one with https://kc.humanitarianresponse.info/av1/v1/data/assets/21321 and other one that is a docker kobo version. All returned detail not found. You have any idea why is this? You can reproduce it in https://kc.kobotoolbox.org/api/v1/data/assets/191797 user danielkobo / kamux123. There is only one form there so is a account a made for testing purposes. If u could take a look at the form structure and tell me if something is wrong, i would much appreciate it, thanks anyway!

···

2018-07-14 23:30 GMT-03:00 penar musaraj pmus...@gmail.com:

Hi Daniel,
We have two APIs, the one you’re using is our legacy KoboCat API, but there is a new one under https://kf.kobotoolbox.org/assets/. In this new API, if you go to https://kf.kobotoolbox.org/assets/ASSETID, you will see under content/survey the mappings for each question that relate names to labels. An example would be the following:

            {
                "$autoname": "number",
                "$kuid": "375f8473",
                "required": false,
                "type": "integer",
                "label": [
                    "number"
                ]
            },

Depending on how the form was built, you will find the “name” or the “$autoname” property in the JSON structure. You can then track down the labels this way.

Hope this helps,

PM

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

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

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

On Sat, Jul 14, 2018 at 5:38 PM, Daniel Bezerra de Menezes danielbe...@gmail.com wrote:

Hi, im new to kobotoolbox, im tryng to help a ONG by extracting the kobo forms data and organizing it to run some charts for statistics. Im facing a problem because on the api/v1/data path the questions of the formulary are organized with their NAMES and not their label, the name is not good for the user to understand, so is there a way i can search for the labels with the ID as parameter?

Thanks for your time!

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

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

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

Hi Daniel,
The “/assets” endpoints are not on the kc.kobotoolbox.org URL. They are in kf.kobotoolbox.org.

PM

···

On Sun, Jul 15, 2018 at 6:45 AM, Daniel Bezerra de Menezes danielbe...@gmail.com wrote:

Hi penar, thanks for the fast reply. But unfurtonately i couldnt get any result, i recieve “Detail not found”. Tried this on 3 different urls, one with https://kc.kobotoolbox.org/api/v1/data/assets/164547 ,one with https://kc.humanitarianresponse.info/av1/v1/data/assets/21321 and other one that is a docker kobo version. All returned detail not found. You have any idea why is this? You can reproduce it in https://kc.kobotoolbox.org/api/v1/data/assets/191797 user danielkobo / kamux123. There is only one form there so is a account a made for testing purposes. If u could take a look at the form structure and tell me if something is wrong, i would much appreciate it, thanks anyway!

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

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

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

2018-07-14 23:30 GMT-03:00 penar musaraj pmus...@gmail.com:

Hi Daniel,
We have two APIs, the one you’re using is our legacy KoboCat API, but there is a new one under https://kf.kobotoolbox.org/assets/. In this new API, if you go to https://kf.kobotoolbox.org/assets/ASSETID, you will see under content/survey the mappings for each question that relate names to labels. An example would be the following:

            {
                "$autoname": "number",
                "$kuid": "375f8473",
                "required": false,
                "type": "integer",
                "label": [
                    "number"
                ]
            },

Depending on how the form was built, you will find the “name” or the “$autoname” property in the JSON structure. You can then track down the labels this way.

Hope this helps,

PM

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

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

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

On Sat, Jul 14, 2018 at 5:38 PM, Daniel Bezerra de Menezes danielbe...@gmail.com wrote:

Hi, im new to kobotoolbox, im tryng to help a ONG by extracting the kobo forms data and organizing it to run some charts for statistics. Im facing a problem because on the api/v1/data path the questions of the formulary are organized with their NAMES and not their label, the name is not good for the user to understand, so is there a way i can search for the labels with the ID as parameter?

Thanks for your time!

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

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

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

Thanks dude! this new endpoint is really good. Will fit to my needs!

···

2018-07-15 17:55 GMT-03:00 penar musaraj pmus...@gmail.com:

Hi Daniel,
The “/assets” endpoints are not on the kc.kobotoolbox.org URL. They are in kf.kobotoolbox.org.

PM

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

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

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

On Sun, Jul 15, 2018 at 6:45 AM, Daniel Bezerra de Menezes danielbe...@gmail.com wrote:

Hi penar, thanks for the fast reply. But unfurtonately i couldnt get any result, i recieve “Detail not found”. Tried this on 3 different urls, one with https://kc.kobotoolbox.org/api/v1/data/assets/164547 ,one with https://kc.humanitarianresponse.info/av1/v1/data/assets/21321 and other one that is a docker kobo version. All returned detail not found. You have any idea why is this? You can reproduce it in https://kc.kobotoolbox.org/api/v1/data/assets/191797 user danielkobo / kamux123. There is only one form there so is a account a made for testing purposes. If u could take a look at the form structure and tell me if something is wrong, i would much appreciate it, thanks anyway!

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

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

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

2018-07-14 23:30 GMT-03:00 penar musaraj pmus...@gmail.com:

Hi Daniel,
We have two APIs, the one you’re using is our legacy KoboCat API, but there is a new one under https://kf.kobotoolbox.org/assets/. In this new API, if you go to https://kf.kobotoolbox.org/assets/ASSETID, you will see under content/survey the mappings for each question that relate names to labels. An example would be the following:

            {
                "$autoname": "number",
                "$kuid": "375f8473",
                "required": false,
                "type": "integer",
                "label": [
                    "number"
                ]
            },

Depending on how the form was built, you will find the “name” or the “$autoname” property in the JSON structure. You can then track down the labels this way.

Hope this helps,

PM

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

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

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

On Sat, Jul 14, 2018 at 5:38 PM, Daniel Bezerra de Menezes danielbe...@gmail.com wrote:

Hi, im new to kobotoolbox, im tryng to help a ONG by extracting the kobo forms data and organizing it to run some charts for statistics. Im facing a problem because on the api/v1/data path the questions of the formulary are organized with their NAMES and not their label, the name is not good for the user to understand, so is there a way i can search for the labels with the ID as parameter?

Thanks for your time!

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

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

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

Hey penar, is there a new endpoint for api/v1​/data/id ? This new endpoint / assets helped me cleaning the name/labels, but didnt really help for the awnsers, the awnsers are filled with their respectives NAMEs on v1/data, but the names sometimes are repeated so i cant really distinguish themselfs to use the Choices array on the assets.

Nevermind i realize now i can relate choices and survey with list_name.

···

2018-07-19 7:11 GMT-03:00 Daniel Bezerra de Menezes danielbe...@gmail.com:

Hey penar, is there a new endpoint for api/v1​/data/id ? This new endpoint / assets helped me cleaning the name/labels, but didnt really help for the awnsers, the awnsers are filled with their respectives NAMEs on v1/data, but the names sometimes are repeated so i cant really distinguish themselfs to use the Choices array on the assets.

Hey penar, is there a way to make the awsnered forms unique? i see that the ID and is being repeated on every awnsered forms, i would like some unique ids for the awnsered forms so i can check if i already inserted them in my own mongodb

···

2018-07-19 14:52 GMT-03:00 Daniel Bezerra de Menezes danielbe...@gmail.com:

Nevermind i realize now i can relate choices and survey with list_name.

2018-07-19 7:11 GMT-03:00 Daniel Bezerra de Menezes danielbe...@gmail.com:

Hey penar, is there a new endpoint for api/v1​/data/id ? This new endpoint / assets helped me cleaning the name/labels, but didnt really help for the awnsers, the awnsers are filled with their respectives NAMEs on v1/data, but the names sometimes are repeated so i cant really distinguish themselfs to use the Choices array on the assets.

Hi Daniel,
I’m not an expert at this, I know my colleague has a method for unique sequential serial numbers described in this article: http://help.kobotoolbox.org/creating-forms/how-to-create-sequential-unique-serial-numbers

Another way would be to store a hash in your mongodb and then compare subsequent submission hashes to existing hashes…

···

2018-07-19 14:52 GMT-03:00 Daniel Bezerra de Menezes danielbe...@gmail.com:

Nevermind i realize now i can relate choices and survey with list_name.

2018-07-19 7:11 GMT-03:00 Daniel Bezerra de Menezes danielbe...@gmail.com:

Hey penar, is there a new endpoint for api/v1​/data/id ? This new endpoint / assets helped me cleaning the name/labels, but didnt really help for the awnsers, the awnsers are filled with their respectives NAMEs on v1/data, but the names sometimes are repeated so i cant really distinguish themselfs to use the Choices array on the assets.

Daniel,

You see _id being repeated in the submission data? That seems strange. What about _uuid—could you use that?

John

···

On Tue, Jul 24, 2018 at 10:19 PM, penar musaraj pmus...@gmail.com wrote:

Hi Daniel,
I’m not an expert at this, I know my colleague has a method for unique sequential serial numbers described in this article: http://help.kobotoolbox.org/creating-forms/how-to-create-sequential-unique-serial-numbers

Another way would be to store a hash in your mongodb and then compare subsequent submission hashes to existing hashes…

On Tue, Jul 24, 2018 at 8:18 PM Daniel Bezerra de Menezes danielbe...@gmail.com wrote:

Hey penar, is there a way to make the awsnered forms unique? i see that the ID and is being repeated on every awnsered forms, i would like some unique ids for the awnsered forms so i can check if i already inserted them in my own mongodb

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

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

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

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

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

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

2018-07-19 14:52 GMT-03:00 Daniel Bezerra de Menezes danielbe...@gmail.com:

Nevermind i realize now i can relate choices and survey with list_name.

2018-07-19 7:11 GMT-03:00 Daniel Bezerra de Menezes danielbe...@gmail.com:

Hey penar, is there a new endpoint for api/v1​/data/id ? This new endpoint / assets helped me cleaning the name/labels, but didnt really help for the awnsers, the awnsers are filled with their respectives NAMEs on v1/data, but the names sometimes are repeated so i cant really distinguish themselfs to use the Choices array on the assets.

Hi john, ye its repeated ,uuid is also repeated, i think the way the user did the form was bad. Yesterday while testing i made a form with the group of questions feature, and there was a Index that was unique to each submited awnser. This is the endpoint if u are wondering https://kobocat.docker.kobo.techo.org/api/v1/data/42

···

2018-07-26 1:59 GMT-03:00 John Milner john....@kobotoolbox.org:

Daniel,

You see _id being repeated in the submission data? That seems strange. What about _uuid—could you use that?

John

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

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

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

On Tue, Jul 24, 2018 at 10:19 PM, penar musaraj pmus...@gmail.com wrote:

Hi Daniel,
I’m not an expert at this, I know my colleague has a method for unique sequential serial numbers described in this article: http://help.kobotoolbox.org/creating-forms/how-to-create-sequential-unique-serial-numbers

Another way would be to store a hash in your mongodb and then compare subsequent submission hashes to existing hashes…

On Tue, Jul 24, 2018 at 8:18 PM Daniel Bezerra de Menezes danielbe...@gmail.com wrote:

Hey penar, is there a way to make the awsnered forms unique? i see that the ID and is being repeated on every awnsered forms, i would like some unique ids for the awnsered forms so i can check if i already inserted them in my own mongodb

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

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

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

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

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

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

2018-07-19 14:52 GMT-03:00 Daniel Bezerra de Menezes danielbe...@gmail.com:

Nevermind i realize now i can relate choices and survey with list_name.

2018-07-19 7:11 GMT-03:00 Daniel Bezerra de Menezes danielbe...@gmail.com:

Hey penar, is there a new endpoint for api/v1​/data/id ? This new endpoint / assets helped me cleaning the name/labels, but didnt really help for the awnsers, the awnsers are filled with their respectives NAMEs on v1/data, but the names sometimes are repeated so i cant really distinguish themselfs to use the Choices array on the assets.

OK, _uuid is generated by the client and it’s possible to have duplicates. Submissions are only rejected if the entire XML exactly matches something already in the database.

The _id value comes from the primary key of the submission in the Postgres database and should not be repeated. It should also match the URL when you’re viewing a single data submission (e.g. when viewing [https://kobocat/api/v1/data/[your-form-id]/[your-submission-id]?format=json](https://kobocat/api/v1/data/%5Byour-form-id%5D/%5Byour-submission-id%5D?format=json), the [your-submission-id] part should match the _id in the submission JSON). Make sure to include the?format=json part when using a web browser, and don’t add a slash after the submission id.

I can’t see the data you linked without a username and password, but don’t share those here :slight_smile:

···

On Thu, Jul 26, 2018 at 9:12 AM, Daniel Bezerra de Menezes danielbe...@gmail.com wrote:

Hi john, ye its repeated ,uuid is also repeated, i think the way the user did the form was bad. Yesterday while testing i made a form with the group of questions feature, and there was a Index that was unique to each submited awnser. This is the endpoint if u are wondering https://kobocat.docker.kobo.techo.org/api/v1/data/42

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

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

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

2018-07-26 1:59 GMT-03:00 John Milner john....@kobotoolbox.org:

Daniel,

You see _id being repeated in the submission data? That seems strange. What about _uuid—could you use that?

John

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

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

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

On Tue, Jul 24, 2018 at 10:19 PM, penar musaraj pmus...@gmail.com wrote:

Hi Daniel,
I’m not an expert at this, I know my colleague has a method for unique sequential serial numbers described in this article: http://help.kobotoolbox.org/creating-forms/how-to-create-sequential-unique-serial-numbers

Another way would be to store a hash in your mongodb and then compare subsequent submission hashes to existing hashes…

On Tue, Jul 24, 2018 at 8:18 PM Daniel Bezerra de Menezes danielbe...@gmail.com wrote:

Hey penar, is there a way to make the awsnered forms unique? i see that the ID and is being repeated on every awnsered forms, i would like some unique ids for the awnsered forms so i can check if i already inserted them in my own mongodb

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

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

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

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

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

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

2018-07-19 14:52 GMT-03:00 Daniel Bezerra de Menezes danielbe...@gmail.com:

Nevermind i realize now i can relate choices and survey with list_name.

2018-07-19 7:11 GMT-03:00 Daniel Bezerra de Menezes danielbe...@gmail.com:

Hey penar, is there a new endpoint for api/v1​/data/id ? This new endpoint / assets helped me cleaning the name/labels, but didnt really help for the awnsers, the awnsers are filled with their respectives NAMEs on v1/data, but the names sometimes are repeated so i cant really distinguish themselfs to use the Choices array on the assets.