From 23b2d0f00ec223611d1ceb73397ee5ae1a6518e6 Mon Sep 17 00:00:00 2001 From: Frie Date: Thu, 22 Jul 2021 09:04:15 +0200 Subject: [PATCH 01/57] #4 download data in asset and kobo class --- R/asset.R | 12 ++ R/kobo.R | 8 + man/Asset.Rd | 17 +- man/Kobo.Rd | 21 +++ .../kobo-asset-submissions-asset-nosubs.yml | 58 +++++++ .../fixtures/kobo-asset-submissions-asset.yml | 109 +++++++++++++ .../kobo-asset-submissions-data-nosubs.yml | 35 +++++ .../fixtures/kobo-asset-submissions-data.yml | 37 +++++ tests/fixtures/kobo-get-submissions.yml | 145 ++++++++++++++++++ tests/testthat/test-asset.R | 29 ++++ tests/testthat/test-kobo.R | 10 +- 11 files changed, 479 insertions(+), 2 deletions(-) create mode 100644 tests/fixtures/kobo-asset-submissions-asset-nosubs.yml create mode 100644 tests/fixtures/kobo-asset-submissions-asset.yml create mode 100644 tests/fixtures/kobo-asset-submissions-data-nosubs.yml create mode 100644 tests/fixtures/kobo-asset-submissions-data.yml create mode 100644 tests/fixtures/kobo-get-submissions.yml diff --git a/R/asset.R b/R/asset.R index b82f180..a6f71fe 100644 --- a/R/asset.R +++ b/R/asset.R @@ -92,6 +92,18 @@ Asset <- R6::R6Class("Asset", checkmate::assert_class(kobo, c("R6", "Kobo")) private$.kobo <- kobo }, + + #' get_submissions + #' @description get submissions to a survey/form + #' @return tibble. submissions as a tibble. if no submissions were made yet, the tibble will have no columns. + get_submissions = function() { + if (private$.type != 'survey') { + usethis::ui_stop("Only valid for assets of type 'survey'") + } + path <- glue::glue("assets/{private$.uid}/data/") + private$.kobo$get(path)$results %>% + tibble::as_tibble() + }, #' to_list #' @return list representation of asset to_list = function() { diff --git a/R/kobo.R b/R/kobo.R index 69bf4ba..ab5d425 100644 --- a/R/kobo.R +++ b/R/kobo.R @@ -160,6 +160,14 @@ Kobo <- R6::R6Class("Kobo", Asset$new(res, self) }, + #' @description + #' Get the submissions for a survey. + #' @param id character. ID of the survey asset within the Kobo API. + #' @return tibble. submissions as a tibble. if no submissions were made yet, the tibble will have no columns. + get_submissions = function(id) { + asset <- self$get_asset(id) + asset$get_submissions() + }, #' High-level POST request to clone an asset. `assets` endpoint #' (due to default to `v2`, no further specification is needed). #' @param clone_from character. UID of the asset to be cloned. diff --git a/man/Asset.Rd b/man/Asset.Rd index aaf5136..3ce0ec8 100644 --- a/man/Asset.Rd +++ b/man/Asset.Rd @@ -36,6 +36,7 @@ gives access to the submissions to the survey.} \subsection{Public methods}{ \itemize{ \item \href{#method-new}{\code{Asset$new()}} +\item \href{#method-get_submissions}{\code{Asset$get_submissions()}} \item \href{#method-to_list}{\code{Asset$to_list()}} \item \href{#method-clone}{\code{Asset$clone()}} } @@ -54,12 +55,26 @@ gives access to the submissions to the survey.} \item{\code{asset_list}}{list. a list with the asset data, such as obtained through a call to assets/{id}} \item{\code{kobo}}{Kobo instance. Instance of class Kobo used internally to make requests to the API. -to_list} +get_submissions} } \if{html}{\out{}} } } \if{html}{\out{
}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-get_submissions}{}}} +\subsection{Method \code{get_submissions()}}{ +get submissions to a survey/form +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{Asset$get_submissions()}\if{html}{\out{
}} +} + +\subsection{Returns}{ +tibble. submissions as a tibble. if no submissions were made yet, the tibble will have no columns. +to_list +} +} +\if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-to_list}{}}} \subsection{Method \code{to_list()}}{ diff --git a/man/Kobo.Rd b/man/Kobo.Rd index 160e45d..2e57c9b 100644 --- a/man/Kobo.Rd +++ b/man/Kobo.Rd @@ -26,6 +26,7 @@ interactions with the various endpoints. \item \href{#method-post}{\code{Kobo$post()}} \item \href{#method-get_assets}{\code{Kobo$get_assets()}} \item \href{#method-get_asset}{\code{Kobo$get_asset()}} +\item \href{#method-get_submissions}{\code{Kobo$get_submissions()}} \item \href{#method-clone_asset}{\code{Kobo$clone_asset()}} \item \href{#method-deploy_asset}{\code{Kobo$deploy_asset()}} \item \href{#method-import_xls_form}{\code{Kobo$import_xls_form()}} @@ -154,6 +155,26 @@ Get an asset given its id. } \subsection{Returns}{ Asset. object of class \link{Asset} +} +} +\if{html}{\out{
}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-get_submissions}{}}} +\subsection{Method \code{get_submissions()}}{ +Get the submissions for a survey. +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{Kobo$get_submissions(id)}\if{html}{\out{
}} +} + +\subsection{Arguments}{ +\if{html}{\out{
}} +\describe{ +\item{\code{id}}{character. ID of the survey asset within the Kobo API.} +} +\if{html}{\out{
}} +} +\subsection{Returns}{ +tibble. submissions as a tibble. if no submissions were made yet, the tibble will have no columns. High-level POST request to clone an asset. \code{assets} endpoint (due to default to \code{v2}, no further specification is needed). } diff --git a/tests/fixtures/kobo-asset-submissions-asset-nosubs.yml b/tests/fixtures/kobo-asset-submissions-asset-nosubs.yml new file mode 100644 index 0000000..a1c1faf --- /dev/null +++ b/tests/fixtures/kobo-asset-submissions-asset-nosubs.yml @@ -0,0 +1,58 @@ +http_interactions: +- request: + method: get + uri: https://kobo.correlaid.org/api/v2/assets/ajzghKK6NELaixPQqsm49e/?format=json + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3 crul/1.1.0 + Accept-Encoding: gzip, deflate + Authorization: fakebearertoken + Accept: application/json + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + server: nginx + date: Thu, 22 Jul 2021 06:59:36 GMT + content-type: application/json + content-length: '8858' + connection: keep-alive + vary: Accept, Accept-Language, Cookie, Origin + allow: GET, PUT, PATCH, DELETE, HEAD, OPTIONS + x-kobonaut: api_user + x-frame-options: SAMEORIGIN + content-language: en + body: + encoding: UTF-8 + file: no + string: '{"url":"https://kobo.correlaid.org/api/v2/assets/ajzghKK6NELaixPQqsm49e/?format=json","owner":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","owner__username":"api_user","parent":null,"ancestors":null,"settings":{"sector":{"label":"Other","value":"Other"},"country":{"label":"Germany","value":"DEU"},"description":"","share-metadata":false},"asset_type":"survey","date_created":"2021-04-28T19:52:13.144873Z","summary":{"geo":false,"labels":["Your + name","Your age","Your favourite dog","Your favourite cat"],"columns":["type","label","required","select_from_list_name"],"languages":[null],"row_count":4,"default_translation":null},"date_modified":"2021-05-13T16:59:25.147719Z","version_id":"v39addKozAjjUTpsr8eYRm","version__content_hash":"b8dc756504b553638938d1568b6bbeee8b9a9f46","version_count":3,"has_deployment":true,"deployed_version_id":"v39addKozAjjUTpsr8eYRm","deployed_versions":{"count":1,"next":null,"previous":null,"results":[{"uid":"v39addKozAjjUTpsr8eYRm","url":"https://kobo.correlaid.org/api/v2/assets/ajzghKK6NELaixPQqsm49e/versions/v39addKozAjjUTpsr8eYRm/?format=json","content_hash":"b8dc756504b553638938d1568b6bbeee8b9a9f46","date_deployed":"2021-04-28T19:59:26.497551Z","date_modified":"2021-04-28 + 19:59:26.497551+00:00"}]},"deployment__identifier":"https://kc.correlaid.org/api_user/forms/ajzghKK6NELaixPQqsm49e","deployment__links":{"url":"https://ee.correlaid.org/uoePjpY3","single_url":"https://ee.correlaid.org/single/uoePjpY3","single_once_url":"https://ee.correlaid.org/single/da1c7bd10ccfa34ff010975bbde150d3","offline_url":"https://ee.correlaid.org/x/uoePjpY3","preview_url":"https://ee.correlaid.org/preview/uoePjpY3","iframe_url":"https://ee.correlaid.org/i/uoePjpY3","single_iframe_url":"https://ee.correlaid.org/single/i/uoePjpY3","single_once_iframe_url":"https://ee.correlaid.org/single/i/da1c7bd10ccfa34ff010975bbde150d3"},"deployment__active":true,"deployment__data_download_links":{"xls_legacy":"https://kc.correlaid.org/api_user/exports/ajzghKK6NELaixPQqsm49e/xls/","csv_legacy":"https://kc.correlaid.org/api_user/exports/ajzghKK6NELaixPQqsm49e/csv/","zip_legacy":"https://kc.correlaid.org/api_user/exports/ajzghKK6NELaixPQqsm49e/zip/","kml_legacy":"https://kc.correlaid.org/api_user/exports/ajzghKK6NELaixPQqsm49e/kml/","xls":"https://kc.correlaid.org/api_user/reports/ajzghKK6NELaixPQqsm49e/export.xlsx","csv":"https://kc.correlaid.org/api_user/reports/ajzghKK6NELaixPQqsm49e/export.csv"},"deployment__submission_count":0,"report_styles":{"default":{},"specified":{"end":{},"start":{},"ac8gb94":{},"jr99x27":{},"lu5kb37":{},"md7af89":{}},"kuid_names":{"end":"I1zbdtzEU","start":"tjGTOvJCj","ac8gb94":"ac8gb94","jr99x27":"jr99x27","lu5kb37":"lu5kb37","md7af89":"md7af89"}},"report_custom":{},"map_styles":{},"map_custom":{},"content":{"schema":"1","survey":[{"name":"start","type":"start","$kuid":"tjGTOvJCj","$autoname":"start"},{"name":"end","type":"end","$kuid":"I1zbdtzEU","$autoname":"end"},{"type":"text","$kuid":"ac8gb94","label":["Your + name"],"required":false,"$autoname":"Your_name"},{"type":"integer","$kuid":"lu5kb37","label":["Your + age"],"required":false,"$autoname":"Your_age"},{"type":"select_one","$kuid":"md7af89","label":["Your + favourite dog"],"required":false,"$autoname":"Your_favourite_dog","select_from_list_name":"hj7lp47"},{"type":"select_one","$kuid":"jr99x27","label":["Your + favourite cat"],"required":false,"$autoname":"Your_favourite_cat","select_from_list_name":"yc0zz42"}],"choices":[{"name":"dog1","$kuid":"LTUqS0aA6","label":["dog1"],"list_name":"hj7lp47","$autovalue":"dog1"},{"name":"dog2","$kuid":"HhFvl0kXl","label":["dog2"],"list_name":"hj7lp47","$autovalue":"dog2"},{"name":"dog3","$kuid":"MY8ieK5pa","label":["dog3"],"list_name":"hj7lp47","$autovalue":"dog3"},{"name":"cat1","$kuid":"riLSfNtfI","label":["cat1"],"list_name":"yc0zz42","$autovalue":"cat1"},{"name":"cat2","$kuid":"YrFlPR7Fi","label":["cat2"],"list_name":"yc0zz42","$autovalue":"cat2"},{"name":"cat3","$kuid":"zLQSzCbW3","label":["cat3"],"list_name":"yc0zz42","$autovalue":"cat3"},{"name":"cat4","$kuid":"wAkKQqZLV","label":["cat4"],"list_name":"yc0zz42","$autovalue":"cat4"}],"settings":{},"translated":["label"],"translations":[null]},"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/ajzghKK6NELaixPQqsm49e/?format=json.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/ajzghKK6NELaixPQqsm49e/?format=json.xml"}],"embeds":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/ajzghKK6NELaixPQqsm49e/xls/?format=json"},{"format":"xform","url":"https://kobo.correlaid.org/api/v2/assets/ajzghKK6NELaixPQqsm49e/xform/?format=json"}],"koboform_link":"https://kobo.correlaid.org/api/v2/assets/ajzghKK6NELaixPQqsm49e/koboform/?format=json","xform_link":"https://kobo.correlaid.org/api/v2/assets/ajzghKK6NELaixPQqsm49e/xform/?format=json","hooks_link":"https://kobo.correlaid.org/api/v2/assets/ajzghKK6NELaixPQqsm49e/hooks/?format=json","tag_string":"","uid":"ajzghKK6NELaixPQqsm49e","kind":"asset","xls_link":"https://kobo.correlaid.org/api/v2/assets/ajzghKK6NELaixPQqsm49e/xls/?format=json","name":"test_built_from_scratch","assignable_permissions":[{"url":"https://kobo.correlaid.org/api/v2/permissions/view_asset/?format=json","label":"View + form"},{"url":"https://kobo.correlaid.org/api/v2/permissions/change_asset/?format=json","label":"Edit + form"},{"url":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/?format=json","label":"Manage + project"},{"url":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/?format=json","label":"Add + submissions"},{"url":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/?format=json","label":"View + submissions"},{"url":"https://kobo.correlaid.org/api/v2/permissions/partial_submissions/?format=json","label":"View + submissions only from specific users"},{"url":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/?format=json","label":"Edit + submissions"},{"url":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/?format=json","label":"Delete + submissions"},{"url":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/?format=json","label":"Validate + submissions"}],"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/ajzghKK6NELaixPQqsm49e/permission-assignments/pNh4FweRqmRpTGz5r49QsY/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/?format=json","label":"Add + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/ajzghKK6NELaixPQqsm49e/permission-assignments/pHFo8upcnYmy9rnhFEQ3gf/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/?format=json","label":"Edit + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/ajzghKK6NELaixPQqsm49e/permission-assignments/pZgG8gtvSRUJFD9PCx8KVu/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/?format=json","label":"Edit + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/ajzghKK6NELaixPQqsm49e/permission-assignments/ph6z7ox7XG79Mv6ApCpHjW/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/?format=json","label":"Delete + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/ajzghKK6NELaixPQqsm49e/permission-assignments/pFefHXsa5tMSx5HdufFUyj/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/?format=json","label":"Manage + project"},{"url":"https://kobo.correlaid.org/api/v2/assets/ajzghKK6NELaixPQqsm49e/permission-assignments/pdG8GpXaRpHqPpZrcoNfLJ/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/?format=json","label":"Validate + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/ajzghKK6NELaixPQqsm49e/permission-assignments/p8MCoXV4zWS9Ww7AjTnrNW/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/?format=json","label":"View + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/ajzghKK6NELaixPQqsm49e/permission-assignments/p8piyLxXaq94EeQX3FjNTD/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/?format=json","label":"View + submissions"}],"data":"https://kobo.correlaid.org/api/v2/assets/ajzghKK6NELaixPQqsm49e/data/?format=json"}' + recorded_at: 2021-07-22 06:59:36 GMT + recorded_with: vcr/0.6.0, webmockr/0.8.0 diff --git a/tests/fixtures/kobo-asset-submissions-asset.yml b/tests/fixtures/kobo-asset-submissions-asset.yml new file mode 100644 index 0000000..665d8e2 --- /dev/null +++ b/tests/fixtures/kobo-asset-submissions-asset.yml @@ -0,0 +1,109 @@ +http_interactions: +- request: + method: get + uri: https://kobo.correlaid.org/api/v2/assets/aRo4wg5utWT7dwdnQQEAE7/?format=json + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3 crul/1.1.0 + Accept-Encoding: gzip, deflate + Authorization: fakebearertoken + Accept: application/json + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + server: nginx + date: Thu, 22 Jul 2021 06:35:33 GMT + content-type: application/json + content-length: '16069' + connection: keep-alive + vary: Accept, Accept-Language, Cookie, Origin + allow: GET, PUT, PATCH, DELETE, HEAD, OPTIONS + x-kobonaut: api_user + x-frame-options: SAMEORIGIN + content-language: en + body: + encoding: UTF-8 + file: no + string: '{"url":"https://kobo.correlaid.org/api/v2/assets/aRo4wg5utWT7dwdnQQEAE7/?format=json","owner":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","owner__username":"api_user","parent":null,"ancestors":null,"settings":{"sector":{"label":"Other","value":"Other"},"country":{"label":"Germany","value":"DEU"},"description":"Yet + another testing form for package development","share-metadata":false},"asset_type":"survey","date_created":"2021-05-02T12:12:11.859577Z","summary":{"geo":true,"labels":["Please + say, for each of the following, how important it is in your life.","Work","Family","Friends + and acquaintances","Leisure time"],"columns":["name","type","label","required","kobo--score-choices","select_from_list_name","hint","parameters"],"languages":[null],"row_count":21,"default_translation":null},"date_modified":"2021-05-02T12:41:54.037442Z","version_id":"vGEYKrPXZhge2uYk4toEKs","version__content_hash":"9487faea38af0b94b0f165fe6a78b0f4fc8e1aa3","version_count":6,"has_deployment":true,"deployed_version_id":"vGEYKrPXZhge2uYk4toEKs","deployed_versions":{"count":2,"next":null,"previous":null,"results":[{"uid":"vGEYKrPXZhge2uYk4toEKs","url":"https://kobo.correlaid.org/api/v2/assets/aRo4wg5utWT7dwdnQQEAE7/versions/vGEYKrPXZhge2uYk4toEKs/?format=json","content_hash":"9487faea38af0b94b0f165fe6a78b0f4fc8e1aa3","date_deployed":"2021-05-02T12:41:36.532642Z","date_modified":"2021-05-02 + 12:41:36.532642+00:00"},{"uid":"vhWtJRry8cSn5PBEda3oDy","url":"https://kobo.correlaid.org/api/v2/assets/aRo4wg5utWT7dwdnQQEAE7/versions/vhWtJRry8cSn5PBEda3oDy/?format=json","content_hash":"561e3789013d5b0e7ac8939b7ce31a824067aec0","date_deployed":"2021-05-02T12:33:25.779708Z","date_modified":"2021-05-02 + 12:33:25.779708+00:00"}]},"deployment__identifier":"https://kc.correlaid.org/api_user/forms/aRo4wg5utWT7dwdnQQEAE7","deployment__links":{"url":"https://ee.correlaid.org/y6PKgSLC","single_url":"https://ee.correlaid.org/single/y6PKgSLC","single_once_url":"https://ee.correlaid.org/single/71008a4dad5f8c5541759ddb818a5760","offline_url":"https://ee.correlaid.org/x/y6PKgSLC","preview_url":"https://ee.correlaid.org/preview/y6PKgSLC","iframe_url":"https://ee.correlaid.org/i/y6PKgSLC","single_iframe_url":"https://ee.correlaid.org/single/i/y6PKgSLC","single_once_iframe_url":"https://ee.correlaid.org/single/i/71008a4dad5f8c5541759ddb818a5760"},"deployment__active":true,"deployment__data_download_links":{"xls_legacy":"https://kc.correlaid.org/api_user/exports/aRo4wg5utWT7dwdnQQEAE7/xls/","csv_legacy":"https://kc.correlaid.org/api_user/exports/aRo4wg5utWT7dwdnQQEAE7/csv/","zip_legacy":"https://kc.correlaid.org/api_user/exports/aRo4wg5utWT7dwdnQQEAE7/zip/","kml_legacy":"https://kc.correlaid.org/api_user/exports/aRo4wg5utWT7dwdnQQEAE7/kml/","xls":"https://kc.correlaid.org/api_user/reports/aRo4wg5utWT7dwdnQQEAE7/export.xlsx","csv":"https://kc.correlaid.org/api_user/reports/aRo4wg5utWT7dwdnQQEAE7/export.csv"},"deployment__submission_count":4,"report_styles":{"default":{},"specified":{"Q1":{},"end":{},"start":{},"ai6cp87":{},"dq0sb99":{},"fd0cf28":{},"gt1yj76":{},"ip2pc55":{},"ke1im15":{},"kr9ur31":{},"ks56k46":{},"lr5sh35":{},"mk6mc53":{},"ob3me97":{},"or5gr65":{},"qy1kf43":{},"tb2px63":{},"tf9rd50":{},"tt3bk39":{},"uf68v87":{},"va0xx85":{},"wh7ei00":{},"xg6fl64":{},"yj6dy23":{},"/dr9fq65":{},"/tb2px63":{}},"kuid_names":{"Q1":"dr9fq65","end":"m28GgoH7K","start":"dCWJ0qKC4","ai6cp87":"ai6cp87","dq0sb99":"dq0sb99","fd0cf28":"fd0cf28","gt1yj76":"gt1yj76","ip2pc55":"ip2pc55","ke1im15":"ke1im15","kr9ur31":"kr9ur31","ks56k46":"ks56k46","lr5sh35":"lr5sh35","mk6mc53":"mk6mc53","ob3me97":"ob3me97","or5gr65":"or5gr65","qy1kf43":"qy1kf43","tb2px63":"tb2px63","tf9rd50":"tf9rd50","tt3bk39":"tt3bk39","uf68v87":"uf68v87","va0xx85":"va0xx85","wh7ei00":"wh7ei00","xg6fl64":"xg6fl64","yj6dy23":"yj6dy23","/dr9fq65":"/dr9fq65","/tb2px63":"/tb2px63"}},"report_custom":{},"map_styles":{},"map_custom":{},"content":{"schema":"1","survey":[{"name":"start","type":"start","$kuid":"dCWJ0qKC4","$autoname":"start"},{"name":"end","type":"end","$kuid":"m28GgoH7K","$autoname":"end"},{"name":"Q1","type":"begin_score","$kuid":"dr9fq65","label":["Please + say, for each of the following, how important it is in your life."],"required":false,"$autoname":"Q1","kobo--score-choices":"ys4jh05"},{"type":"score__row","$kuid":"kr9ur31","label":["Work"],"required":false,"$autoname":"Work"},{"type":"score__row","$kuid":"tf9rd50","label":["Family"],"required":false,"$autoname":"Family"},{"type":"score__row","$kuid":"mk6mc53","label":["Friends + and acquaintances"],"required":false,"$autoname":"Friends_and_acquaintances"},{"type":"score__row","$kuid":"lr5sh35","label":["Leisure + time"],"required":false,"$autoname":"Leisure_time"},{"type":"score__row","$kuid":"ob3me97","label":["Politics"],"required":false,"$autoname":"Politics"},{"type":"score__row","$kuid":"ai6cp87","label":["Religion"],"required":false,"$autoname":"Religion"},{"type":"end_score","$kuid":"/dr9fq65"},{"type":"select_one","$kuid":"or5gr65","label":["Taking + all things together, would you say you are:"],"required":true,"$autoname":"Taking_all_things_to_ould_you_say_you_are","select_from_list_name":"rz4sr22"},{"type":"select_one","$kuid":"uf68v87","label":["All + in all, how would you describe your state of health these days? would you + say it is"],"required":false,"$autoname":"All_in_all_how_woul_would_you_say_it_is","select_from_list_name":"ve2ix92"},{"type":"select_one","$kuid":"ks56k46","label":["Did + you do voluntary work in the last 6 months?"],"required":false,"$autoname":"Did_you_do_voluntary_in_the_last_6_months","select_from_list_name":"am8gn27"},{"type":"select_one","$kuid":"va0xx85","label":["Generally + speaking, would you say that most people can be trusted or that you can''t + be too careful in dealing with people?"],"required":false,"$autoname":"Generally_speaking_dealing_with_people","select_from_list_name":"zl1iq13"},{"type":"begin_score","$kuid":"tb2px63","label":["I + would like to ask you how much you trust people from various groups. Could + you tell me for each whether you trust people from this group completely, + somewhat, not very much or not at all?"],"required":false,"$autoname":"I_would_like_to_ask_y_much_or_not_at_all","kobo--score-choices":"uy4om18"},{"type":"score__row","$kuid":"xg6fl64","label":["Your + family"],"required":false,"$autoname":"Your_family"},{"type":"score__row","$kuid":"yj6dy23","label":["People + in your neighborhood"],"required":false,"$autoname":"People_in_your_neighborhood"},{"type":"score__row","$kuid":"ke1im15","label":["People + you know personally"],"required":false,"$autoname":"People_you_know_personally"},{"type":"score__row","$kuid":"wh7ei00","label":["People + you meet for the first time"],"required":false,"$autoname":"People_you_meet_for_the_first_time"},{"type":"score__row","$kuid":"qy1kf43","label":["People + of another religion"],"required":false,"$autoname":"People_of_another_religion"},{"type":"score__row","$kuid":"ip2pc55","label":["People + of another nationality"],"required":false,"$autoname":"People_of_another_nationality"},{"type":"end_score","$kuid":"/tb2px63"},{"hint":["1 + = \"None at all\", 10 = \"a great deal\""],"type":"range","$kuid":"gt1yj76","label":["Some + people feel they have completely free choice and control over their lives, + and other people feel that what they do has no real effect on what happens + to them. Please use the scale to indicate how much freedom of choice and control + you feel you have over the way your life turns out?"],"required":false,"$autoname":"Some_people_feel_the_your_life_turns_out","parameters":"start=1;end=10;step=1"},{"type":"geopoint","$kuid":"fd0cf28","label":["Please + indicate where on the map is \"Hamburg\""],"required":false,"$autoname":"Please_indicate_wher_the_map_is_Hamburg"},{"type":"file","$kuid":"dq0sb99","label":["Upload + an arbitrary file..."],"required":false,"$autoname":"Upload_an_arbitrary_file"}],"choices":[{"name":"1","$kuid":"NPp8OR3md","label":["Very + important"],"list_name":"ys4jh05","$autovalue":"1"},{"name":"2","$kuid":"LnI83gRXp","label":["quite + important"],"list_name":"ys4jh05","$autovalue":"2"},{"name":"3","$kuid":"u6ot3527d","label":["not + important"],"list_name":"ys4jh05","$autovalue":"3"},{"name":"4","$kuid":"gRoco4Pev","label":["not + at all important"],"list_name":"ys4jh05","$autovalue":"4"},{"name":"1","$kuid":"4oLFnV3ws","label":["Very + happy"],"list_name":"rz4sr22","$autovalue":"1"},{"name":"2","$kuid":"PAmAPsyFM","label":["Quite + happy"],"list_name":"rz4sr22","$autovalue":"2"},{"name":"3","$kuid":"G8ZTNvrsz","label":["Not + very happy"],"list_name":"rz4sr22","$autovalue":"3"},{"name":"4","$kuid":"p2PSwo7yN","label":["Not + at all happy"],"list_name":"rz4sr22","$autovalue":"4"},{"name":"8","$kuid":"ZUOsXVxA0","label":["Don''t + know"],"list_name":"rz4sr22","$autovalue":"8"},{"name":"9","$kuid":"gTT51LFcs","label":["No + answer"],"list_name":"rz4sr22","$autovalue":"9"},{"name":"1","$kuid":"FSr5OYH5Z","label":["Very + good"],"list_name":"ve2ix92","$autovalue":"1"},{"name":"2","$kuid":"ePIcIfywO","label":["Good"],"list_name":"ve2ix92","$autovalue":"2"},{"name":"3","$kuid":"97eDDuzaO","label":["Fair"],"list_name":"ve2ix92","$autovalue":"3"},{"name":"4","$kuid":"BIcgTk7PF","label":["Poor"],"list_name":"ve2ix92","$autovalue":"4"},{"name":"5","$kuid":"TI1TEmjKI","label":["Very + poor"],"list_name":"ve2ix92","$autovalue":"5"},{"name":"8","$kuid":"UPQRPVpZN","label":["Don''t + know"],"list_name":"ve2ix92","$autovalue":"8"},{"name":"9","$kuid":"696pTgkEM","label":["No + answer"],"list_name":"ve2ix92","$autovalue":"9"},{"name":"1","$kuid":"rhWu34seb","label":["Yes"],"list_name":"am8gn27","$autovalue":"1"},{"name":"2","$kuid":"eNbB8K507","label":["No"],"list_name":"am8gn27","$autovalue":"2"},{"name":"8","$kuid":"kg9naDqjC","label":["Don''t + know"],"list_name":"am8gn27","$autovalue":"8"},{"name":"9","$kuid":"7AFKIlHDu","label":["No + answer"],"list_name":"am8gn27","$autovalue":"9"},{"name":"1","$kuid":"IKCXDYXCk","label":["Most + people can be trusted"],"list_name":"zl1iq13","$autovalue":"1"},{"name":"2","$kuid":"Jvg4jninb","label":["Can''t + be too careful"],"list_name":"zl1iq13","$autovalue":"2"},{"name":"8","$kuid":"VSWHtAmIg","label":["Don''t + know"],"list_name":"zl1iq13","$autovalue":"8"},{"name":"9","$kuid":"Utj6uO20z","label":["No + answer"],"list_name":"zl1iq13","$autovalue":"9"},{"name":"1","$kuid":"UrdKQbo8g","label":["Trust + completely"],"list_name":"uy4om18","$autovalue":"1"},{"name":"2","$kuid":"mCJO9kEu8","label":["Trust + somewhat"],"list_name":"uy4om18","$autovalue":"2"},{"name":"3","$kuid":"UlmwVnpew","label":["Do + not trust very much"],"list_name":"uy4om18","$autovalue":"3"},{"name":"4","$kuid":"cMmSDIUwH","label":["Do  + not trust at all"],"list_name":"uy4om18","$autovalue":"4"}],"settings":{},"translated":["hint","label"],"translations":[null]},"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/aRo4wg5utWT7dwdnQQEAE7/?format=json.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/aRo4wg5utWT7dwdnQQEAE7/?format=json.xml"}],"embeds":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/aRo4wg5utWT7dwdnQQEAE7/xls/?format=json"},{"format":"xform","url":"https://kobo.correlaid.org/api/v2/assets/aRo4wg5utWT7dwdnQQEAE7/xform/?format=json"}],"koboform_link":"https://kobo.correlaid.org/api/v2/assets/aRo4wg5utWT7dwdnQQEAE7/koboform/?format=json","xform_link":"https://kobo.correlaid.org/api/v2/assets/aRo4wg5utWT7dwdnQQEAE7/xform/?format=json","hooks_link":"https://kobo.correlaid.org/api/v2/assets/aRo4wg5utWT7dwdnQQEAE7/hooks/?format=json","tag_string":"","uid":"aRo4wg5utWT7dwdnQQEAE7","kind":"asset","xls_link":"https://kobo.correlaid.org/api/v2/assets/aRo4wg5utWT7dwdnQQEAE7/xls/?format=json","name":"kbtbr + Testing Survey","assignable_permissions":[{"url":"https://kobo.correlaid.org/api/v2/permissions/view_asset/?format=json","label":"View + form"},{"url":"https://kobo.correlaid.org/api/v2/permissions/change_asset/?format=json","label":"Edit + form"},{"url":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/?format=json","label":"Manage + project"},{"url":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/?format=json","label":"Add + submissions"},{"url":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/?format=json","label":"View + submissions"},{"url":"https://kobo.correlaid.org/api/v2/permissions/partial_submissions/?format=json","label":"View + submissions only from specific users"},{"url":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/?format=json","label":"Edit + submissions"},{"url":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/?format=json","label":"Delete + submissions"},{"url":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/?format=json","label":"Validate + submissions"}],"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/aRo4wg5utWT7dwdnQQEAE7/permission-assignments/pGnVn25TznLDuRD2cXk9EM/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/?format=json","label":"Add + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aRo4wg5utWT7dwdnQQEAE7/permission-assignments/pVkNG7R8p8DB9QGUChEAnf/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/?format=json","label":"Edit + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aRo4wg5utWT7dwdnQQEAE7/permission-assignments/pKXPkdHGUD9mGRMiWYf68y/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/?format=json","label":"Edit + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aRo4wg5utWT7dwdnQQEAE7/permission-assignments/pTXkUT6tGpJvfzBvREEWcF/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/?format=json","label":"Delete + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aRo4wg5utWT7dwdnQQEAE7/permission-assignments/pMfchFkNuYbgcRqqmShWpr/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/?format=json","label":"Manage + project"},{"url":"https://kobo.correlaid.org/api/v2/assets/aRo4wg5utWT7dwdnQQEAE7/permission-assignments/psZMVKDEfee7uPFTfo7HCM/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/?format=json","label":"Validate + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aRo4wg5utWT7dwdnQQEAE7/permission-assignments/pgYtnZ956vAmmXimzqBWQL/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/?format=json","label":"View + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aRo4wg5utWT7dwdnQQEAE7/permission-assignments/pPJePYMC3gnRxeDN9hWkGr/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/?format=json","label":"View + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aRo4wg5utWT7dwdnQQEAE7/permission-assignments/pfWCMzdRisSwRiUzzdtLsR/?format=json","user":"https://kobo.correlaid.org/api/v2/users/frie_preu/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/?format=json","label":"Edit + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aRo4wg5utWT7dwdnQQEAE7/permission-assignments/pczJm4pANtqBCqyuMjJ2VM/?format=json","user":"https://kobo.correlaid.org/api/v2/users/frie_preu/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/?format=json","label":"View + form"}],"data":"https://kobo.correlaid.org/api/v2/assets/aRo4wg5utWT7dwdnQQEAE7/data/?format=json"}' + recorded_at: 2021-07-22 06:35:33 GMT + recorded_with: vcr/0.6.0, webmockr/0.8.0 diff --git a/tests/fixtures/kobo-asset-submissions-data-nosubs.yml b/tests/fixtures/kobo-asset-submissions-data-nosubs.yml new file mode 100644 index 0000000..6ae989a --- /dev/null +++ b/tests/fixtures/kobo-asset-submissions-data-nosubs.yml @@ -0,0 +1,35 @@ +http_interactions: +- request: + method: get + uri: https://kobo.correlaid.org/api/v2/assets/ajzghKK6NELaixPQqsm49e/data/?format=json + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3 crul/1.1.0 + Accept-Encoding: gzip, deflate + Authorization: fakebearertoken + Accept: application/json + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + server: nginx + date: Thu, 22 Jul 2021 06:59:36 GMT + content-type: application/json + content-length: '52' + connection: keep-alive + vary: Accept, Accept-Language, Cookie, Origin + allow: GET, HEAD, OPTIONS + x-kobonaut: api_user + x-frame-options: SAMEORIGIN + content-language: en + body: + encoding: UTF-8 + file: no + string: '{"count":0,"next":null,"previous":null,"results":[]}' + recorded_at: 2021-07-22 06:59:36 GMT + recorded_with: vcr/0.6.0, webmockr/0.8.0 diff --git a/tests/fixtures/kobo-asset-submissions-data.yml b/tests/fixtures/kobo-asset-submissions-data.yml new file mode 100644 index 0000000..ee8947e --- /dev/null +++ b/tests/fixtures/kobo-asset-submissions-data.yml @@ -0,0 +1,37 @@ +http_interactions: +- request: + method: get + uri: https://kobo.correlaid.org/api/v2/assets/aRo4wg5utWT7dwdnQQEAE7/data/?format=json + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3 crul/1.1.0 + Accept-Encoding: gzip, deflate + Authorization: fakebearertoken + Accept: application/json + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + server: nginx + date: Thu, 22 Jul 2021 06:42:41 GMT + content-type: application/json + content-length: '6510' + connection: keep-alive + vary: Accept, Accept-Language, Cookie, Origin + allow: GET, HEAD, OPTIONS + x-kobonaut: api_user + x-frame-options: SAMEORIGIN + content-language: en + body: + encoding: UTF-8 + file: no + string: '{"count":4,"next":null,"previous":null,"results":[{"_id":104,"_notes":[],"Q1/Leisure_time":"3","Taking_all_things_to_ould_you_say_you_are":"2","I_would_like_to_ask_y_much_or_not_at_all/People_you_know_personally":"2","_validation_status":{},"_uuid":"aca8c44f-6327-4024-9187-c9e10151c940","_tags":[],"I_would_like_to_ask_y_much_or_not_at_all/People_you_meet_for_the_first_time":"2","Generally_speaking_dealing_with_people":"1","Did_you_do_voluntary_in_the_last_6_months":"2","_xform_id_string":"aRo4wg5utWT7dwdnQQEAE7","I_would_like_to_ask_y_much_or_not_at_all/People_of_another_nationality":"2","I_would_like_to_ask_y_much_or_not_at_all/Your_family":"2","meta/instanceID":"uuid:aca8c44f-6327-4024-9187-c9e10151c940","_status":"submitted_via_web","I_would_like_to_ask_y_much_or_not_at_all/People_in_your_neighborhood":"2","formhub/uuid":"1f37921296654b91b8cc11e152956764","end":"2021-05-02T14:35:35.092+02:00","Q1/Friends_and_acquaintances":"1","_submission_time":"2021-05-02T12:35:45","I_would_like_to_ask_y_much_or_not_at_all/People_of_another_religion":"2","Q1/Politics":"3","_attachments":[],"Q1/Family":"3","start":"2021-05-02T14:34:33.302+02:00","_submitted_by":null,"_geolocation":[null,null],"Q1/Work":"2","All_in_all_how_woul_would_you_say_it_is":"4","__version__":"vhWtJRry8cSn5PBEda3oDy","Some_people_feel_the_your_life_turns_out":"6","Q1/Religion":"2"},{"_id":105,"_notes":[],"Q1/Leisure_time":"4","Taking_all_things_to_ould_you_say_you_are":"1","I_would_like_to_ask_y_much_or_not_at_all/People_you_know_personally":"3","_validation_status":{},"_uuid":"7ab504ec-1a1e-49e5-960c-39b77f5e00c5","_tags":[],"I_would_like_to_ask_y_much_or_not_at_all/People_you_meet_for_the_first_time":"3","Generally_speaking_dealing_with_people":"1","Did_you_do_voluntary_in_the_last_6_months":"2","_xform_id_string":"aRo4wg5utWT7dwdnQQEAE7","I_would_like_to_ask_y_much_or_not_at_all/People_of_another_nationality":"3","I_would_like_to_ask_y_much_or_not_at_all/Your_family":"2","meta/instanceID":"uuid:7ab504ec-1a1e-49e5-960c-39b77f5e00c5","_status":"submitted_via_web","I_would_like_to_ask_y_much_or_not_at_all/People_in_your_neighborhood":"1","formhub/uuid":"1f37921296654b91b8cc11e152956764","end":"2021-05-02T14:36:36.740+02:00","Q1/Friends_and_acquaintances":"3","_submission_time":"2021-05-02T12:36:47","I_would_like_to_ask_y_much_or_not_at_all/People_of_another_religion":"2","Q1/Politics":"3","_attachments":[],"Q1/Family":"2","start":"2021-05-02T14:36:11.481+02:00","_submitted_by":null,"_geolocation":[null,null],"Q1/Work":"1","All_in_all_how_woul_would_you_say_it_is":"8","__version__":"vhWtJRry8cSn5PBEda3oDy","Some_people_feel_the_your_life_turns_out":"3","Q1/Religion":"2"},{"_id":106,"_notes":[],"Q1/Leisure_time":"1","Upload_an_arbitrary_file":"E0QLjvNUYAAe-s_-14_44_17.jpeg","Taking_all_things_to_ould_you_say_you_are":"2","I_would_like_to_ask_y_much_or_not_at_all/People_you_know_personally":"1","_validation_status":{},"_uuid":"3b98cf99-b651-422b-ace9-c242ca8f9717","_tags":[],"I_would_like_to_ask_y_much_or_not_at_all/People_you_meet_for_the_first_time":"3","Generally_speaking_dealing_with_people":"8","Did_you_do_voluntary_in_the_last_6_months":"9","_xform_id_string":"aRo4wg5utWT7dwdnQQEAE7","I_would_like_to_ask_y_much_or_not_at_all/People_of_another_nationality":"2","I_would_like_to_ask_y_much_or_not_at_all/Your_family":"1","meta/instanceID":"uuid:3b98cf99-b651-422b-ace9-c242ca8f9717","_status":"submitted_via_web","I_would_like_to_ask_y_much_or_not_at_all/People_in_your_neighborhood":"2","formhub/uuid":"1f37921296654b91b8cc11e152956764","end":"2021-05-02T14:44:30.817+02:00","Q1/Friends_and_acquaintances":"2","Please_indicate_wher_the_map_is_Hamburg":"53.555892 + 9.948884 0 0","_submission_time":"2021-05-02T12:44:41","I_would_like_to_ask_y_much_or_not_at_all/People_of_another_religion":"2","Q1/Politics":"2","_attachments":[{"mimetype":"image/jpeg","download_small_url":"https://kc.correlaid.org/media/small?media_file=api_user%2Fattachments%2F1f37921296654b91b8cc11e152956764%2F3b98cf99-b651-422b-ace9-c242ca8f9717%2FE0QLjvNUYAAe-s_-14_44_17.jpeg","download_large_url":"https://kc.correlaid.org/media/large?media_file=api_user%2Fattachments%2F1f37921296654b91b8cc11e152956764%2F3b98cf99-b651-422b-ace9-c242ca8f9717%2FE0QLjvNUYAAe-s_-14_44_17.jpeg","download_url":"https://kc.correlaid.org/media/original?media_file=api_user%2Fattachments%2F1f37921296654b91b8cc11e152956764%2F3b98cf99-b651-422b-ace9-c242ca8f9717%2FE0QLjvNUYAAe-s_-14_44_17.jpeg","filename":"api_user/attachments/1f37921296654b91b8cc11e152956764/3b98cf99-b651-422b-ace9-c242ca8f9717/E0QLjvNUYAAe-s_-14_44_17.jpeg","instance":106,"download_medium_url":"https://kc.correlaid.org/media/medium?media_file=api_user%2Fattachments%2F1f37921296654b91b8cc11e152956764%2F3b98cf99-b651-422b-ace9-c242ca8f9717%2FE0QLjvNUYAAe-s_-14_44_17.jpeg","id":1,"xform":18}],"Q1/Family":"3","start":"2021-05-02T14:42:11.950+02:00","_submitted_by":null,"_geolocation":[53.555892,9.948884],"Q1/Work":"4","All_in_all_how_woul_would_you_say_it_is":"5","__version__":"vGEYKrPXZhge2uYk4toEKs","Some_people_feel_the_your_life_turns_out":"8","Q1/Religion":"3"},{"_id":107,"_notes":[],"Q1/Leisure_time":"3","Taking_all_things_to_ould_you_say_you_are":"4","I_would_like_to_ask_y_much_or_not_at_all/People_you_know_personally":"4","_validation_status":{},"_uuid":"8a12d9e0-68ab-4df6-a7e7-294a8eb66d15","_tags":[],"I_would_like_to_ask_y_much_or_not_at_all/People_you_meet_for_the_first_time":"1","Generally_speaking_dealing_with_people":"8","Did_you_do_voluntary_in_the_last_6_months":"9","_xform_id_string":"aRo4wg5utWT7dwdnQQEAE7","I_would_like_to_ask_y_much_or_not_at_all/People_of_another_nationality":"1","I_would_like_to_ask_y_much_or_not_at_all/Your_family":"4","meta/instanceID":"uuid:8a12d9e0-68ab-4df6-a7e7-294a8eb66d15","_status":"submitted_via_web","I_would_like_to_ask_y_much_or_not_at_all/People_in_your_neighborhood":"1","formhub/uuid":"1f37921296654b91b8cc11e152956764","end":"2021-05-02T16:17:10.920+02:00","Q1/Friends_and_acquaintances":"2","Please_indicate_wher_the_map_is_Hamburg":"53.894588 + 10.79745 0 0","_submission_time":"2021-05-02T14:17:12","I_would_like_to_ask_y_much_or_not_at_all/People_of_another_religion":"1","Q1/Politics":"2","_attachments":[],"Q1/Family":"3","start":"2021-05-02T14:44:30.930+02:00","_submitted_by":null,"_geolocation":[53.894588,10.79745],"Q1/Work":"2","All_in_all_how_woul_would_you_say_it_is":"3","__version__":"vGEYKrPXZhge2uYk4toEKs","Some_people_feel_the_your_life_turns_out":"10","Q1/Religion":"3"}]}' + recorded_at: 2021-07-22 06:42:41 GMT + recorded_with: vcr/0.6.0, webmockr/0.8.0 diff --git a/tests/fixtures/kobo-get-submissions.yml b/tests/fixtures/kobo-get-submissions.yml new file mode 100644 index 0000000..40b0f1e --- /dev/null +++ b/tests/fixtures/kobo-get-submissions.yml @@ -0,0 +1,145 @@ +http_interactions: +- request: + method: get + uri: https://kobo.correlaid.org/api/v2/assets/aRo4wg5utWT7dwdnQQEAE7/?format=json + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3 crul/1.1.0 + Accept-Encoding: gzip, deflate + Authorization: fakebearertoken + Accept: application/json + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + server: nginx + date: Thu, 22 Jul 2021 06:54:18 GMT + content-type: application/json + content-length: '16069' + connection: keep-alive + vary: Accept, Accept-Language, Cookie, Origin + allow: GET, PUT, PATCH, DELETE, HEAD, OPTIONS + x-kobonaut: api_user + x-frame-options: SAMEORIGIN + content-language: en + body: + encoding: UTF-8 + file: no + string: '{"url":"https://kobo.correlaid.org/api/v2/assets/aRo4wg5utWT7dwdnQQEAE7/?format=json","owner":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","owner__username":"api_user","parent":null,"ancestors":null,"settings":{"sector":{"label":"Other","value":"Other"},"country":{"label":"Germany","value":"DEU"},"description":"Yet + another testing form for package development","share-metadata":false},"asset_type":"survey","date_created":"2021-05-02T12:12:11.859577Z","summary":{"geo":true,"labels":["Please + say, for each of the following, how important it is in your life.","Work","Family","Friends + and acquaintances","Leisure time"],"columns":["name","type","label","required","kobo--score-choices","select_from_list_name","hint","parameters"],"languages":[null],"row_count":21,"default_translation":null},"date_modified":"2021-05-02T12:41:54.037442Z","version_id":"vGEYKrPXZhge2uYk4toEKs","version__content_hash":"9487faea38af0b94b0f165fe6a78b0f4fc8e1aa3","version_count":6,"has_deployment":true,"deployed_version_id":"vGEYKrPXZhge2uYk4toEKs","deployed_versions":{"count":2,"next":null,"previous":null,"results":[{"uid":"vGEYKrPXZhge2uYk4toEKs","url":"https://kobo.correlaid.org/api/v2/assets/aRo4wg5utWT7dwdnQQEAE7/versions/vGEYKrPXZhge2uYk4toEKs/?format=json","content_hash":"9487faea38af0b94b0f165fe6a78b0f4fc8e1aa3","date_deployed":"2021-05-02T12:41:36.532642Z","date_modified":"2021-05-02 + 12:41:36.532642+00:00"},{"uid":"vhWtJRry8cSn5PBEda3oDy","url":"https://kobo.correlaid.org/api/v2/assets/aRo4wg5utWT7dwdnQQEAE7/versions/vhWtJRry8cSn5PBEda3oDy/?format=json","content_hash":"561e3789013d5b0e7ac8939b7ce31a824067aec0","date_deployed":"2021-05-02T12:33:25.779708Z","date_modified":"2021-05-02 + 12:33:25.779708+00:00"}]},"deployment__identifier":"https://kc.correlaid.org/api_user/forms/aRo4wg5utWT7dwdnQQEAE7","deployment__links":{"url":"https://ee.correlaid.org/y6PKgSLC","single_url":"https://ee.correlaid.org/single/y6PKgSLC","single_once_url":"https://ee.correlaid.org/single/71008a4dad5f8c5541759ddb818a5760","offline_url":"https://ee.correlaid.org/x/y6PKgSLC","preview_url":"https://ee.correlaid.org/preview/y6PKgSLC","iframe_url":"https://ee.correlaid.org/i/y6PKgSLC","single_iframe_url":"https://ee.correlaid.org/single/i/y6PKgSLC","single_once_iframe_url":"https://ee.correlaid.org/single/i/71008a4dad5f8c5541759ddb818a5760"},"deployment__active":true,"deployment__data_download_links":{"xls_legacy":"https://kc.correlaid.org/api_user/exports/aRo4wg5utWT7dwdnQQEAE7/xls/","csv_legacy":"https://kc.correlaid.org/api_user/exports/aRo4wg5utWT7dwdnQQEAE7/csv/","zip_legacy":"https://kc.correlaid.org/api_user/exports/aRo4wg5utWT7dwdnQQEAE7/zip/","kml_legacy":"https://kc.correlaid.org/api_user/exports/aRo4wg5utWT7dwdnQQEAE7/kml/","xls":"https://kc.correlaid.org/api_user/reports/aRo4wg5utWT7dwdnQQEAE7/export.xlsx","csv":"https://kc.correlaid.org/api_user/reports/aRo4wg5utWT7dwdnQQEAE7/export.csv"},"deployment__submission_count":4,"report_styles":{"default":{},"specified":{"Q1":{},"end":{},"start":{},"ai6cp87":{},"dq0sb99":{},"fd0cf28":{},"gt1yj76":{},"ip2pc55":{},"ke1im15":{},"kr9ur31":{},"ks56k46":{},"lr5sh35":{},"mk6mc53":{},"ob3me97":{},"or5gr65":{},"qy1kf43":{},"tb2px63":{},"tf9rd50":{},"tt3bk39":{},"uf68v87":{},"va0xx85":{},"wh7ei00":{},"xg6fl64":{},"yj6dy23":{},"/dr9fq65":{},"/tb2px63":{}},"kuid_names":{"Q1":"dr9fq65","end":"m28GgoH7K","start":"dCWJ0qKC4","ai6cp87":"ai6cp87","dq0sb99":"dq0sb99","fd0cf28":"fd0cf28","gt1yj76":"gt1yj76","ip2pc55":"ip2pc55","ke1im15":"ke1im15","kr9ur31":"kr9ur31","ks56k46":"ks56k46","lr5sh35":"lr5sh35","mk6mc53":"mk6mc53","ob3me97":"ob3me97","or5gr65":"or5gr65","qy1kf43":"qy1kf43","tb2px63":"tb2px63","tf9rd50":"tf9rd50","tt3bk39":"tt3bk39","uf68v87":"uf68v87","va0xx85":"va0xx85","wh7ei00":"wh7ei00","xg6fl64":"xg6fl64","yj6dy23":"yj6dy23","/dr9fq65":"/dr9fq65","/tb2px63":"/tb2px63"}},"report_custom":{},"map_styles":{},"map_custom":{},"content":{"schema":"1","survey":[{"name":"start","type":"start","$kuid":"dCWJ0qKC4","$autoname":"start"},{"name":"end","type":"end","$kuid":"m28GgoH7K","$autoname":"end"},{"name":"Q1","type":"begin_score","$kuid":"dr9fq65","label":["Please + say, for each of the following, how important it is in your life."],"required":false,"$autoname":"Q1","kobo--score-choices":"ys4jh05"},{"type":"score__row","$kuid":"kr9ur31","label":["Work"],"required":false,"$autoname":"Work"},{"type":"score__row","$kuid":"tf9rd50","label":["Family"],"required":false,"$autoname":"Family"},{"type":"score__row","$kuid":"mk6mc53","label":["Friends + and acquaintances"],"required":false,"$autoname":"Friends_and_acquaintances"},{"type":"score__row","$kuid":"lr5sh35","label":["Leisure + time"],"required":false,"$autoname":"Leisure_time"},{"type":"score__row","$kuid":"ob3me97","label":["Politics"],"required":false,"$autoname":"Politics"},{"type":"score__row","$kuid":"ai6cp87","label":["Religion"],"required":false,"$autoname":"Religion"},{"type":"end_score","$kuid":"/dr9fq65"},{"type":"select_one","$kuid":"or5gr65","label":["Taking + all things together, would you say you are:"],"required":true,"$autoname":"Taking_all_things_to_ould_you_say_you_are","select_from_list_name":"rz4sr22"},{"type":"select_one","$kuid":"uf68v87","label":["All + in all, how would you describe your state of health these days? would you + say it is"],"required":false,"$autoname":"All_in_all_how_woul_would_you_say_it_is","select_from_list_name":"ve2ix92"},{"type":"select_one","$kuid":"ks56k46","label":["Did + you do voluntary work in the last 6 months?"],"required":false,"$autoname":"Did_you_do_voluntary_in_the_last_6_months","select_from_list_name":"am8gn27"},{"type":"select_one","$kuid":"va0xx85","label":["Generally + speaking, would you say that most people can be trusted or that you can''t + be too careful in dealing with people?"],"required":false,"$autoname":"Generally_speaking_dealing_with_people","select_from_list_name":"zl1iq13"},{"type":"begin_score","$kuid":"tb2px63","label":["I + would like to ask you how much you trust people from various groups. Could + you tell me for each whether you trust people from this group completely, + somewhat, not very much or not at all?"],"required":false,"$autoname":"I_would_like_to_ask_y_much_or_not_at_all","kobo--score-choices":"uy4om18"},{"type":"score__row","$kuid":"xg6fl64","label":["Your + family"],"required":false,"$autoname":"Your_family"},{"type":"score__row","$kuid":"yj6dy23","label":["People + in your neighborhood"],"required":false,"$autoname":"People_in_your_neighborhood"},{"type":"score__row","$kuid":"ke1im15","label":["People + you know personally"],"required":false,"$autoname":"People_you_know_personally"},{"type":"score__row","$kuid":"wh7ei00","label":["People + you meet for the first time"],"required":false,"$autoname":"People_you_meet_for_the_first_time"},{"type":"score__row","$kuid":"qy1kf43","label":["People + of another religion"],"required":false,"$autoname":"People_of_another_religion"},{"type":"score__row","$kuid":"ip2pc55","label":["People + of another nationality"],"required":false,"$autoname":"People_of_another_nationality"},{"type":"end_score","$kuid":"/tb2px63"},{"hint":["1 + = \"None at all\", 10 = \"a great deal\""],"type":"range","$kuid":"gt1yj76","label":["Some + people feel they have completely free choice and control over their lives, + and other people feel that what they do has no real effect on what happens + to them. Please use the scale to indicate how much freedom of choice and control + you feel you have over the way your life turns out?"],"required":false,"$autoname":"Some_people_feel_the_your_life_turns_out","parameters":"start=1;end=10;step=1"},{"type":"geopoint","$kuid":"fd0cf28","label":["Please + indicate where on the map is \"Hamburg\""],"required":false,"$autoname":"Please_indicate_wher_the_map_is_Hamburg"},{"type":"file","$kuid":"dq0sb99","label":["Upload + an arbitrary file..."],"required":false,"$autoname":"Upload_an_arbitrary_file"}],"choices":[{"name":"1","$kuid":"NPp8OR3md","label":["Very + important"],"list_name":"ys4jh05","$autovalue":"1"},{"name":"2","$kuid":"LnI83gRXp","label":["quite + important"],"list_name":"ys4jh05","$autovalue":"2"},{"name":"3","$kuid":"u6ot3527d","label":["not + important"],"list_name":"ys4jh05","$autovalue":"3"},{"name":"4","$kuid":"gRoco4Pev","label":["not + at all important"],"list_name":"ys4jh05","$autovalue":"4"},{"name":"1","$kuid":"4oLFnV3ws","label":["Very + happy"],"list_name":"rz4sr22","$autovalue":"1"},{"name":"2","$kuid":"PAmAPsyFM","label":["Quite + happy"],"list_name":"rz4sr22","$autovalue":"2"},{"name":"3","$kuid":"G8ZTNvrsz","label":["Not + very happy"],"list_name":"rz4sr22","$autovalue":"3"},{"name":"4","$kuid":"p2PSwo7yN","label":["Not + at all happy"],"list_name":"rz4sr22","$autovalue":"4"},{"name":"8","$kuid":"ZUOsXVxA0","label":["Don''t + know"],"list_name":"rz4sr22","$autovalue":"8"},{"name":"9","$kuid":"gTT51LFcs","label":["No + answer"],"list_name":"rz4sr22","$autovalue":"9"},{"name":"1","$kuid":"FSr5OYH5Z","label":["Very + good"],"list_name":"ve2ix92","$autovalue":"1"},{"name":"2","$kuid":"ePIcIfywO","label":["Good"],"list_name":"ve2ix92","$autovalue":"2"},{"name":"3","$kuid":"97eDDuzaO","label":["Fair"],"list_name":"ve2ix92","$autovalue":"3"},{"name":"4","$kuid":"BIcgTk7PF","label":["Poor"],"list_name":"ve2ix92","$autovalue":"4"},{"name":"5","$kuid":"TI1TEmjKI","label":["Very + poor"],"list_name":"ve2ix92","$autovalue":"5"},{"name":"8","$kuid":"UPQRPVpZN","label":["Don''t + know"],"list_name":"ve2ix92","$autovalue":"8"},{"name":"9","$kuid":"696pTgkEM","label":["No + answer"],"list_name":"ve2ix92","$autovalue":"9"},{"name":"1","$kuid":"rhWu34seb","label":["Yes"],"list_name":"am8gn27","$autovalue":"1"},{"name":"2","$kuid":"eNbB8K507","label":["No"],"list_name":"am8gn27","$autovalue":"2"},{"name":"8","$kuid":"kg9naDqjC","label":["Don''t + know"],"list_name":"am8gn27","$autovalue":"8"},{"name":"9","$kuid":"7AFKIlHDu","label":["No + answer"],"list_name":"am8gn27","$autovalue":"9"},{"name":"1","$kuid":"IKCXDYXCk","label":["Most + people can be trusted"],"list_name":"zl1iq13","$autovalue":"1"},{"name":"2","$kuid":"Jvg4jninb","label":["Can''t + be too careful"],"list_name":"zl1iq13","$autovalue":"2"},{"name":"8","$kuid":"VSWHtAmIg","label":["Don''t + know"],"list_name":"zl1iq13","$autovalue":"8"},{"name":"9","$kuid":"Utj6uO20z","label":["No + answer"],"list_name":"zl1iq13","$autovalue":"9"},{"name":"1","$kuid":"UrdKQbo8g","label":["Trust + completely"],"list_name":"uy4om18","$autovalue":"1"},{"name":"2","$kuid":"mCJO9kEu8","label":["Trust + somewhat"],"list_name":"uy4om18","$autovalue":"2"},{"name":"3","$kuid":"UlmwVnpew","label":["Do + not trust very much"],"list_name":"uy4om18","$autovalue":"3"},{"name":"4","$kuid":"cMmSDIUwH","label":["Do  + not trust at all"],"list_name":"uy4om18","$autovalue":"4"}],"settings":{},"translated":["hint","label"],"translations":[null]},"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/aRo4wg5utWT7dwdnQQEAE7/?format=json.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/aRo4wg5utWT7dwdnQQEAE7/?format=json.xml"}],"embeds":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/aRo4wg5utWT7dwdnQQEAE7/xls/?format=json"},{"format":"xform","url":"https://kobo.correlaid.org/api/v2/assets/aRo4wg5utWT7dwdnQQEAE7/xform/?format=json"}],"koboform_link":"https://kobo.correlaid.org/api/v2/assets/aRo4wg5utWT7dwdnQQEAE7/koboform/?format=json","xform_link":"https://kobo.correlaid.org/api/v2/assets/aRo4wg5utWT7dwdnQQEAE7/xform/?format=json","hooks_link":"https://kobo.correlaid.org/api/v2/assets/aRo4wg5utWT7dwdnQQEAE7/hooks/?format=json","tag_string":"","uid":"aRo4wg5utWT7dwdnQQEAE7","kind":"asset","xls_link":"https://kobo.correlaid.org/api/v2/assets/aRo4wg5utWT7dwdnQQEAE7/xls/?format=json","name":"kbtbr + Testing Survey","assignable_permissions":[{"url":"https://kobo.correlaid.org/api/v2/permissions/view_asset/?format=json","label":"View + form"},{"url":"https://kobo.correlaid.org/api/v2/permissions/change_asset/?format=json","label":"Edit + form"},{"url":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/?format=json","label":"Manage + project"},{"url":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/?format=json","label":"Add + submissions"},{"url":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/?format=json","label":"View + submissions"},{"url":"https://kobo.correlaid.org/api/v2/permissions/partial_submissions/?format=json","label":"View + submissions only from specific users"},{"url":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/?format=json","label":"Edit + submissions"},{"url":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/?format=json","label":"Delete + submissions"},{"url":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/?format=json","label":"Validate + submissions"}],"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/aRo4wg5utWT7dwdnQQEAE7/permission-assignments/pGnVn25TznLDuRD2cXk9EM/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/?format=json","label":"Add + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aRo4wg5utWT7dwdnQQEAE7/permission-assignments/pVkNG7R8p8DB9QGUChEAnf/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/?format=json","label":"Edit + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aRo4wg5utWT7dwdnQQEAE7/permission-assignments/pKXPkdHGUD9mGRMiWYf68y/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/?format=json","label":"Edit + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aRo4wg5utWT7dwdnQQEAE7/permission-assignments/pTXkUT6tGpJvfzBvREEWcF/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/?format=json","label":"Delete + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aRo4wg5utWT7dwdnQQEAE7/permission-assignments/pMfchFkNuYbgcRqqmShWpr/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/?format=json","label":"Manage + project"},{"url":"https://kobo.correlaid.org/api/v2/assets/aRo4wg5utWT7dwdnQQEAE7/permission-assignments/psZMVKDEfee7uPFTfo7HCM/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/?format=json","label":"Validate + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aRo4wg5utWT7dwdnQQEAE7/permission-assignments/pgYtnZ956vAmmXimzqBWQL/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/?format=json","label":"View + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aRo4wg5utWT7dwdnQQEAE7/permission-assignments/pPJePYMC3gnRxeDN9hWkGr/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/?format=json","label":"View + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aRo4wg5utWT7dwdnQQEAE7/permission-assignments/pfWCMzdRisSwRiUzzdtLsR/?format=json","user":"https://kobo.correlaid.org/api/v2/users/frie_preu/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/?format=json","label":"Edit + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aRo4wg5utWT7dwdnQQEAE7/permission-assignments/pczJm4pANtqBCqyuMjJ2VM/?format=json","user":"https://kobo.correlaid.org/api/v2/users/frie_preu/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/?format=json","label":"View + form"}],"data":"https://kobo.correlaid.org/api/v2/assets/aRo4wg5utWT7dwdnQQEAE7/data/?format=json"}' + recorded_at: 2021-07-22 06:54:18 GMT + recorded_with: vcr/0.6.0, webmockr/0.8.0 +- request: + method: get + uri: https://kobo.correlaid.org/api/v2/assets/aRo4wg5utWT7dwdnQQEAE7/data/?format=json + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3 crul/1.1.0 + Accept-Encoding: gzip, deflate + Authorization: fakebearertoken + Accept: application/json + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + server: nginx + date: Thu, 22 Jul 2021 06:54:18 GMT + content-type: application/json + content-length: '6510' + connection: keep-alive + vary: Accept, Accept-Language, Cookie, Origin + allow: GET, HEAD, OPTIONS + x-kobonaut: api_user + x-frame-options: SAMEORIGIN + content-language: en + body: + encoding: UTF-8 + file: no + string: '{"count":4,"next":null,"previous":null,"results":[{"_id":104,"_notes":[],"Q1/Leisure_time":"3","Taking_all_things_to_ould_you_say_you_are":"2","I_would_like_to_ask_y_much_or_not_at_all/People_you_know_personally":"2","_validation_status":{},"_uuid":"aca8c44f-6327-4024-9187-c9e10151c940","_tags":[],"I_would_like_to_ask_y_much_or_not_at_all/People_you_meet_for_the_first_time":"2","Generally_speaking_dealing_with_people":"1","Did_you_do_voluntary_in_the_last_6_months":"2","_xform_id_string":"aRo4wg5utWT7dwdnQQEAE7","I_would_like_to_ask_y_much_or_not_at_all/People_of_another_nationality":"2","I_would_like_to_ask_y_much_or_not_at_all/Your_family":"2","meta/instanceID":"uuid:aca8c44f-6327-4024-9187-c9e10151c940","_status":"submitted_via_web","I_would_like_to_ask_y_much_or_not_at_all/People_in_your_neighborhood":"2","formhub/uuid":"1f37921296654b91b8cc11e152956764","end":"2021-05-02T14:35:35.092+02:00","Q1/Friends_and_acquaintances":"1","_submission_time":"2021-05-02T12:35:45","I_would_like_to_ask_y_much_or_not_at_all/People_of_another_religion":"2","Q1/Politics":"3","_attachments":[],"Q1/Family":"3","start":"2021-05-02T14:34:33.302+02:00","_submitted_by":null,"_geolocation":[null,null],"Q1/Work":"2","All_in_all_how_woul_would_you_say_it_is":"4","__version__":"vhWtJRry8cSn5PBEda3oDy","Some_people_feel_the_your_life_turns_out":"6","Q1/Religion":"2"},{"_id":105,"_notes":[],"Q1/Leisure_time":"4","Taking_all_things_to_ould_you_say_you_are":"1","I_would_like_to_ask_y_much_or_not_at_all/People_you_know_personally":"3","_validation_status":{},"_uuid":"7ab504ec-1a1e-49e5-960c-39b77f5e00c5","_tags":[],"I_would_like_to_ask_y_much_or_not_at_all/People_you_meet_for_the_first_time":"3","Generally_speaking_dealing_with_people":"1","Did_you_do_voluntary_in_the_last_6_months":"2","_xform_id_string":"aRo4wg5utWT7dwdnQQEAE7","I_would_like_to_ask_y_much_or_not_at_all/People_of_another_nationality":"3","I_would_like_to_ask_y_much_or_not_at_all/Your_family":"2","meta/instanceID":"uuid:7ab504ec-1a1e-49e5-960c-39b77f5e00c5","_status":"submitted_via_web","I_would_like_to_ask_y_much_or_not_at_all/People_in_your_neighborhood":"1","formhub/uuid":"1f37921296654b91b8cc11e152956764","end":"2021-05-02T14:36:36.740+02:00","Q1/Friends_and_acquaintances":"3","_submission_time":"2021-05-02T12:36:47","I_would_like_to_ask_y_much_or_not_at_all/People_of_another_religion":"2","Q1/Politics":"3","_attachments":[],"Q1/Family":"2","start":"2021-05-02T14:36:11.481+02:00","_submitted_by":null,"_geolocation":[null,null],"Q1/Work":"1","All_in_all_how_woul_would_you_say_it_is":"8","__version__":"vhWtJRry8cSn5PBEda3oDy","Some_people_feel_the_your_life_turns_out":"3","Q1/Religion":"2"},{"_id":106,"_notes":[],"Q1/Leisure_time":"1","Upload_an_arbitrary_file":"E0QLjvNUYAAe-s_-14_44_17.jpeg","Taking_all_things_to_ould_you_say_you_are":"2","I_would_like_to_ask_y_much_or_not_at_all/People_you_know_personally":"1","_validation_status":{},"_uuid":"3b98cf99-b651-422b-ace9-c242ca8f9717","_tags":[],"I_would_like_to_ask_y_much_or_not_at_all/People_you_meet_for_the_first_time":"3","Generally_speaking_dealing_with_people":"8","Did_you_do_voluntary_in_the_last_6_months":"9","_xform_id_string":"aRo4wg5utWT7dwdnQQEAE7","I_would_like_to_ask_y_much_or_not_at_all/People_of_another_nationality":"2","I_would_like_to_ask_y_much_or_not_at_all/Your_family":"1","meta/instanceID":"uuid:3b98cf99-b651-422b-ace9-c242ca8f9717","_status":"submitted_via_web","I_would_like_to_ask_y_much_or_not_at_all/People_in_your_neighborhood":"2","formhub/uuid":"1f37921296654b91b8cc11e152956764","end":"2021-05-02T14:44:30.817+02:00","Q1/Friends_and_acquaintances":"2","Please_indicate_wher_the_map_is_Hamburg":"53.555892 + 9.948884 0 0","_submission_time":"2021-05-02T12:44:41","I_would_like_to_ask_y_much_or_not_at_all/People_of_another_religion":"2","Q1/Politics":"2","_attachments":[{"mimetype":"image/jpeg","download_small_url":"https://kc.correlaid.org/media/small?media_file=api_user%2Fattachments%2F1f37921296654b91b8cc11e152956764%2F3b98cf99-b651-422b-ace9-c242ca8f9717%2FE0QLjvNUYAAe-s_-14_44_17.jpeg","download_large_url":"https://kc.correlaid.org/media/large?media_file=api_user%2Fattachments%2F1f37921296654b91b8cc11e152956764%2F3b98cf99-b651-422b-ace9-c242ca8f9717%2FE0QLjvNUYAAe-s_-14_44_17.jpeg","download_url":"https://kc.correlaid.org/media/original?media_file=api_user%2Fattachments%2F1f37921296654b91b8cc11e152956764%2F3b98cf99-b651-422b-ace9-c242ca8f9717%2FE0QLjvNUYAAe-s_-14_44_17.jpeg","filename":"api_user/attachments/1f37921296654b91b8cc11e152956764/3b98cf99-b651-422b-ace9-c242ca8f9717/E0QLjvNUYAAe-s_-14_44_17.jpeg","instance":106,"download_medium_url":"https://kc.correlaid.org/media/medium?media_file=api_user%2Fattachments%2F1f37921296654b91b8cc11e152956764%2F3b98cf99-b651-422b-ace9-c242ca8f9717%2FE0QLjvNUYAAe-s_-14_44_17.jpeg","id":1,"xform":18}],"Q1/Family":"3","start":"2021-05-02T14:42:11.950+02:00","_submitted_by":null,"_geolocation":[53.555892,9.948884],"Q1/Work":"4","All_in_all_how_woul_would_you_say_it_is":"5","__version__":"vGEYKrPXZhge2uYk4toEKs","Some_people_feel_the_your_life_turns_out":"8","Q1/Religion":"3"},{"_id":107,"_notes":[],"Q1/Leisure_time":"3","Taking_all_things_to_ould_you_say_you_are":"4","I_would_like_to_ask_y_much_or_not_at_all/People_you_know_personally":"4","_validation_status":{},"_uuid":"8a12d9e0-68ab-4df6-a7e7-294a8eb66d15","_tags":[],"I_would_like_to_ask_y_much_or_not_at_all/People_you_meet_for_the_first_time":"1","Generally_speaking_dealing_with_people":"8","Did_you_do_voluntary_in_the_last_6_months":"9","_xform_id_string":"aRo4wg5utWT7dwdnQQEAE7","I_would_like_to_ask_y_much_or_not_at_all/People_of_another_nationality":"1","I_would_like_to_ask_y_much_or_not_at_all/Your_family":"4","meta/instanceID":"uuid:8a12d9e0-68ab-4df6-a7e7-294a8eb66d15","_status":"submitted_via_web","I_would_like_to_ask_y_much_or_not_at_all/People_in_your_neighborhood":"1","formhub/uuid":"1f37921296654b91b8cc11e152956764","end":"2021-05-02T16:17:10.920+02:00","Q1/Friends_and_acquaintances":"2","Please_indicate_wher_the_map_is_Hamburg":"53.894588 + 10.79745 0 0","_submission_time":"2021-05-02T14:17:12","I_would_like_to_ask_y_much_or_not_at_all/People_of_another_religion":"1","Q1/Politics":"2","_attachments":[],"Q1/Family":"3","start":"2021-05-02T14:44:30.930+02:00","_submitted_by":null,"_geolocation":[53.894588,10.79745],"Q1/Work":"2","All_in_all_how_woul_would_you_say_it_is":"3","__version__":"vGEYKrPXZhge2uYk4toEKs","Some_people_feel_the_your_life_turns_out":"10","Q1/Religion":"3"}]}' + recorded_at: 2021-07-22 06:54:18 GMT + recorded_with: vcr/0.6.0, webmockr/0.8.0 diff --git a/tests/testthat/test-asset.R b/tests/testthat/test-asset.R index d063f69..6b6f7fa 100644 --- a/tests/testthat/test-asset.R +++ b/tests/testthat/test-asset.R @@ -76,3 +76,32 @@ test_that("get asset returns asset instance", { expect_equal(length(asset_obj$to_list()), 6) expect_setequal(names(asset_obj$to_list()), c("uid", "name", "asset_url", "data_url", "type", "owner_username")) }) + +test_that("can get survey submissions from survey", { + vcr::use_cassette("kobo-asset-submissions-asset", { + kobo <- Kobo$new(base_url_v2 = BASE_URL, kobo_token = Sys.getenv("KBTBR_TOKEN")) + asset_obj <- kobo$get_asset("aRo4wg5utWT7dwdnQQEAE7") + }) + + vcr::use_cassette("kobo-asset-submissions-data", { + submissions_df <- asset_obj$get_submissions() + }) + expect_true(tibble::is_tibble(submissions_df)) + expect_equal(nrow(submissions_df), 4) + print(str(submissions_df)) +}) + +test_that("getting submissions works for survey without submissions so far", { + vcr::use_cassette("kobo-asset-submissions-asset-nosubs", { + kobo <- Kobo$new(base_url_v2 = BASE_URL, kobo_token = Sys.getenv("KBTBR_TOKEN")) + asset_obj <- kobo$get_asset("ajzghKK6NELaixPQqsm49e") + }) + + vcr::use_cassette("kobo-asset-submissions-data-nosubs", { + submissions_df <- asset_obj$get_submissions() + }) + expect_true(tibble::is_tibble(submissions_df)) + expect_equal(nrow(submissions_df), 0) + expect_equal(ncol(submissions_df), 0) + print(str(submissions_df)) +}) \ No newline at end of file diff --git a/tests/testthat/test-kobo.R b/tests/testthat/test-kobo.R index 3a231ae..5e69680 100644 --- a/tests/testthat/test-kobo.R +++ b/tests/testthat/test-kobo.R @@ -86,7 +86,7 @@ test_that("Kobo can fetch assets using simple get", { expect_equal(assets$count, 8) }) -test_that("Kobo can a single asset", { +test_that("Kobo can get a single asset", { vcr::use_cassette("kobo-get-single-asset", { kobo <- Kobo$new(base_url_v2 = BASE_URL, kobo_token = Sys.getenv("KBTBR_TOKEN")) asset <- kobo$get_asset("aRo4wg5utWT7dwdnQQEAE7") @@ -97,6 +97,14 @@ test_that("Kobo can a single asset", { ) }) +test_that("Kobo can get submissions for a survey", { + vcr::use_cassette("kobo-get-submissions", { + kobo <- Kobo$new(base_url_v2 = BASE_URL, kobo_token = Sys.getenv("KBTBR_TOKEN")) + response_df <- kobo$get_submissions("aRo4wg5utWT7dwdnQQEAE7") + }) + expect_true(tibble::is_tibble(response_df)) + expect_equal(nrow(response_df), 4) +}) # ERRORS ----------- vcr::use_cassette("kobo-get-404", { test_that("non existing route throws 404 error", { From b25b72fba8a4a629de3d6b6392350f0fcb6c3f96 Mon Sep 17 00:00:00 2001 From: Frie Date: Thu, 22 Jul 2021 09:12:34 +0200 Subject: [PATCH 02/57] #4 add another test and code styling --- R/asset.R | 6 +-- ...kobo-asset-submissions-asset-notsurvey.yml | 42 +++++++++++++++++++ tests/testthat/test-asset.R | 20 ++++++--- 3 files changed, 59 insertions(+), 9 deletions(-) create mode 100644 tests/fixtures/kobo-asset-submissions-asset-notsurvey.yml diff --git a/R/asset.R b/R/asset.R index a6f71fe..71eaa34 100644 --- a/R/asset.R +++ b/R/asset.R @@ -97,11 +97,11 @@ Asset <- R6::R6Class("Asset", #' @description get submissions to a survey/form #' @return tibble. submissions as a tibble. if no submissions were made yet, the tibble will have no columns. get_submissions = function() { - if (private$.type != 'survey') { - usethis::ui_stop("Only valid for assets of type 'survey'") + if (private$.type != "survey") { + usethis::ui_stop(glue::glue("Only valid for assets of type 'survey'. Current asset is of type '{private$.type}'.")) } path <- glue::glue("assets/{private$.uid}/data/") - private$.kobo$get(path)$results %>% + private$.kobo$get(path)$results %>% tibble::as_tibble() }, #' to_list diff --git a/tests/fixtures/kobo-asset-submissions-asset-notsurvey.yml b/tests/fixtures/kobo-asset-submissions-asset-notsurvey.yml new file mode 100644 index 0000000..7c890a1 --- /dev/null +++ b/tests/fixtures/kobo-asset-submissions-asset-notsurvey.yml @@ -0,0 +1,42 @@ +http_interactions: +- request: + method: get + uri: https://kobo.correlaid.org/api/v2/assets/apxYrm7i4mGc3Wxqu2eZ2r/?format=json + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3 crul/1.1.0 + Accept-Encoding: gzip, deflate + Authorization: fakebearertoken + Accept: application/json + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + server: nginx + date: Thu, 22 Jul 2021 07:10:44 GMT + content-type: application/json + content-length: '3364' + connection: keep-alive + vary: Accept, Accept-Language, Cookie, Origin + allow: GET, PUT, PATCH, DELETE, HEAD, OPTIONS + x-kobonaut: api_user + x-frame-options: SAMEORIGIN + content-language: en + body: + encoding: UTF-8 + file: no + string: '{"url":"https://kobo.correlaid.org/api/v2/assets/apxYrm7i4mGc3Wxqu2eZ2r/?format=json","owner":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","owner__username":"api_user","parent":null,"ancestors":null,"settings":{"sector":"Environment","country":"Angola","description":"description","share-metadata":"false"},"asset_type":"block","date_created":"2021-07-12T20:11:25.852585Z","summary":{},"date_modified":"2021-07-12T20:11:25.852606Z","version_id":"vfSHxcWLJfhG4JknBJHzCj","version__content_hash":"4724ddb07034559d7fb5a3d18288dfb683a2d082","version_count":1,"has_deployment":false,"deployed_version_id":null,"deployed_versions":{"count":0,"next":null,"previous":null,"results":[]},"deployment__identifier":null,"deployment__links":{},"deployment__active":false,"deployment__data_download_links":{},"deployment__submission_count":0,"report_styles":{"default":{},"specified":{},"kuid_names":{}},"report_custom":{},"map_styles":{},"map_custom":{},"content":{"schema":"1","survey":[],"settings":{}},"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/apxYrm7i4mGc3Wxqu2eZ2r/?format=json.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/apxYrm7i4mGc3Wxqu2eZ2r/?format=json.xml"}],"embeds":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/apxYrm7i4mGc3Wxqu2eZ2r/xls/?format=json"},{"format":"xform","url":"https://kobo.correlaid.org/api/v2/assets/apxYrm7i4mGc3Wxqu2eZ2r/xform/?format=json"}],"koboform_link":"https://kobo.correlaid.org/api/v2/assets/apxYrm7i4mGc3Wxqu2eZ2r/koboform/?format=json","xform_link":"https://kobo.correlaid.org/api/v2/assets/apxYrm7i4mGc3Wxqu2eZ2r/xform/?format=json","hooks_link":"https://kobo.correlaid.org/api/v2/assets/apxYrm7i4mGc3Wxqu2eZ2r/hooks/?format=json","tag_string":"","uid":"apxYrm7i4mGc3Wxqu2eZ2r","kind":"asset","xls_link":"https://kobo.correlaid.org/api/v2/assets/apxYrm7i4mGc3Wxqu2eZ2r/xls/?format=json","name":"test + create block, with settings provided as parameters","assignable_permissions":[{"url":"https://kobo.correlaid.org/api/v2/permissions/view_asset/?format=json","label":"View + block"},{"url":"https://kobo.correlaid.org/api/v2/permissions/change_asset/?format=json","label":"Edit + block"},{"url":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/?format=json","label":"Manage + block"}],"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/apxYrm7i4mGc3Wxqu2eZ2r/permission-assignments/psvGSqLLw4KivCL6RTaU4J/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/?format=json","label":"Edit + block"},{"url":"https://kobo.correlaid.org/api/v2/assets/apxYrm7i4mGc3Wxqu2eZ2r/permission-assignments/pLVrYUPVn4z9cNSHUUXtvs/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/?format=json","label":"Manage + block"},{"url":"https://kobo.correlaid.org/api/v2/assets/apxYrm7i4mGc3Wxqu2eZ2r/permission-assignments/pEmvTvUK9Xqj4U9vm7H8yy/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/?format=json","label":"View + block"}],"data":"https://kobo.correlaid.org/api/v2/assets/apxYrm7i4mGc3Wxqu2eZ2r/data/?format=json"}' + recorded_at: 2021-07-22 07:10:44 GMT + recorded_with: vcr/0.6.0, webmockr/0.8.0 diff --git a/tests/testthat/test-asset.R b/tests/testthat/test-asset.R index 6b6f7fa..9e76289 100644 --- a/tests/testthat/test-asset.R +++ b/tests/testthat/test-asset.R @@ -82,9 +82,9 @@ test_that("can get survey submissions from survey", { kobo <- Kobo$new(base_url_v2 = BASE_URL, kobo_token = Sys.getenv("KBTBR_TOKEN")) asset_obj <- kobo$get_asset("aRo4wg5utWT7dwdnQQEAE7") }) - + vcr::use_cassette("kobo-asset-submissions-data", { - submissions_df <- asset_obj$get_submissions() + submissions_df <- asset_obj$get_submissions() }) expect_true(tibble::is_tibble(submissions_df)) expect_equal(nrow(submissions_df), 4) @@ -96,12 +96,20 @@ test_that("getting submissions works for survey without submissions so far", { kobo <- Kobo$new(base_url_v2 = BASE_URL, kobo_token = Sys.getenv("KBTBR_TOKEN")) asset_obj <- kobo$get_asset("ajzghKK6NELaixPQqsm49e") }) - + vcr::use_cassette("kobo-asset-submissions-data-nosubs", { - submissions_df <- asset_obj$get_submissions() + submissions_df <- asset_obj$get_submissions() }) expect_true(tibble::is_tibble(submissions_df)) expect_equal(nrow(submissions_df), 0) expect_equal(ncol(submissions_df), 0) - print(str(submissions_df)) -}) \ No newline at end of file +}) + +test_that("get_submissions throws error for asset which is not a survey", { + vcr::use_cassette("kobo-asset-submissions-asset-notsurvey", { + kobo <- Kobo$new(base_url_v2 = BASE_URL, kobo_token = Sys.getenv("KBTBR_TOKEN")) + asset_obj <- kobo$get_asset("apxYrm7i4mGc3Wxqu2eZ2r") + }) + + expect_error(asset_obj$get_submissions(), regexp = "Only valid for assets of type 'survey'. Current asset is of type 'block'.") +}) From b04a9a2cdd7dc025037ffc4e44e9f79c8532a8b3 Mon Sep 17 00:00:00 2001 From: Frie Date: Tue, 27 Jul 2021 08:14:51 +0200 Subject: [PATCH 03/57] Update R/asset.R Co-authored-by: Malte Kyhos --- R/asset.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/asset.R b/R/asset.R index 71eaa34..ac4722f 100644 --- a/R/asset.R +++ b/R/asset.R @@ -98,7 +98,7 @@ Asset <- R6::R6Class("Asset", #' @return tibble. submissions as a tibble. if no submissions were made yet, the tibble will have no columns. get_submissions = function() { if (private$.type != "survey") { - usethis::ui_stop(glue::glue("Only valid for assets of type 'survey'. Current asset is of type '{private$.type}'.")) + usethis::ui_stop("Only valid for assets of type 'survey'. Current asset is of type '{private$.type}'.") } path <- glue::glue("assets/{private$.uid}/data/") private$.kobo$get(path)$results %>% From a4233709541cc0843d113fd07795c073b303b2d0 Mon Sep 17 00:00:00 2001 From: Malte Kyhos Date: Sat, 7 Aug 2021 00:38:52 +0200 Subject: [PATCH 04/57] Extract function "select_prep_client" --- R/kobo.R | 63 +++++++++++++++++++++++++++++--------------------------- 1 file changed, 33 insertions(+), 30 deletions(-) diff --git a/R/kobo.R b/R/kobo.R index 69bf4ba..de3111a 100644 --- a/R/kobo.R +++ b/R/kobo.R @@ -6,8 +6,34 @@ #' interactions with the various endpoints. #' @export Kobo <- R6::R6Class("Kobo", - # private = list( - # ), + private = list( + select_prep_client = function(path, version) { + if (version == "v2") { + return(list( + client = self$session_v2, + path = paste0("api/v2/", path)) + ) + } else if (version == "v1") { + if (checkmate::test_null(self$session_v1)) { + usethis::ui_stop( + paste( + "Session for API v1 is not initalized.", + "Please re-initalize the Kobo client with the", + "base_url_v1 argument.") + ) + } + return(list( + client = self$session_v1, + path = paste0("api/v1/", path) + )) + } else { + usethis::ui_stop( + "Invalid version. Must be either v1 or v2. + Come back in a couple of years." + ) + } + } + ), public = list( #' @field session_v2 KoboClient session for v2 of the API session_v2 = NULL, @@ -70,35 +96,12 @@ Kobo <- R6::R6Class("Kobo", if (!format %in% c("json", "csv")) { usethis::ui_stop("Unsupported format. Only 'json' and 'csv' are supported") } - + query$format <- format - - if (version == "v2") { - res <- self$session_v2$get( - path = paste0("api/v2/", path), - query = query - ) - } else if (version == "v1") { - if (checkmate::test_null(self$session_v1)) { - usethis::ui_stop( - paste( - "Session for API v1 is not initalized.", - "Please re-initalize the Kobo client with the", - "base_url_v1 argument." - ) - ) - } - res <- self$session_v1$get( - path = paste0("api/v1/", path), - query = query - ) - } else { - usethis::ui_stop( - "Invalid version. Must be either v1 or v2. - Come back in a couple of years." - ) - } - + + # Select client + obj <- private$select_prep_client(path, version) + res <- obj$client$get(obj$path, query) res$raise_for_status() if (format == "json" & parse) { From 92defc147d1d3ad31d5c2e53f2f7bc172ed83fc3 Mon Sep 17 00:00:00 2001 From: Malte Kyhos Date: Sat, 7 Aug 2021 00:40:37 +0200 Subject: [PATCH 05/57] Minimal refactoring - use short circuit && (not vectorized) in conditonal structure - avoid pipes one line --- R/kobo.R | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/R/kobo.R b/R/kobo.R index de3111a..09fb87f 100644 --- a/R/kobo.R +++ b/R/kobo.R @@ -104,10 +104,10 @@ Kobo <- R6::R6Class("Kobo", res <- obj$client$get(obj$path, query) res$raise_for_status() - if (format == "json" & parse) { + if (parse && format == "json") { res$raise_for_ct_json() - return(res$parse("UTF-8") %>% jsonlite::fromJSON()) - } else if (format == "csv" & parse) { + return(jsonlite::fromJSON(res$parse("UTF-8"))) + } else if (parse && format == "csv") { usethis::ui_stop( "TODO: Not supported yet" ) From f889e854174b2a1334c997f1168c48784bec81f6 Mon Sep 17 00:00:00 2001 From: Malte Kyhos Date: Sat, 7 Aug 2021 00:41:21 +0200 Subject: [PATCH 06/57] Init skeleton for new Kobo function "get_paginated" --- R/kobo.R | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/R/kobo.R b/R/kobo.R index 09fb87f..2832f63 100644 --- a/R/kobo.R +++ b/R/kobo.R @@ -119,6 +119,15 @@ Kobo <- R6::R6Class("Kobo", return(res) }, + get_paginated = function(path, query, version = "v2", + format = "json", + parse = TRUE) { + + obj <- private$select_prep_client(path, version) + paginator <- Paginator$new(client = obj$client) + res <- paginator$get(path, query) + }, + #' @description #' Wrapper for the POST method of internal session objects. #' @param path character. Path component of the endpoint. From 6e8e9af176bf68caa109da24a0e41fe7198bc7bc Mon Sep 17 00:00:00 2001 From: Malte Kyhos Date: Sat, 7 Aug 2021 00:55:36 +0200 Subject: [PATCH 07/57] Init KoboPaginator class (skeleton only) --- R/kobo.R | 2 +- R/paginator.R | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 R/paginator.R diff --git a/R/kobo.R b/R/kobo.R index 2832f63..28ba6f6 100644 --- a/R/kobo.R +++ b/R/kobo.R @@ -124,7 +124,7 @@ Kobo <- R6::R6Class("Kobo", parse = TRUE) { obj <- private$select_prep_client(path, version) - paginator <- Paginator$new(client = obj$client) + paginator <- KoboPaginator$new(client = obj$client) res <- paginator$get(path, query) }, diff --git a/R/paginator.R b/R/paginator.R new file mode 100644 index 0000000..888a97f --- /dev/null +++ b/R/paginator.R @@ -0,0 +1,23 @@ +#' @title KoboPaginator +#' @description +#' A class that implements link-header style pagination, as is used in +#' the Kobotoolbox API. +KoboPaginator <- R6::R6Class( + private = list( + client = NULL + ), + public = list( + #' @description + #' @param client KoboClient. An instance of a KoboClient that can + #' be used for the paginated requestes. + initialize = function(client) { + stopifnot("KoboClient" %in% class(client)) + + private$client <- client + }, + #' @description + #' @param path + #' @inheritParams + get = function(path, query, ...) {} + ) +) From f4eca94b87e9f1545e4547515d97299895c7ee53 Mon Sep 17 00:00:00 2001 From: Malte Kyhos Date: Sun, 8 Aug 2021 22:49:18 +0200 Subject: [PATCH 08/57] Add infix coalesce operator --- R/utils.R | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/R/utils.R b/R/utils.R index 284af38..410a167 100644 --- a/R/utils.R +++ b/R/utils.R @@ -2,3 +2,11 @@ # url builder (take base url, asset type and identifier and output format?) # if we write the functions outside the classes and set them later in the class # code readability is higher imo + +#' @title Infix Coalesce Operator +#' @describtion Makes coalesce chainable, as often used in +#' tidyverse packages. +#' @noRd +`%||%` <- function(x, y) { + if (is.null(x)) y else x +} From d0155ea4b36e6f70c551ea993f53dfe2b4db1df4 Mon Sep 17 00:00:00 2001 From: Malte Kyhos Date: Sun, 8 Aug 2021 22:49:59 +0200 Subject: [PATCH 09/57] Proceed on kobo paginator class --- R/kobo-paginator.R | 56 ++++++++++++++++++++++++++++++++++++++++++++++ R/paginator.R | 23 ------------------- 2 files changed, 56 insertions(+), 23 deletions(-) create mode 100644 R/kobo-paginator.R delete mode 100644 R/paginator.R diff --git a/R/kobo-paginator.R b/R/kobo-paginator.R new file mode 100644 index 0000000..8b6fc76 --- /dev/null +++ b/R/kobo-paginator.R @@ -0,0 +1,56 @@ +#' @title KoboPaginator +#' @description +#' A class that implements link-header style pagination, as is used in +#' the Kobotoolbox API. +#' @export +KoboPaginator <- R6::R6Class( + public = list( + client = NULL, + #' @description + #' @param client KoboClient. An instance of a KoboClient that can + #' be used for the paginated requestes. + initialize = function(client) { + stopifnot("KoboClient" %in% class(client)) + + private$client <- client + }, + #' @description + #' @param path + #' @inheritParams + get = function(path, query, ...) { + private$page(method = "get") + }, + set_first_response = function(response) { + checkmate::assert_list(response) + private$resps <- response + }, + get_responses = function() { + return(private$resps) + } + ), + private = list( + resps = NULL, + page = function(path, query, ...) { + checkmate::assert_choice(method, "get") + tmp <- list() + + # Retrieve initial response + tmp[[1]] <- private$resps %||% + self$client$get(path, query) + cnt <- 1 + next_link <- tmp[[cnt]][["next"]] + while (!is.null(next_link)) { + tmp_path <- private$resolve_next(next_link) + cnt <- cnt + 1 + tmp[[cnt]] <- self$client$get(tmp_path, query) + next_link <- tmp[[cnt]][["next"]] + } + + private$resps <- tmp + }, + resolve_next = function(link) { + # Subtract base path etc. from + } + + ) +) diff --git a/R/paginator.R b/R/paginator.R deleted file mode 100644 index 888a97f..0000000 --- a/R/paginator.R +++ /dev/null @@ -1,23 +0,0 @@ -#' @title KoboPaginator -#' @description -#' A class that implements link-header style pagination, as is used in -#' the Kobotoolbox API. -KoboPaginator <- R6::R6Class( - private = list( - client = NULL - ), - public = list( - #' @description - #' @param client KoboClient. An instance of a KoboClient that can - #' be used for the paginated requestes. - initialize = function(client) { - stopifnot("KoboClient" %in% class(client)) - - private$client <- client - }, - #' @description - #' @param path - #' @inheritParams - get = function(path, query, ...) {} - ) -) From 732893d55a38418c65bb38562170e9034bf7dd50 Mon Sep 17 00:00:00 2001 From: Malte Kyhos Date: Sun, 8 Aug 2021 22:51:00 +0200 Subject: [PATCH 10/57] Refactor Kobo$select_prep_client method --- R/kobo.R | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/R/kobo.R b/R/kobo.R index 28ba6f6..2e2e4d5 100644 --- a/R/kobo.R +++ b/R/kobo.R @@ -8,30 +8,24 @@ Kobo <- R6::R6Class("Kobo", private = list( select_prep_client = function(path, version) { + checkmate::assert_choice(version, c("v1", "v2")) + if (version == "v2") { - return(list( + obj <- list( client = self$session_v2, path = paste0("api/v2/", path)) - ) } else if (version == "v1") { if (checkmate::test_null(self$session_v1)) { - usethis::ui_stop( - paste( + usethis::ui_stop(paste( "Session for API v1 is not initalized.", "Please re-initalize the Kobo client with the", - "base_url_v1 argument.") - ) - } - return(list( + "base_url_v1 argument.")) + } + obj <- list( client = self$session_v1, - path = paste0("api/v1/", path) - )) - } else { - usethis::ui_stop( - "Invalid version. Must be either v1 or v2. - Come back in a couple of years." - ) + path = paste0("api/v1/", path)) } + return(obj) } ), public = list( From 058fe368cc2cde8438874a83c564d727c5a151ce Mon Sep 17 00:00:00 2001 From: Malte Kyhos Date: Sun, 8 Aug 2021 23:13:34 +0200 Subject: [PATCH 11/57] Getter for private base_url field (KoboClient) --- R/kobo-client.R | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/R/kobo-client.R b/R/kobo-client.R index 410447a..ba8922d 100644 --- a/R/kobo-client.R +++ b/R/kobo-client.R @@ -75,6 +75,13 @@ KoboClient <- R6::R6Class("KoboClient", res <- super$post(path = path, body = body, ...) res$raise_for_status() return(res) + }, + # GETTERS and SETTERS (utils) --- + #' @description + #' Retrieve the private `base_url` field + #' @return A character vector of length one. + get_base_url = function() { + return(private$base_url) } ) # ) From ea0387a3dda53e41f475727c4a7c0252f7e48f63 Mon Sep 17 00:00:00 2001 From: Malte Kyhos Date: Sun, 8 Aug 2021 23:14:38 +0200 Subject: [PATCH 12/57] Untested skeleton functionality for resolve_next --- R/kobo-paginator.R | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/R/kobo-paginator.R b/R/kobo-paginator.R index 8b6fc76..15d4e9c 100644 --- a/R/kobo-paginator.R +++ b/R/kobo-paginator.R @@ -50,6 +50,11 @@ KoboPaginator <- R6::R6Class( }, resolve_next = function(link) { # Subtract base path etc. from + resolved <- gsub( + pattern = paste0("^", self$client$get_base_url()), + replacement = "", + x = link) + return(resolved) } ) From b72e00ffbb90f62f11f59d73d207c5495bfc0f70 Mon Sep 17 00:00:00 2001 From: Malte Kyhos Date: Sun, 8 Aug 2021 23:14:55 +0200 Subject: [PATCH 13/57] Add details to page method --- R/kobo-paginator.R | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/R/kobo-paginator.R b/R/kobo-paginator.R index 15d4e9c..c0b1443 100644 --- a/R/kobo-paginator.R +++ b/R/kobo-paginator.R @@ -30,7 +30,7 @@ KoboPaginator <- R6::R6Class( ), private = list( resps = NULL, - page = function(path, query, ...) { + page = function(path, query, sleep = 0, ...) { checkmate::assert_choice(method, "get") tmp <- list() @@ -39,11 +39,15 @@ KoboPaginator <- R6::R6Class( self$client$get(path, query) cnt <- 1 next_link <- tmp[[cnt]][["next"]] + while (!is.null(next_link)) { tmp_path <- private$resolve_next(next_link) cnt <- cnt + 1 tmp[[cnt]] <- self$client$get(tmp_path, query) + tmp[[cnt]]$raise_for_status() + next_link <- tmp[[cnt]][["next"]] + Sys.sleep(sleep) } private$resps <- tmp From c64b3437f83ce2a3275eec5c501eabd2b2842f28 Mon Sep 17 00:00:00 2001 From: Malte Kyhos Date: Sun, 8 Aug 2021 23:15:14 +0200 Subject: [PATCH 14/57] Add documentation to set_first_response method --- R/kobo-paginator.R | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/R/kobo-paginator.R b/R/kobo-paginator.R index c0b1443..73e7788 100644 --- a/R/kobo-paginator.R +++ b/R/kobo-paginator.R @@ -16,10 +16,16 @@ KoboPaginator <- R6::R6Class( }, #' @description #' @param path - #' @inheritParams get = function(path, query, ...) { private$page(method = "get") }, + #' @description + #' Set the initial response + #' @details + #' Usually, the page method would revoke a first response in the + #' normal way, using its `next` element to walk over all subsequent + #' pages. In some settings, the user might provide this initial response + #' object already. set_first_response = function(response) { checkmate::assert_list(response) private$resps <- response From 157b476644239071c3aa9540c78d3c3b93165a29 Mon Sep 17 00:00:00 2001 From: Frie Date: Sun, 5 Sep 2021 13:46:08 +0200 Subject: [PATCH 15/57] mac stuff --- .gitignore | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index 542b4b9..f0b5f7c 100644 --- a/.gitignore +++ b/.gitignore @@ -38,3 +38,7 @@ docs/*/ # R Environment Variables .Renviron +inst/doc + +# mac +.DS_Store From 9cbf08170556ad73e1a537d8b0642f75cdf7037b Mon Sep 17 00:00:00 2001 From: Frie Date: Sun, 5 Sep 2021 13:47:55 +0200 Subject: [PATCH 16/57] wrangling submissions vignette --- .../fixtures/kobo-asset-submissions-data.yml | 18 +- tests/testthat/test-asset.R | 2 +- .../articles/kobo-asset-submissions-data.yml | 1 + vignettes/articles/rating_question.png | Bin 0 -> 49014 bytes .../articles/wrangling_survey_responses.Rmd | 233 ++++++++++++++++++ 5 files changed, 247 insertions(+), 7 deletions(-) create mode 100644 vignettes/articles/kobo-asset-submissions-data.yml create mode 100644 vignettes/articles/rating_question.png create mode 100644 vignettes/articles/wrangling_survey_responses.Rmd diff --git a/tests/fixtures/kobo-asset-submissions-data.yml b/tests/fixtures/kobo-asset-submissions-data.yml index ee8947e..3f6f2fc 100644 --- a/tests/fixtures/kobo-asset-submissions-data.yml +++ b/tests/fixtures/kobo-asset-submissions-data.yml @@ -18,9 +18,9 @@ http_interactions: headers: status: HTTP/1.1 200 OK server: nginx - date: Thu, 22 Jul 2021 06:42:41 GMT + date: Sun, 05 Sep 2021 11:28:11 GMT content-type: application/json - content-length: '6510' + content-length: '8549' connection: keep-alive vary: Accept, Accept-Language, Cookie, Origin allow: GET, HEAD, OPTIONS @@ -30,8 +30,14 @@ http_interactions: body: encoding: UTF-8 file: no - string: '{"count":4,"next":null,"previous":null,"results":[{"_id":104,"_notes":[],"Q1/Leisure_time":"3","Taking_all_things_to_ould_you_say_you_are":"2","I_would_like_to_ask_y_much_or_not_at_all/People_you_know_personally":"2","_validation_status":{},"_uuid":"aca8c44f-6327-4024-9187-c9e10151c940","_tags":[],"I_would_like_to_ask_y_much_or_not_at_all/People_you_meet_for_the_first_time":"2","Generally_speaking_dealing_with_people":"1","Did_you_do_voluntary_in_the_last_6_months":"2","_xform_id_string":"aRo4wg5utWT7dwdnQQEAE7","I_would_like_to_ask_y_much_or_not_at_all/People_of_another_nationality":"2","I_would_like_to_ask_y_much_or_not_at_all/Your_family":"2","meta/instanceID":"uuid:aca8c44f-6327-4024-9187-c9e10151c940","_status":"submitted_via_web","I_would_like_to_ask_y_much_or_not_at_all/People_in_your_neighborhood":"2","formhub/uuid":"1f37921296654b91b8cc11e152956764","end":"2021-05-02T14:35:35.092+02:00","Q1/Friends_and_acquaintances":"1","_submission_time":"2021-05-02T12:35:45","I_would_like_to_ask_y_much_or_not_at_all/People_of_another_religion":"2","Q1/Politics":"3","_attachments":[],"Q1/Family":"3","start":"2021-05-02T14:34:33.302+02:00","_submitted_by":null,"_geolocation":[null,null],"Q1/Work":"2","All_in_all_how_woul_would_you_say_it_is":"4","__version__":"vhWtJRry8cSn5PBEda3oDy","Some_people_feel_the_your_life_turns_out":"6","Q1/Religion":"2"},{"_id":105,"_notes":[],"Q1/Leisure_time":"4","Taking_all_things_to_ould_you_say_you_are":"1","I_would_like_to_ask_y_much_or_not_at_all/People_you_know_personally":"3","_validation_status":{},"_uuid":"7ab504ec-1a1e-49e5-960c-39b77f5e00c5","_tags":[],"I_would_like_to_ask_y_much_or_not_at_all/People_you_meet_for_the_first_time":"3","Generally_speaking_dealing_with_people":"1","Did_you_do_voluntary_in_the_last_6_months":"2","_xform_id_string":"aRo4wg5utWT7dwdnQQEAE7","I_would_like_to_ask_y_much_or_not_at_all/People_of_another_nationality":"3","I_would_like_to_ask_y_much_or_not_at_all/Your_family":"2","meta/instanceID":"uuid:7ab504ec-1a1e-49e5-960c-39b77f5e00c5","_status":"submitted_via_web","I_would_like_to_ask_y_much_or_not_at_all/People_in_your_neighborhood":"1","formhub/uuid":"1f37921296654b91b8cc11e152956764","end":"2021-05-02T14:36:36.740+02:00","Q1/Friends_and_acquaintances":"3","_submission_time":"2021-05-02T12:36:47","I_would_like_to_ask_y_much_or_not_at_all/People_of_another_religion":"2","Q1/Politics":"3","_attachments":[],"Q1/Family":"2","start":"2021-05-02T14:36:11.481+02:00","_submitted_by":null,"_geolocation":[null,null],"Q1/Work":"1","All_in_all_how_woul_would_you_say_it_is":"8","__version__":"vhWtJRry8cSn5PBEda3oDy","Some_people_feel_the_your_life_turns_out":"3","Q1/Religion":"2"},{"_id":106,"_notes":[],"Q1/Leisure_time":"1","Upload_an_arbitrary_file":"E0QLjvNUYAAe-s_-14_44_17.jpeg","Taking_all_things_to_ould_you_say_you_are":"2","I_would_like_to_ask_y_much_or_not_at_all/People_you_know_personally":"1","_validation_status":{},"_uuid":"3b98cf99-b651-422b-ace9-c242ca8f9717","_tags":[],"I_would_like_to_ask_y_much_or_not_at_all/People_you_meet_for_the_first_time":"3","Generally_speaking_dealing_with_people":"8","Did_you_do_voluntary_in_the_last_6_months":"9","_xform_id_string":"aRo4wg5utWT7dwdnQQEAE7","I_would_like_to_ask_y_much_or_not_at_all/People_of_another_nationality":"2","I_would_like_to_ask_y_much_or_not_at_all/Your_family":"1","meta/instanceID":"uuid:3b98cf99-b651-422b-ace9-c242ca8f9717","_status":"submitted_via_web","I_would_like_to_ask_y_much_or_not_at_all/People_in_your_neighborhood":"2","formhub/uuid":"1f37921296654b91b8cc11e152956764","end":"2021-05-02T14:44:30.817+02:00","Q1/Friends_and_acquaintances":"2","Please_indicate_wher_the_map_is_Hamburg":"53.555892 - 9.948884 0 0","_submission_time":"2021-05-02T12:44:41","I_would_like_to_ask_y_much_or_not_at_all/People_of_another_religion":"2","Q1/Politics":"2","_attachments":[{"mimetype":"image/jpeg","download_small_url":"https://kc.correlaid.org/media/small?media_file=api_user%2Fattachments%2F1f37921296654b91b8cc11e152956764%2F3b98cf99-b651-422b-ace9-c242ca8f9717%2FE0QLjvNUYAAe-s_-14_44_17.jpeg","download_large_url":"https://kc.correlaid.org/media/large?media_file=api_user%2Fattachments%2F1f37921296654b91b8cc11e152956764%2F3b98cf99-b651-422b-ace9-c242ca8f9717%2FE0QLjvNUYAAe-s_-14_44_17.jpeg","download_url":"https://kc.correlaid.org/media/original?media_file=api_user%2Fattachments%2F1f37921296654b91b8cc11e152956764%2F3b98cf99-b651-422b-ace9-c242ca8f9717%2FE0QLjvNUYAAe-s_-14_44_17.jpeg","filename":"api_user/attachments/1f37921296654b91b8cc11e152956764/3b98cf99-b651-422b-ace9-c242ca8f9717/E0QLjvNUYAAe-s_-14_44_17.jpeg","instance":106,"download_medium_url":"https://kc.correlaid.org/media/medium?media_file=api_user%2Fattachments%2F1f37921296654b91b8cc11e152956764%2F3b98cf99-b651-422b-ace9-c242ca8f9717%2FE0QLjvNUYAAe-s_-14_44_17.jpeg","id":1,"xform":18}],"Q1/Family":"3","start":"2021-05-02T14:42:11.950+02:00","_submitted_by":null,"_geolocation":[53.555892,9.948884],"Q1/Work":"4","All_in_all_how_woul_would_you_say_it_is":"5","__version__":"vGEYKrPXZhge2uYk4toEKs","Some_people_feel_the_your_life_turns_out":"8","Q1/Religion":"3"},{"_id":107,"_notes":[],"Q1/Leisure_time":"3","Taking_all_things_to_ould_you_say_you_are":"4","I_would_like_to_ask_y_much_or_not_at_all/People_you_know_personally":"4","_validation_status":{},"_uuid":"8a12d9e0-68ab-4df6-a7e7-294a8eb66d15","_tags":[],"I_would_like_to_ask_y_much_or_not_at_all/People_you_meet_for_the_first_time":"1","Generally_speaking_dealing_with_people":"8","Did_you_do_voluntary_in_the_last_6_months":"9","_xform_id_string":"aRo4wg5utWT7dwdnQQEAE7","I_would_like_to_ask_y_much_or_not_at_all/People_of_another_nationality":"1","I_would_like_to_ask_y_much_or_not_at_all/Your_family":"4","meta/instanceID":"uuid:8a12d9e0-68ab-4df6-a7e7-294a8eb66d15","_status":"submitted_via_web","I_would_like_to_ask_y_much_or_not_at_all/People_in_your_neighborhood":"1","formhub/uuid":"1f37921296654b91b8cc11e152956764","end":"2021-05-02T16:17:10.920+02:00","Q1/Friends_and_acquaintances":"2","Please_indicate_wher_the_map_is_Hamburg":"53.894588 - 10.79745 0 0","_submission_time":"2021-05-02T14:17:12","I_would_like_to_ask_y_much_or_not_at_all/People_of_another_religion":"1","Q1/Politics":"2","_attachments":[],"Q1/Family":"3","start":"2021-05-02T14:44:30.930+02:00","_submitted_by":null,"_geolocation":[53.894588,10.79745],"Q1/Work":"2","All_in_all_how_woul_would_you_say_it_is":"3","__version__":"vGEYKrPXZhge2uYk4toEKs","Some_people_feel_the_your_life_turns_out":"10","Q1/Religion":"3"}]}' - recorded_at: 2021-07-22 06:42:41 GMT + string: '{"count":6,"next":null,"previous":null,"results":[{"_id":482,"control_over_life":"7","Taking_all_things_to_ould_you_say_you_are":"1","voluntary_activity":"8","trust_in_groups/Your_family":"1","formhub/uuid":"1f37921296654b91b8cc11e152956764","_validation_status":{},"importance_in_life/Politics":"1","_uuid":"199a3066-72a2-48b0-ade1-c186ae6cb0e7","health_self_assessment":"5","importance_in_life/Friends_and_acquaintances":"1","_tags":[],"trust_in_groups/People_you_know_personally":"2","_submitted_by":null,"_xform_id_string":"aRo4wg5utWT7dwdnQQEAE7","importance_in_life/Family":"2","trust_in_groups/People_you_meet_for_the_first_time":"3","meta/instanceID":"uuid:199a3066-72a2-48b0-ade1-c186ae6cb0e7","trust_in_groups/People_of_another_nationality":"2","trust_in_groups/People_in_your_neighborhood":"3","importance_in_life/Religion":"1","end":"2021-09-01T21:38:34.035+02:00","locate_hamburg":"60.924739 + -90.682977 0 0","_submission_time":"2021-09-01T19:38:34","_notes":[],"_attachments":[],"importance_in_life/Leisure_time":"1","start":"2021-09-01T21:36:49.742+02:00","trust_in_groups/People_of_another_religion":"2","_geolocation":[60.924739,-90.682977],"importance_in_life/Work":"1","_status":"submitted_via_web","__version__":"vkhZEtuEwyhNgJropgVs7h","trust_in_others":"2"},{"_id":484,"control_over_life":"3","Taking_all_things_to_ould_you_say_you_are":"3","voluntary_activity":"8","trust_in_groups/Your_family":"2","formhub/uuid":"1f37921296654b91b8cc11e152956764","_validation_status":{},"importance_in_life/Politics":"3","_uuid":"199a3066-72a2-48b0-ade1-c186ae6cb0e7","health_self_assessment":"3","importance_in_life/Friends_and_acquaintances":"2","_tags":[],"trust_in_groups/People_you_know_personally":"2","_submitted_by":null,"_xform_id_string":"aRo4wg5utWT7dwdnQQEAE7","importance_in_life/Family":"3","trust_in_groups/People_you_meet_for_the_first_time":"2","meta/instanceID":"uuid:199a3066-72a2-48b0-ade1-c186ae6cb0e7","trust_in_groups/People_of_another_nationality":"3","trust_in_groups/People_in_your_neighborhood":"1","importance_in_life/Religion":"3","end":"2021-09-01T21:52:25.333+02:00","locate_hamburg":"34.461879 + -126.200905 0 0","_submission_time":"2021-09-01T19:52:25","_notes":[],"_attachments":[],"importance_in_life/Leisure_time":"2","start":"2021-09-01T21:36:49.742+02:00","trust_in_groups/People_of_another_religion":"3","_geolocation":[34.461879,-126.200905],"importance_in_life/Work":"2","_status":"submitted_via_web","__version__":"vkhZEtuEwyhNgJropgVs7h","trust_in_others":"2"},{"_id":485,"control_over_life":"3","Taking_all_things_to_ould_you_say_you_are":"8","voluntary_activity":"8","trust_in_groups/Your_family":"1","formhub/uuid":"1f37921296654b91b8cc11e152956764","_validation_status":{},"importance_in_life/Politics":"2","_uuid":"199a3066-72a2-48b0-ade1-c186ae6cb0e7","health_self_assessment":"3","importance_in_life/Friends_and_acquaintances":"2","_tags":[],"trust_in_groups/People_you_know_personally":"2","_submitted_by":null,"_xform_id_string":"aRo4wg5utWT7dwdnQQEAE7","importance_in_life/Family":"1","trust_in_groups/People_you_meet_for_the_first_time":"2","meta/instanceID":"uuid:199a3066-72a2-48b0-ade1-c186ae6cb0e7","trust_in_groups/People_of_another_nationality":"3","trust_in_groups/People_in_your_neighborhood":"2","importance_in_life/Religion":"3","end":"2021-09-01T21:53:05.707+02:00","locate_hamburg":"48.52047 + 70.320327 0 0","_submission_time":"2021-09-01T19:53:05","_notes":[],"_attachments":[],"importance_in_life/Leisure_time":"2","start":"2021-09-01T21:36:49.742+02:00","trust_in_groups/People_of_another_religion":"3","_geolocation":[48.52047,70.320327],"importance_in_life/Work":"1","_status":"submitted_via_web","__version__":"vkhZEtuEwyhNgJropgVs7h","trust_in_others":"2"},{"_id":486,"control_over_life":"3","Taking_all_things_to_ould_you_say_you_are":"3","voluntary_activity":"2","trust_in_groups/Your_family":"2","formhub/uuid":"1f37921296654b91b8cc11e152956764","_validation_status":{},"importance_in_life/Politics":"3","_uuid":"199a3066-72a2-48b0-ade1-c186ae6cb0e7","health_self_assessment":"5","importance_in_life/Friends_and_acquaintances":"3","_tags":[],"trust_in_groups/People_you_know_personally":"3","_submitted_by":null,"_xform_id_string":"aRo4wg5utWT7dwdnQQEAE7","importance_in_life/Family":"2","trust_in_groups/People_you_meet_for_the_first_time":"3","meta/instanceID":"uuid:199a3066-72a2-48b0-ade1-c186ae6cb0e7","trust_in_groups/People_of_another_nationality":"2","trust_in_groups/People_in_your_neighborhood":"2","importance_in_life/Religion":"2","end":"2021-09-01T21:53:39.141+02:00","locate_hamburg":"64.520727 + 52.758186 0 0","_submission_time":"2021-09-01T19:53:39","_notes":[],"_attachments":[],"importance_in_life/Leisure_time":"3","start":"2021-09-01T21:36:49.742+02:00","_geolocation":[64.520727,52.758186],"importance_in_life/Work":"2","_status":"submitted_via_web","__version__":"vkhZEtuEwyhNgJropgVs7h","trust_in_others":"2"},{"_id":487,"control_over_life":"3","Taking_all_things_to_ould_you_say_you_are":"8","voluntary_activity":"8","trust_in_groups/Your_family":"2","formhub/uuid":"1f37921296654b91b8cc11e152956764","file_upload":"C:\\fakepath\\test.txt","_validation_status":{},"importance_in_life/Politics":"3","_uuid":"199a3066-72a2-48b0-ade1-c186ae6cb0e7","health_self_assessment":"5","importance_in_life/Friends_and_acquaintances":"2","_tags":[],"trust_in_groups/People_you_know_personally":"2","_submitted_by":null,"_xform_id_string":"aRo4wg5utWT7dwdnQQEAE7","importance_in_life/Family":"3","trust_in_groups/People_you_meet_for_the_first_time":"2","meta/instanceID":"uuid:199a3066-72a2-48b0-ade1-c186ae6cb0e7","trust_in_groups/People_of_another_nationality":"1","trust_in_groups/People_in_your_neighborhood":"2","importance_in_life/Religion":"3","end":"2021-09-01T22:05:08.083+02:00","locate_hamburg":"62.289722 + 42.957603 0 0","_submission_time":"2021-09-01T20:05:08","_notes":[],"_attachments":[],"importance_in_life/Leisure_time":"3","start":"2021-09-01T21:36:49.742+02:00","trust_in_groups/People_of_another_religion":"2","_geolocation":[62.289722,42.957603],"importance_in_life/Work":"1","_status":"submitted_via_web","__version__":"vkhZEtuEwyhNgJropgVs7h","trust_in_others":"1"},{"_id":532,"control_over_life":"5","Taking_all_things_to_ould_you_say_you_are":"2","voluntary_activity":"8","trust_in_groups/Your_family":"3","formhub/uuid":"1f37921296654b91b8cc11e152956764","file_upload":"Screenshot + 2021-09-05 at 11.39.31-12_16_32.png","_validation_status":{},"importance_in_life/Politics":"3","_uuid":"40c70c77-7d3d-4824-8e0e-43094764a75d","health_self_assessment":"2","importance_in_life/Friends_and_acquaintances":"1","_tags":[],"trust_in_groups/People_you_know_personally":"2","_submitted_by":null,"_xform_id_string":"aRo4wg5utWT7dwdnQQEAE7","importance_in_life/Family":"2","trust_in_groups/People_you_meet_for_the_first_time":"3","meta/instanceID":"uuid:40c70c77-7d3d-4824-8e0e-43094764a75d","trust_in_groups/People_of_another_nationality":"3","trust_in_groups/People_in_your_neighborhood":"2","importance_in_life/Religion":"3","end":"2021-09-05T12:16:34.661+02:00","locate_hamburg":"53.540416 + 10.037051 0.8 0.1","_submission_time":"2021-09-05T10:16:35","_notes":[],"_attachments":[{"mimetype":"image/png","download_small_url":"https://kc.correlaid.org/media/small?media_file=api_user%2Fattachments%2F1f37921296654b91b8cc11e152956764%2F40c70c77-7d3d-4824-8e0e-43094764a75d%2FScreenshot+2021-09-05+at+11.39.31-12_16_32.png","download_large_url":"https://kc.correlaid.org/media/large?media_file=api_user%2Fattachments%2F1f37921296654b91b8cc11e152956764%2F40c70c77-7d3d-4824-8e0e-43094764a75d%2FScreenshot+2021-09-05+at+11.39.31-12_16_32.png","download_url":"https://kc.correlaid.org/media/original?media_file=api_user%2Fattachments%2F1f37921296654b91b8cc11e152956764%2F40c70c77-7d3d-4824-8e0e-43094764a75d%2FScreenshot+2021-09-05+at+11.39.31-12_16_32.png","filename":"api_user/attachments/1f37921296654b91b8cc11e152956764/40c70c77-7d3d-4824-8e0e-43094764a75d/Screenshot + 2021-09-05 at 11.39.31-12_16_32.png","instance":532,"download_medium_url":"https://kc.correlaid.org/media/medium?media_file=api_user%2Fattachments%2F1f37921296654b91b8cc11e152956764%2F40c70c77-7d3d-4824-8e0e-43094764a75d%2FScreenshot+2021-09-05+at+11.39.31-12_16_32.png","id":3,"xform":18}],"importance_in_life/Leisure_time":"2","start":"2021-09-05T11:46:45.940+02:00","trust_in_groups/People_of_another_religion":"3","_geolocation":[53.540416,10.037051],"importance_in_life/Work":"1","_status":"submitted_via_web","__version__":"vkhZEtuEwyhNgJropgVs7h","trust_in_others":"1"}]}' + recorded_at: 2021-09-05 11:28:11 GMT recorded_with: vcr/0.6.0, webmockr/0.8.0 diff --git a/tests/testthat/test-asset.R b/tests/testthat/test-asset.R index 9e76289..065cd89 100644 --- a/tests/testthat/test-asset.R +++ b/tests/testthat/test-asset.R @@ -87,7 +87,7 @@ test_that("can get survey submissions from survey", { submissions_df <- asset_obj$get_submissions() }) expect_true(tibble::is_tibble(submissions_df)) - expect_equal(nrow(submissions_df), 4) + expect_equal(nrow(submissions_df), 6) print(str(submissions_df)) }) diff --git a/vignettes/articles/kobo-asset-submissions-data.yml b/vignettes/articles/kobo-asset-submissions-data.yml new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/vignettes/articles/kobo-asset-submissions-data.yml @@ -0,0 +1 @@ + diff --git a/vignettes/articles/rating_question.png b/vignettes/articles/rating_question.png new file mode 100644 index 0000000000000000000000000000000000000000..de44c0c975803400999303ae55270f8527a85c9a GIT binary patch literal 49014 zcmeFXbyr-^wl0jj6Wpx{-nhGm#sa}zLvVL@cXtU8+#$g|xI^O_EVu@LJA0pV_V2yt z1KfXZkFiGAs;W6>tX@RL+884u0)7OcQlr$=1XRJ-8%ft28zxALd$Qu&ly^{ggsl5sZ)Ce$*iG`% zALKb5Y-C=;iecL?8*hgY433Wk>A)AB(H9}m^>Gb`Z9O*~CzD4Rhm5>YKkoE5{ z7?{SiY#G^^ncO2ZNZHh{CQv`QLNZ7EqcR`U|BPJyAyul#DSOJo>4;ZhoZQ-b$(OzE zrsI_4N$w}qrVXT}gqd;Kdp`SW2|uEpLQ2fjFR_vG_72qydWLg6)r)={7{7~4yP1tm zEY!~+A=)COgdzAP?BV0)Pogw4>7UMDG13NxoOQ)o8NH{I?8{iZ}DXLJ7K2@lK2YuY|_ag5;54nC1!mK~i5bFj|p3Ka0cudH@pHR78)@{IDt zO2ZwM=7aE+#Rm)95p$>}e3*heqeY805~vT*P%OE6nY8XJVR_HJP}Bub#43maJy03c zsmn03TPQ+_QLy5K5iplV>|4~_mN3X#C>jCH1z7KbtBnN9;k?CIz?c|;GzEA$P?kOL z4)AMG?md#zhzPw3K$MMON2DMJETSTb;{;YSIBl^OEL^8>pF*SeFj3)21?qBeBL#TV zUgd<0p^Sx{DzG=4E~Emm`axa=Pb#8ZXq|x~{qHm2=8SB?gn5XZ#`vUgvc1t;>U<=V z;iy{^4)A)g6d}4>oELb1FxC*eLxxqLz6KN(->9U$2aJ;7g?$kFT0mR=shnD!zXD+) zDK9&L)9BzG@|0r z`kpo;a0VZU(So5AOD*nOKWTr?@LDgL$%bjYmcSz1?-2B!A=A0KvHI+~_PPl$h7G10 zlwer@_PirLAFm!^T<};g-j3T2#*Wgi-422y#U+Y|eh142W_|#{_R{v)CE`Wd1@Gn5 zTe0-@*5>mNij{C>dMEI>-3#;$sED z60hZQpPD|JFt`Y7J_JmVGSvSm~r;9uQSTtkU^S@7U{D zsu)>do)s#35JO$$Sc;m~srgjt`pFukE4yl_Th*!dRCO1Dp+BrfuUG~;NSUl-{j{X7 zS*}~^t#c1Anc8b&24o~WAT0LM@q+f^=HJs;dw*tj20s$lcURsBmd4-c;#2?AHSiO3LgO157+k-6b^IlyKSegznv}H=)b=mZX6UI^j?-< zdK_DAja*k<`%H3}eyzu7F!0p&mhXu3^u2JqG&ow{4!*j)XSh1L`*az5SAFBVQ+A$y zymZKWe7@Da)=dM2i}g+gXL@YW!g(3}WJav4CpGXONKQOaJXKsdcp{jt_ms*(&gf@L zf^4BoVbSy=5Nily75|QJjaEqTc?lj2zl~afFBDxDsf9g*Cm*Ya<4Jkto1!_NRvtc6 zI@54CN%#R|0+JjL*UAUag1g#09hr7(2CN5AcUN&7klB%4kxfy33G58{G7b~8GCbT9 zM~cj&Sy>jfa_ax=;f&%;CKbzPlz>ZM$w1e#v&Ln;{kH!1Drytz;yW~-gExKCLX*OhI``n;VZxim-2{G{oild3ld+po z9@6R2)zM?o-8MURKc0gpF!4k|HcHEDor8{JXVu{9qH1>qp$~WIjOqL77&fTOiyw#H zGckI%`i|Tw{JQ()?S|$4)9vOHoMzK0*V=d2gY*yLzj7ICEB3!sAIC0GxLvxfubqBx zw~D{Z+Y!$9fA{KPU;DO^M!cJKrDJ1jciQO7{`AAo9Ak(WAkgsMr1{D1$}D{bsi%hx1+$@jaGP@ z=^p4fGjNhF7jtSTx6{|I_xstk_yL>2MY}^w^n&YS(dr;>x*jW8_jt#e*Wl%cu}|TZ z!!`VRf{Ul%b*J?suT}H|l2hSpZ>9B{HqZUEscO{L<<{CYGH*=ukEU!zjbJ_;;_84-^ZvAj6ld@B<1>*_ZByk9%PxvHl^fNU-B;ytW&M0pQBexRNBH}%JC(~zclP3&zxSFKA zJmg=^)XCi3&iS*wi@N)G3q;kTmAaOTmLf>N)ZUiW*v#I0Cc zOzB~3W9Ka3Ax!T(5TO123F$Z7UDNKL%|STGV|NJ!9BlyD&d|9*KVV>H^wkn(@z{;P@*j7j-C_J3FWj}#p?mgFZK zK04h0r7WWGBgOwVks>9A_DOy#1@!;7{8wSv2jBl~Sp^50U7apajpHB9{4eW-jJN-6 z{J(R>iz4G#U`B;T7E*|VK!HaA#U*sk#j zp4IUQt~n4HlOg{c+Qh(q_=%lW#RvhXjF=L^Z!!=mUPgZR4REDb-YZ*gyra!Kqv zW;&m*#$Jy!41HaBy>1TUM2|LK?|AQP{a?m9Umt(l&6lfovEUo}IP&`Zx#)BKe!t

O}9gC_lxg6AhjK_-u<_Wr-|wTuG!+K#x3ewWb;)h_vq zCoQXXV`ioJdJer|%_m&4KkR2u9VoAxdcD2elQG6Bi@r2vd!K#x?Z~vu zsrKY2ESlt6 zWH|BKZoKGOX||m}D`biZ0-o7BA(Q7Ul)&JkcT0ivq*2AVI0u~v++)5?wyy@~eN~#9 z=l|*%k8N&Z9pchNo*3rldo@D;!pZu5FDY|M!t0_``6I#<1}iu%P#il*obILlyz6&8 z3A>4uh0_kvCF$b9e!jmSD!EI?<8kF2aGv)_8Owa&R|X2Jhwz`RU=jbkaQ8Cu&f7)Z zvl&^6TQ_qW**F(ewhjmVj^kg24*wX`8yFaU^YV-kw$7W`*Zc2NzLUy};~2jZWywcE zH`^R{*Pszex9D??VQlK-1diWNfwlgar|a+gy+#e{`A>sftGU2_~J)8zanvK@lE zCQYFKPUiYxPFb{b)%SkA6CE2Gh|&GHP`mc6EKlJ5*;3aX_kHKN@06n8X;bi7D75F; z=o6ZzzH6%B%gvlGHjrk?(BF6TL}gPFQ+WR6NZJ4DzTU9k0)V;hzUg~b5RCC5lYO?J zZzSI7?8k4`{E1xmjUx=9iym<;w)z2_GkVd7$lyr!$1%g#ox4qc|NPeonmC7KfTGhd zsdG#}6|$#Y+jbbf>vaA5yYl3sW0?*18I7mYRzpQ#%nW3}4wXb6_OcvU@pV2^$+pLS zAQcON3x>fZTuJYxy;}3MNmS{FjSr{r;~QUW-Nf|&BiVYlV*TVmXtER9qQ;j5Hi>3= zesP`>USerKY2fzk@p%0+Eb2xjIrv@Q(zwU_$IIPn`_p-MH=tJEeSP7yt{;Qj80c^G z+`joz1IQ67|E<||m73+C|DSa&QLuzvp0ax5Fqj>w%}FfiR<&wf+lj!gR$`j;{j_D( zOFsOUWZpLIQXl{8%entOT0rQ!LqB@v_`CZN`V=0Z>ZD0&1S%|C@^nO0O6olk&!*3H zlUznzw%regPK%G|xTZG?wSEgq+2qD408qv>kX(tuh_A6OOuj%r0b@u?SXDC^n1|FD4j^iLl3PFKN)TOO<$bODyQrd>NFZwtW zkCLva^G^q)B1VjkkP(pGw#mag0To7Dj9nNs2seQgIS<*ot-BvZc4IgnjnoSrzT1Up z3d}?EZg`lwLyimYu%qkzw~lqUw%k%y5ZYy&MTp?V=JP)98A11-(5FfFuHA+7u8UB% zKda?|?AW|TXeZqne~9aK^0~$L{Sq4@^6!aMR&|^wxaD_{kyB^#-<}UrzKOv!9hGLU zRF}$LNO*;$Od<&(2Y)Zrmq5Vb7NEuTKJRp|xC$jUWJYf207;D83SE!yE^1qnwR0b8 zz4Ok)v!cTJ3TgK5GfUB@OiRB*Tp6myK;kt#O+DjQpC6Ee415Y%>vn^9nm0+5YT*hr zFZX+#`42HPcAvB1)UY`k9Eod;wF8GRN5YNV#8$nrkzNtXJ zwRmLEcY+FwS!HHL;r%QZIRNjnS#lP0ZRg#}4e@#Il+ZQED>fv_eHXG!oQUy74ZS4k z|8ce*s>1!KxC*a+m;B&>gB}O+*^ShVVMB{rhQiJtVPe!$U};WiUFUl`Y4pWOR(A|k zXE5_aT7}Gd>k?iNlB1_Eq{Mj@*NqcM1>!MYOXwopHl9FoKLh)!Qk=*npwzQrf#yVC zFXMlJOg0+c)1Pw!>tBa>yS9HT3Y>T*I1C*7mWN=crT1ivyhPIHWqd#|CRT9_Hi}Y2 zfyF4-`bdD3o%iV@MeTD9*M?(Ccrd1|xwyUu>~g6x^j<%1GH zJxt-71kD53d%?3d8vPh3PHR*O{>NbKeUWI)8^nmgXc?=B;15hM??&j|^iwc1Pw@`Q zKN1(FeTFohp>JBv9-lb@CoXE9mL)gtA3ggy1j<jo3`;DKMUhl9WRc7LF^-rp36r_6fv`^7poYIY22t3AL3H?)zOgp`q`( zkdle=JKGiG+B5_%+L9|dzHh4kGZg-H>d0aJ_B#*1{ zCvCD@?MA!NdCA~hJwFUH+}0mDb@5oW8AI(q;uFh4!b6TOEO1wpMp+0z4XS!-pDE${ z5ODzl7zP**Op8mz1%Fk0%AP*A&!(GaI)b*9{OH0T<7pC(O zhC`e_p5__kIUurhRv>T7^bC9+^zt-hzxT>py6^~_z`}i}o)^O)ffL$2-pJ@tJ zB3@2zp~@Mlkk>FO1k0$ie~NiD1aXscG~z9zGjnb%Mv|xRPET7m@9Yk2od|Z6@4&wX z;3V-lO&m$vS%ZXqx5`9czR}%|k5Gk^?l?Te^~2kAn4r)>Qxy{qN7s^^zP%epuQko4 zpO^0UBj?c528Vh!Uw34Ne_%o_<7kdve9tgaobX?$^hSFfO#E?^saKHrttH1;++v*dGsFF`<26>(b2+ zl?(KndqZHZ(fzjdO7$N!S@LT*)T;xq1#l=SPU;B{C8@^&2Zd@#q$nAeor)5DE;)_7 zILSB}(CS#-x7GHZ-b`y@k|*`BG~u18*tiCF^ii5O#skFcte&GqF-22i#Lh~A=!9lx zRo~i;x9ppa*fb>jQFEFVI#4(&;G1iUz%(r4=A)n6Pg@keIy-hUD;*-igwp{(6&{l? zHQ#)7!}bl~P<#xLm2S+YW>$}n&8#hQMWU;WDj%t z`aFAwVu(!BH-?6DxG6Iu?+HH8@bDMzW=~*Eg_ZFFw+B&$580O|IVrgqYmn}mC~!TK zIjFx$j!L%AKOyyuPy5FhiD`T8!ooF5J~`RY8~ca$BSj!{_-6J-y?z-O5NN7xxS*Eh zA>pab+C%37r6rV{HO(nWH+&Je)#_1!uiU88a2D zZxOqK`G%-OSCbRH_X7~D-f!qrJrYbt5h{a70`2iP_v@5-ya4MY0&s-E4`HW}dy`+I z=RQlz&!66LGSEstOg=fE_&ctcx%JE^d?z3lD76hJrf#WY=YDWFm*eu;fxjs99(^5M z-jHlbHh#j{V9}iydqT0FEhNzQ_UdY;&vp5z_+;`FgJ>~?9KqMba!5<#XQsa%wNg_30<>Dgajuh{<)z(m`9C_$gk+y8C8U;bm=Or_N!5 zPyO~>VTwZ?l;C)a*4QI98Lx!p2A6>xLGuwujjaSXq^2`7L~FPXVJ|{GAPyJzVTOTH z!{>&ERZJr<4AaU?c!;Lu?hSx>EP~)VcoF10@w67$~ zEizL>L-XQ!kr8i@T$dXGJ3_v=a|=*iSVKkS8xqKoevM|kX}(1>{6wKtQ*T{N@%IM$+CL$iE)p~!98VO(fm^I~ z{L?H?8hHa=y<9q1JRmaFw_i(7JQqQh8#w4Q^;w}rLncN)WLujXfFIFDu)?F`zePR( zL;VskD4s#9JB>`_jc=loA7(7+8Pa2i~TG*HUuHoPAeikDUb+5Iu-X~IsohnJ%GEXBMr zGno?I6DVz%qf!q>G_~FI*;k%V^n~&qZu%}EYp(t4`6|8pCVJt99^b=}TGoG8mLirc z)BM*=bzK~%x@ShTj1kx@kdF%seN2|trN!uIyG=VX{E*oNE`y8)@U<#$CbRBa5MNmw zkgDpCoiAiy7|wlhI||iPjew_wn<3+CA=+x=XkVXcVndXWq#lC6rDd*b8fGcT+Y`wM zC{={$IJKt#6hP`smjEe?8OZ)A#7yI3v6vZG+Q0uQ6Gz_b6TL-n(;@5!=%@(q&SL zgA#07`P$JvbQ6B;=c9Gh=p%JBEYsl+Hl3OJT$`W;PbcD7wN3=P+#1heJlp4`*+Foy zR%L_?l9jhKyL>TGu@8GcsYN#JSH=k$ZPH>ggC2l@Fnc&+xB=;kiRYkDXMCBT{rF|q z^C_WL_(m-Dvq0rS|DL89dylsxOu5>~=o`)y9UjK;b9^2Cp#`iK2{)m~ybzCGx;5n1}{?>KRr!}0)x%=`YH5>qsxx94lvk%}|1A|1X9NLVbS zm2)Z?uOKjl=Khi)Sm;XS@4&;FC%aRtlE|sMKeIjXEviR8jW8y6r&m#9T%euO0{3|5 zQwW~Sq|GUfYY>yfD^ybDWZym@#0N@Mm#VBZBqo2_2&B*VX|VHW&941g%tlw43>)d2 z0pENow=pmL(6jI5zM|nkVVNSA@a&x>=P_3X0|ujaV@#5_~;|ED!S8s zROT-Biqpf)Z%@r6PR{8mesiJIBf}o_<9^drY-0_>2n?ye%?S1d`4m^JKUfgaRrrVq zUB+39AF*pcU)|%RKUrnmhMS2Fb1~O9UtA{1yAWH@kA&U7k{?N!#56y;?2urkRbT7C z5h8w$mKtSG0NXCD?X9egbiGA3vQVTgOv%~UinyJCx!6cB4g6njxj^*4uXXYH;Tz3@$pXu}&h@;$sb_W9sCGxo2a-MBAt z!!{3+ff`nA#<+2++QwEv7&$I_65J`IG({6yqC%{gll&>HgZKT`8gp2&S7QoQ$7z=q zA4{sJrxHL_q;b4S;!~n9zY5|Aa4IJO(vP$0T`4u7a7P_}wje{MUweb(g5-YE-)w#q z{R+8M{r;t_-ZO*u;D#>w!{EJ6C*WL_g^%2-`PmON#kj>#ma}uaq-}*@s&u- zGRDNi;o-qz)E?OzQTTQ0*HE|fN&I9b?!-D&k%B2_L~0b#G_y z%n3;?>SKYJ)&8f?06mx-B&=z_!68;oC#-6(L>0vhX$L{j} zkeR@=#E+34k%(LhspF?T_o^Hq47#SvL#$nCQT!-)W!G#MJA02Oxo{{>-|CIbdG<*h zYQ$8F`QZ9t4p-IrNaR!3zFnuYtg45{_tb| zqr&)59{uXHvYTJnx%z`%+k6?s{2iGGWm8fExoRcZH zZzVcFF#@-_VmwBBhDAd94qTbehRfK+3*O@9{8F19-X|C=W+2Ejw6PEV&~BNX)oOKBG;ZoJBGMXc`a z=&?l`VTE0hXo&gT%;jECG-$1)f#0$6Nd(>4HMJQ628Wk%u!#_HX#9es>1P5BY=1>G$)JtdJXJwud^q$wP02aVYD^G$Y7XiI~t~h94EI8kbX8 zB8|7V*YmfI-@Y;7juwG}-h>S55?YF8@!T2J)FC>E(OjT`2dvfxOZ`MAynBBnBfYLw zyY`1z!5N_*Hw*@sX^?kWOZ+p=WMh231IxNL82V= zOY+8hQW7sqY*bI+(g}ZPE&!DqxU{D%ibO;;n=Rw;!kI z^U$I~puV`wSxHcC-3-@MAF0Z1AVHV{O;mTur52)9Xc`1{*}(ZzG6K`~Q|NQ_S@j;L z)huBI@6e`0!cJu?k8bp1xxUDNN0d!IMp{7N3@G_$|}f_9lH7SK~xKoahPxT zn0mIz%anwIe%`0vyYDHBKe528{8Pajd2%(*(6$?yK$%eyBsSvE{?!x_TTYMe=}z>h zB$+h(S>gr}?MLR;08?N2K|yJ-I6n@e-w@WEKe&T?Oo`?M6O;jNjX@^bMDYU+8I?y2 zhvk3|8!*%OKNK3I;0j7m>&9dEK|e{T)HMQG@K__0rv6zS%V==`AO;Ce75ER0wk#a?ehQ%5}jH5J7$ zKpTuMO_jl*@rm+gxSsbAzqk3?rV3_u+U1IIg=3+=LAMQ$p;Z&edIfqRO~RuLevQNOHxbvToiMN0Pax7Pg;3qn|Yccc=gxMycOm5z>xEZZ?_9$ z*%xN{oT3(6dHK)T>_T!=j$uKapV?SeT=gWR`>8PEKA}Mop0!d$PQDXidlLDSSa@uH zLN6P$Y>KvS@`ztK&Qo~oBAE6~w!GHX))Lk)^I70!yiUsFMurj$((5@d+(hn&-KIfB!wsg(TCWOo`$mwX7yw6t6|^Lgb3G-?loiCG2Q$~J>& z{|ChM2@)G7Vw8%KaTv6?9{6I(_e~-xRHyeZNVsK}Zs_*_T7Vg=9LIKi&uW_aUd6BK zAbKU}wAZKtRRaT8Tw|6BjZLzizDUJca-;&dCNyQ`RV?@JMBA9wQzOPrd!`o&lkAfl zGX?jTl!N2Oc{;g%z~?Ib#=dw}CoRO7KRXBYKMwe_uqnStV2b=H&|L4CoDdR*T(;1Z zPgab|sQ_;P4FI#tEy)I~>_tdV;mqh~gP3phZthz$?csL$iR3$R84Vr=&Z4JG3D1c` zJVLZ&cb+#^CxM4$z_B~Mw4pf9Cl{@-TZ$ayf}vny^o>;ycaUuEv!`a2Z8>L=D^17V zwC3T#e4tRhZ^S3ppV<_i*_yx=_+68{O% z+{)6`?sKq;Y`cN1E&2W>18>_Y7h^6$91wQc02NJd$Qy)KaF=`twDXvx<>molobw8X z7lQqsP7zOC8-CZc|9~Lag#b@-AuH=yj>~Xh5UoGNz50t<=3lo$BAKNI7InUjB0(&q zL$^kRY7yo%G3*J0J?ykA_`7E`@j@K824?q;xaf;A;5SH+)$bL@)P|4%ja9M_pT*5I z)_MmPgU<+Z$(QGU{j+QR=%R(-8njKTtVW`5k!eo4k$N$18lqZ0gG`^Zb*K#d#Yg+| z81cq6k4C+5uwd;3+mnFd2?Dt`*t}prp?QlMwOq{?1A^ZSLZ*;R!`&M+uErQ8jZeh` z*pX`eVrFg#@L3x+dhb$7^>n16+8H){@jayejay6;!3hkhuoregfKD}J>CWN5goO;H zf?YmL(dW8+8$+MVLGF*CdYR>Oq40fzUU`ofd*g+WC;On}oPq z5{El0`UfHh*SC6wU7D0GpI!QGeMe-F-tf{|u^4tcSgI0Qp9+VHrg)a>420T^m-{zK zNg!HmnCH%18rMAnh)BggBgGiJ={=vNrOGP-kCE#u1jCUSV)Py)VRRWqdTB+$q4sCp z(!}c6V=t5z1&?)=HWrw{Fh9^h2zA!jig+)90411M6e3JCMX=HjJo5XMs_CNv5{S(V zO57pdr_Xt}dxdikIbD;QgE0ikWukgH!;(6wJ^ECL3S~ayq-PWcIhL}i;MeF-Jx=`? z5g|OKB;+q)UM%}LcN`=&S`w+DA-tdTBTv*4yD)Aql$zPr-mBOpM`1b>o4y#n+Io zDQ8~)2gggS9qTY7BnqXNBj`9w5h0V72A)Hgf)HQrdY7EheV+(UGn(g!mOKfYR$e*+ zS%8Fyc$;!3K@#IK{p4Fv1v#$PPN7@Go43Ypy*?G%Hx%O*R6aCZT)*h}W5Nmr6(WRy z$Vzz*75KjZkgvhBF;i&ly9!d76HD_J4mnlO7sn-icm6vDtI%@MCnyy_o6%Sp3%VJa zm8wvp7o~8p=QiS8)MIHg|3_+510xkH=Xs{smF*_Db~0UC*$=oCzsbB$>d&0>pK{p# zk|z`w$R@(ZjLHtbzy8>r(qJMfZk?zL5Iz@7u{o&d|qj7J{ zSEZ&b|7?m9y7*Dm8|SfqJdst4cZiOiNNE;5Ckt7pkRrQU?5F>HwRHBJ^{#C7pYR|m z%phM<%R6mRT(pB&tp{F^YuD`# zqx8s<1*5<{|*Y8ZRMPyw;?2mbQXZNd_~qL>7R;9g9I6H`8Mb_pGgcq6x%zB>dO zzth7xaNcrJaBAuSQrus{l`w21E;Mb;b4(_6d>u=_kk#8XG<-C?%0Lu@pao z76vem^bH!bOaXWVTZn@#df})Y>l##Ho6yx*6f;e=2xfPGu|!90AzM(* z{fYN~rWwSoN*FD)Kz6Jmb+akh2)MjXmrAk^6&Hx)tmb%ZAsFFXzw zpahVv`p)Vql7Qf9E5Q1mbCQoHHi``II8yGVW#vmHSI36@#$D}SH1$6u$qYTL@^_MW z6^%1cU>Ks%FCRi;iMdDZeu;3fW1fPvzRR+pNW>mN5I2SE2K|EFk&bVLM6g&D5}A@H zvrP&`Ng9XU^z-+J#qoEVpq9(S5E{%9Y@qk4iO`NyW6juBB)y<%m~oP#IhIV+bHbxI zFw$ZZwwS15(R|^nuJKtZwjOcEGwg@5?sj1XgR#Yd*?ppVAiLH|QNX(O0eg*X zrDv;Px5n?}RPw33-?iOcnziFUYU@UDp>4PwwM;iNMsVSUT_Xa9qOj0&NnkAVeOoqH z+1BFc&W^x>NG|gX(wthLQ`A~FpAaK_@Hw&t;{Ae*9RKmR0__|xSwb>r_t*(s*7?lO zJ1kQ+#TiHt-i4uZV}N{bw!R$CWw^N5!dQvafVe9#Wi8}LM|jv^bS;X8O58S1peJKX zDELPlN`@j}YA9ppcqNCmNe5HG@SSoUono7(^-sA_w2IVTPVBNMIL@&R#il_1`GUMV zQsaC;N3L&{pM`JQ%d!J;AZ#p~?~y{VO$~&Q2V)-|5kBO`$q;*tT`_+3>{-74@Qa}_ zm2V#uK7w=H`XUFmzWRL=*7ccT+H(22I(PP0p&d<^VR<;GOk=&9U=u>vk4f_@%M(eu zO!yL|kFAfUl~d*QMW5hE%FZ?XZS*Sl-L=bQ`{84AmAVxste5f#*S};d#o?uzlxJ|| zdmVq-V zCAYapUQsb5G-Fsb)w4Iq*fcTv#id(SnD}d@d+qwe0#lj(wysTmsAl5&=i=CvRP$d~ z#&7IG_HJ2)ecw<>KJA94-dAWwI7Xwl(<|kGTgTs39+hWY|GuHE(|xI5crE+eOTWv` zE&QttD}CI-c?eTIh4NBeDV^Ar*|u{d^(LcAyt16$Sb)H`-$S0_pZBIpvL}bWn77H| zQm_^S&o9=_RrzD&eg<`+D9`Yc$Dcp;hTP#dFT{rSaQuwr_3#-E&kv`xZ~&^LFxGoKgs)RjJklC z2qUk?`R)XPMlzUTp#hU%_EFEB-3~yL>_qbZU(Vy45&h?HPaZ}>+GHjOP~I)N#gt{HxcKc+Y4 zEvL8QMO4q1qi=>0q+Nb#Y}5z6@Yt%d*Sz1A>-2Wi>ld+Ji`;e6x2P(ZS_W&B*ha_)q1;W>=Szm7D7BzS;GRu?Ez(z33 z3GvIO^&AKBj%4k&2ObcZ+9A93_gdJGoHgNDUdU4%T6HFNBnthXX)^clOx`#MuY@+B zSJ%skNJnrH8MS|LW{T6{X&zEtYwkage6`Yum$7O*YZmOT;#k2B6W~B)w^4eXu=ks@ zv@+&H2s9pAjB|&5*3K~wHV3d(fx@!&`du1%$uTTqw2;J2CIJ%zyqIM-q8c5EZNq4c zrtnFs^UNT!%&tIz_h{CK((}hrWPoGrlhh#(3H^AXE4l8=@3H)g{#qv-*=qQn5Im$q zeK6K*ZV60DGE%jG?yBB*At3-^(0YaCJ5gQ@YNKQ)aegz}Y=`i_#_p}#&uIYu1Q4Qg zEJ9$Y=BZpeJ9`_1mpE5}jlk3Nt1z5AtA!532238%H~${7jK5qldFYY(C8m?8`}r5! z(;vCzZ~n!v85VlIxZX>B^?fTz_d)l0_fsoLT~70=vJY-s`U70Ofb1spw$K$Wn}JE* zC}~bE&(Aa~XeXIW(`h&H2~jb48k#4tGa;0szZGsaohSLrj92%_n9B1znNAjdX8Z)3 z4dByv;4+)c5WH_!^>1?dBs^;eBxCN#qG7UDc#LVLyR{@mBpFA{@TWxPt(|YWzFW0F z-&FP1ux>0QWvZ(AgIyr<7xwmTuk)CEF4tZKx3To}1$8iNg=T`3v>h8-bOr^i7 zzgEG93>TV|RG|UrsxWR~3X|}}CH(E3_%dSufgi9=ihBSG}#=@&Kxi+Rwtaq%bzc1tN_ARi1-u7s!cI&2bxXK9hdZqS$p&>RXD`jgt(R)+VdL5%o$k5 zzkkY3X=Eju)KO2+rXtf(jQ3-Tt~FfYzTfZ#6m=|>cdIUf>rK}oMBP35U-Wq%CdB!; zJ4MH1At~`}zV8@tDOdnQAaLwV{SS`BG9P>dtpI3$!df<;ZB)P6vEeLa(RUnYG5nyE zgh^`lL5!`}r*rrDNGDrUD}ddz&Fr8Q))6P;5@^%||LRx&lx&7PF0SN-`p7L7Z_oN1B~JfPmKlpOc8mW| z5_k@z#CoY!^}k7Ee3oqwtd{rxR?$pn8glE6uk_$or-D#C&>n}6;+SzhLr;h+6Gxi) zg;qNo{nuaB+o9|+^|}1m=gg+MjV--Wq3ogT`7S5QqiqB6=RsD<%TH>{_0$gzkzR0t z1J0{rJ7_d7bWC%wBa}i8C-uV^v=jqeLfZVqasoSIvkZtyk;`HYQCtZf>cUqk3pEy3 zR0@ttfZ&CisxM2}a5#X$`^W(`HJ!ZB%Ps)L4=$lh(y|x&Oj2~(rPLhZE)xQa=N-w>l_zq&8aSJhgQ`pEvd zN>0Q?M3F3dI{+^Z?M()oJ3)dRD#4Q~hw)81Fr5y5K z!FXfDk{3FYC#&aiMK=a~|HLN>9^=x}-1d||vbUQHzgEWXHHcFHW3 z--b>_G~qB1r!25}DDNnaC)P-m?jN%~-o&?XS+T|=87$t#5EWMQ?80Fb7F78KDq8Zj zT%66tVI?UQH<-d7sp<{^s*v!=n0}Jr{Zc8CAqUj|^tz+IJqm5RiBw^v=%N|vi_tu2 zI@r<=Yj8Lk&nr5e|Bt+{4$5-v`UOO~yIT-cQaS}GMWsU}9#R^l8>G8i8foe7?(Rmq zLAvE!kNe&4yZ8RSZ|0oy*O@spj59uQKlgpby4L!w-}RFrj~cTp{2<1H<0#Ig+EyK*{)O*$2} zN7DJ+)m9;!`sPAKg`?Kt?tj?SfAmUJQi__5%bW zL71nQ1bCK(2zoAJd3?%#X(%7cB?lp2Fa7yKVJIJ=(Ta;wVZtplS&|7yQFL6C7K+t9 zsx!axjijSPmsNH~HK1vI`Sc@xyV5(D$*5@+@7hITU$1A_q-k!}Od}l z?xGIgPo@V7eo*Q{VN;wGxC3)xGLOijRARUbP^F#m*KIV#sUzJ#XW ze$8=EbpfMy2X}35uq0hZ-Le)=C$tTZ3}=Q0vh|X|^%q#fpghYy_vi<#yC33es3Y3P zMdNw)6?GKyLHom`dIuTiqn|iBTq@3=j_4n98j~vWSo9y${gjsHgYVy&3gJQ?+jzahME9o0?RwzxEC7p*>y`+B`%_S%UJ??e$xzYkR+dm=07ODF;t_}xvafk#<}SV)9n5ciO4ap6&+ zYzd+f;t^YO#qK-T<46+jlKt*F%9Cc(ogRjiJvUGfp?2*TJd5C>j^|H8EzYg9=*4YGm>8P0=c`KSlEiDqAaxMqdiaoYBGNg$vnWQ?-Q(;3Dz8B_7cUXTN!7 zR#pk|lpm|YNJ$d3gyQpPf^Y?_ZAih|kOgS{h< zgOm@40{38O;2}r;gh@zuE3W)TA4`*S7&qIf!NkO|cp}UV2~jD?Nc5TK^i(&~eMNr$ zBxuieNWYNPX&n2V)v~I|Ro9Td-t@?d<$zC_Oq9KH@`G(2n=O2ll%<`o`1(U%y@MCZ zGS=I|duU`(<>`xk4bzIW>hL%Q>|q`V|J3b6UulyWDa=lG%u8|ib+AfSQVA3jGN}bL zSSSf<7q%?00qsoWSlrEHTb~W)8B)%O)iu&R@L)q$r*=ajvrH*-R&tX3p($+jv1d<% zN0&#*ZXVN3o4BHKJZu}Nqhz01`=DF!Nil1pL}Lz*_{q~EiMvo9Wy-;b|DPk57b!N=J1TC95TGhbvgGyqNtgbIEIkI(}eQm8_M4`bq;w8BuY1#rPJR z&(n;uNyYjoeN`4b&L`)sOzaL2ER7+4G#LhdQ!&3=xqHu@3iLA_8hwdi=N!wSL9MPu zRf+c1Z>i`8aS((h+foA#Yim5Xbu6tGzoWK2&9J>yi3GN1WDGm&A+^k_cpA5R844_B z85W&XaqOM4oi(xv5Hqt}1){~rO*9veBiWKm3duuo1ESPBs)O!WAA_o$k9i~yGNj$Q zIX2QeUQo!?elTTeEORak_Zns?2t5)kHrF9qWELPj>#~g=F~0g?iK`#)&nR!4_+aKX zd*FuCON|M|)@B23JQ7u&XiBQ|yqR{XBlCcdJ){J}6Wi&8{DyyR~-Dqac9&2-QE@KO=-MuTx8~zQ_t3s{z!_PU>q5W`qw~Zw4=;IUxp?PtQeE_i{

@yS``cm($Q@D^MTw3bSu_T9?I)tJ6n~aoA172jNqHfH1Gm2v{SB8bG8|B7M@F(l}N4i?GTdyE7mp@3sTeaH=4AQYXu=ZAT@(f%U0d2&*6) zhd56VOuwYy7YB$9`jyj{hG3qh&0)Kzy5tHj-g9u~Zy1 z{87fl@;2!eSgZw2I#QyKI(Fjr`R#dRG)GCcvpu`|?_H@Qbs@Hy^TU3)vBjM{sXp5L zO}OS@QJu<6L2GQw>Np~3GX=6J5NRtnlbtGqd)&jnFnY7{c_RlYG44AAP{^I}Z^Y>s zjf;l)VIxGMWO$*ZVdF4bSB78D&`0M8YJglVfw<&fZw*k|xRDgUq@jFcWF;k{)Di2@ zrQm$dQE2wihKNEyJl^PQ?oqfw&R~oZ0x52SCEZ!u2LkKe?^RhNHKAqbNdDpBY!>!& ztw_^IN<#I@6@jugbZ(jAIS&)wDCJ-240*@0>V$M-Hn@BZC;+QL1I6Id&%L#SkubTHw6$VtLkvg&^@A@#_P6gC(? z$=D-gPF7El#7UQ`q2&NcbjLG+h%yjbZ#}#brRK1PjJh9VfrX6|goE~i08)Tw*`b=vHp9fPAfx4m$aFYYrJOEQmkdzPVL4j?ISJ8Ai(>?2VoZdhxcJF&f2ag8s z&!>Hu@(Fd?m!swoWTlF*X|J$`w?C7Xn5bWTS!QcRRo6&&O)K{n6rMg@1<1*Tn#B^? z%XTN@j>T7^(xGf&!8;yZ3HmRuSgjYRP6|KiwY{7fYUNpZrS>0k$?wYGYjlrSQaLdA zLvquLKS+o+m=v*fx^&OuTlLJ;*rOXtw~wCtJtjvameQWCYD1F5)9DO4ibZ8`a`Eyi zN00p`LEWY_G=@^Cwz1Blulh9QQg!Gxgsf;`YPqas8k+y)49brtWRD=of;PLS)@h^fQBPvH2wUR z-(tAM>V%9ng|$cO$X;S^#H8sdE2K^Cuhqz4Pj89CGquRVlHu+H=HS4+HWfsc0Awe4 zs#m8);$D`)P*c;mzCpBf*}&WwrKI z`$llJY!@!=*`SeR@(_|QS*0cc+BCV{{4%HmFPb*}YZet46p?q-!Z5X-OcyJ@B8*Kl{)ZhwMUn}ZLPp4wm*eW!^VBpk(JHk#$9j92 zFFOQ0r+I#jRAyHAJzl+tEXOmkv*3n=;_toMJgwH#RKb+Oi%>le)48wQ{Y|)=EKRqi zDi>nW;kH33#ECTkd>&3?CYlYkNjGB>`@1+yIj+YmHpPAC;Sj>)dp8fxN29$s+0eS9PSOUv@6rUd&;I#^6q;d6 z(maiJ?2AQEIT*)ik|`^V_jltC(%V-wvcxQIN~Ume+4#z;Ef7K|>#=HF{x!5ffACpx zGn~@*(w#^Dytpq`Sg)q9yE5C~SG@?*DJ7iz)ov5l1nxh7YM2^G*w`R_!l(V`#qNPf zPTu{jA}~b%K6hZDGbG}Rg(WsYovIY{_q~h-cjxO)l=sV6LGT|791D(I6e#ih4|k@W zb6xc2>|g94aQ%O!`K^(F7!Ntz`;OlR>d#lfe}>(V{L*&*zkV3jf_sYG3WjTtO`q=| z)Z9ZrKya2wG_8zJG|Y;B-=~=S7p}zb5#4$XC0)G%<(f%A6^7Ao&a^5i(PmO@%=qmf z&nggJ5W?2{) zl=u+k*}~)t{AFUGYlD(zn9av%CpX&`1kmwLP(_rW-iX)C+g!7sGVn$Xk{vpeK-y%R z^T-a|!)byw!&i$hP4ss_5G8qW%>SP&N;H)e$-3VMh5i#@E}akg@ht$2ovMV*hSd;$ zqr!Vo1vdWi9;h-D)M&U~ts58G{6+cY_hJRs^*J1Qq-=|<%LYe^W#{8NK+JrXf{$Pf zcI!4L1C(y+F!O+_%{bj2buB=JQnV^1f`}khqpN^+yQyKn z{LoDhXkJ_i2wnboV0YMXQ41tS7EFs<5De!X8CJVO?I>L@)0zZ<{zx4-F7h=Ly;1*l zFMpnW!<$IfL1}PZ6UrZ+d7nTvdipVCkkKZ9CP~s_8E)L;xMJ0G{EZVJMpFyqYJ8Jn z%dE*D)<~L8`xRqaaW&9bIiHNevK@O-V>eDG#F8i7eR&S3bc|K2F>EH;CG!J)oUspx z7wI{4HAfeNT#yeD1KT5ztmD z&B-PC5&2F?t?fBfge94g@1T0ssMT&pkI;AgQ_Dj_nZ9X2<03b5Ve{_C!}SB(iXmjB z=qfdcoPUzsVJ&?7uE=HI*vyyQR;mcV1z^YIkihX=LrPHe8CkGnpJ(EqQNl?v07eDl z#p&3)8&?loge7gAtUdo{K{uz!E0H0m>A%E8?$YmP%gNtmnoF_a@iV1~e#h7zP5E`o zp!s_ImZ*BbwfCS6E3H>jr}PU!-UDX9-NxX=A6)ywC zLW1g1cp?Y-*Snr(P}V#oP^D^&);OWQYQc03(^xHZX}UXq{pa1{zy&!>M-o6XSFULr zv{3y=G9>GAvl5sZzwc7KbdT0=%$G{lM#vjk#Uhm6$S-Q#Y3g!Lk;BA4Lj>#OZX{&i z8O24cH*H4FCx9uTmSPj6oc&^17u@deJ~}3ueig^^^`QI`k3uf5>Zo}A$r?$*WPo$( zbn|vO4DL)+dHj+n^*s@XV&>I>UDI4xJk37P5DMF<``L=hZ&LXC-0;YwkqwR4{cyzl^9cpvSjzRetp;<~n?`qR zI!QS;4ru40MK22FX`b5Npeya4p)>lL0M>Qp3$!0Z)h$>HAQofP(e1~PJTK6O>3X0U zb2kp6WaX3gHebx5nk+P0ox!~X+Wf+415R3cGKn?MaWwrme{4MxxS)3>x+rx@o$5rn zaaslXDK576wB#Bx1D(;;Ug4XfsL${iCTv2f-1!KX3ghC_g|$e%$B-L+bE?EP{In}) z^iOaYGov9X>{%#I24o3-j<~RAfr}!{~8klNJG-gjx0DNYTDOZO-&>fII)T6~2|SpUP0sdjH!r)K&m zx}_`CwFGd$gRp)8tDG2r>*Mt@;LUhhTrMlcW;->rp(xF}V}dh!I1~IY37S$?{cOIm z?9}mJayLkQClT7ijazFlIo{rebq`fiA-CBq@+0MFp1%EHlb3bvQ|@C8Mijv~@}-=O z!Ue7Kgp$hHyS4zPd`+wyIpSv^(e0YLnb0C+Eo2Fd*!$;ABnEF8y1DfmNBwx;%3kq< zqRp{5`&K@1?u{8I{q_s;++h}PMYYK~5b_>}`;=36IQU*zYpBD^uD-Mh?RZTamjSHn zT%81WZq!0x=)5F~_-$A&jqq{s#LLyw+CqA;KqpLM&8C>($ z5ld#6#JFI2s7*LhOYJK#h%5~*;FhlhvqFS_*;j!~Wae@~vG=*sb}$*kxQ;iz@=q@K zrJKczQ9SN>3(q=mp8k28wf-jw9*9g?v8DtQeNgpc!YI{TYWLYFK7h^zh?2r&`1BxYc!8`4 zXK~n2U93AHJ-cMwb1RdUoq0gQ*x5(#UHkSN>Kc03 z(qQGU#h>_>>akjeDBZ8H_ilW*PI>`@S#vA8jVB|At>0_ZTNO3nYB~~Waa_UvG&y8K zvUyhKF8$hcqKBk&wXTu6W8@G;Oq^2;A)tjXO32dfYCU!{42N%F>%#ZtG?Ya?UB^@z zDXIsyDT_7ODYglj@s467Y&<2;$!0E4l*Evn@&JG2iC?Y)HPmyk!}9wk$;P3WrEE!I zNvwCQm@r7~t~kQA|4osMbJ@MM(NNr2lyB4*Bc)q7CWv4_<%mDf{aW1M=pcG@(Cc!B({056JOaqFE>Dl`nKZGn`jAXF-`e)wGm(7fgjlPs&Y#zw-SFH?J| z0}&79S#p2^ySjV#P?@@KQ+&Bxa6knq&W>I?DRX}Q=b1K&PAV`IXzW^bi?3~WXxEGCDeE7P6U4IVn;%v{m-eZoXVP zxIN+y7R4JUP~J1&?vIN)ClBEl=NlyrFN%gh_>?JOjXBN&cdEd25``XK``}4xqA6MS zM~VJRjY#z>@X{vR=mL%xuWT#Y@!X~i^#3uNBdS5^77i zZd%MGuMLMO=4Htr@kFW-(hrRIU|cbMB+h3+gGYP#b+1EqLr<51s8&w6D33cE$0~If`K$cL7u4G2Hs1>*lsx?) z@MJ-Lg=gr7-!Wyv(UKp0*Gn7!BZ`&9ho=Be)C(DG8y%$t${nXlPeC)&_~#iclyfrS zKGh&j;mJ;?kZ^DCNp?9`Ge^W1M#vMAN(7=&j!lLvmXK<#b}>Y}n8CQ*>5bNdUBLAH z<3uV2CsLHy2Q($#`KVXFr$rjx!Zdi6B1rxTJO?L`^i=#Z@=D{?oD00k@yB*orUK5< zC(6a)GXC)>;oJLG-~={nO3P^gC$KEOm=Xr}Hyr4(sYv1hywI%9Cm+Il(>JPyMN#pk z)2jvD-DkvrB#Hx`qE@CX>dOF5P#jq2y7W2=F`;B%NwMh@f2K=#8ZfH~a%f6y^>`nC z&npK~@pTZojD{h;JR@4?*8sST{1u`lJXSFdn~pv7q2T z&f=I?!zZuiB6i&N)Q3q}Ip8;Du_X;(?7iI99X|2NN|x1Rnw7<}IRt_JRpE$Jsl#g( z5+4-(x$B2qHaTYy20gPVNY2YhLa>=5Rh%{*-n)n;WYGEK@k#{z*XXMIrO1t}UTeAt zbZh^Ipbs_ZRsdPx?2=;p`^(VJ#Df67*Gt^vj|u+E7dJ4PYl+J73YKLaKzcy^%u z8;u+Y_s_@{3Znuzf{eD~KcD^c7jmf#8_r^!fE4KhAko(ME;yeIY{sZ+BXfiBbgI2= z!=JK$xI3Kot^rW-C-e8Az?K;hIEb5l_Rons#e-^+77M?3-2S!;cMklKYEUmX zdUsajMviB2y`6p0KS-Zw60r!C3|)ZA;Sw|LeZ>$wl^ya@gD3h9V!xRI);2UV5Q5qq zHr+Qa9EUJe8=QGax5o6Dd^=yT)2ssCVfIm5Bq)$R;s1fBWvF7*BxsUiw?=kAQpdY6P;$H zELgw003y=(5pYPW+ktxgI&lKE_Gcg@<)xqP??A|4HOi(W?IqgQTVDSiVXpApjqkZs^e4S+0Gn0iqC%VpRXK)MZ)8;ht<2aDdeKVGL{IcU7Qwe}J?6uF zf^p$C&=6F*0E)TQ4=@FWF)y8Aw3M}ddfB~ZMDwiM(7CGtQZx1C&JxP5(zq$C-N{o# zIRk3Xe6CGf4akKGx^rXN7+Q7p*&bOExrVEL4z!j1=tb@4eI zb8ZA6pMv--iot*76bnS@Be!5;x#uM*UDlf3sZDTi1n`_96R^gcoS5!aA}$tOgJS|f z3h&#BG!=G9?@*|?|j&gGs-%Sl~$tDb&W5gbBmOy6T&+m$EL%B z{~L7nf%kCi$7345Ee>R3isvtxe76pvJlvCKN1o$jt#7VA*=;ZRvR-aIYdJgWdiSKsezZA zZQUoZ9;~5ay(*H=D}=|7diB^%zS;{DH({I{IFF-eAE{9K_CmqcFYoBqkEC>6WYX1#A^Z*ZrwBgs9M6hBzVe#)lscpUBL}?%MuHczEFh`Kn z7n_xE{96(@tcpxer=8=iP?S$(Z&t++s9T^JsJoh9zt63G3HOPOX?+xbJR>IuKmX@A zPRa~ohWHKhg#Hijh|@* z9vj5%z(t=i6H_yG5qmFofy-_EeVvUix6LJq=*LlW)p75W8<$Mii@GIr>G=I_yiGg_ zo-x)h*t(puzo85w6nIrH6yzR74SgmVNs>_?yiM}OF$WuLcQy%|(1${_ag2LjYQsVC zjDb3m2ejTat~qBfT-Qk17h@#4c4$*wXULtc?piEz}k49(wwpadZOud*>Lg^Kgx&gLGsh39$ zw!BoN%#nJpSi9J(jxSW(!QI?3ezSt)`N6=fRLo_QR*Z3H+KfNxlMN>09ZhR9^(x?`VP9I%n9$TnbG&t{-eleU2^*&7~|)`3Gg! z$-74ugw~@JZjIhws#fzhfud*f#CM`;y`ph;fc23)M0XiDHuIfknI{`*zr6e+DlG?^ zA{Fxxc`6tXpT@4&`8(iIFy!-vkr$sUkCi{#@O=>AxKygoNlU)n)8%)o)049>R+0d` zTE#N;TJ`*Yg)`9T>UTIJ6J8*H`>v)ool{)kjo1%ECS66Q_v+^3rj?4U4)#x?>Q3`2 zV?Z*=k%MEXAM0id?J%}(SJ(y?HcSE%Zd|h-0{}sJQ+SZ*V>^Uf5IQm; z|KgP!ZJv{RHA6t>ykwzV3i1ZZq-Yb&;v#o6-l7b!aMwQYT2TV~d9h9PHXF29c_eFZ zrh@J52YG+EKNw99&-9OfwLANnK;BXpaC4jfv<=HuDXLuKVTN3rJ>BH z_fGP97=nDI5RzkuCEK)>RJo)3X7zX2KmKTtmN`QvS?TQvbZ|buW?>KUFMcuBYWq@GmQ0z9VCH9)ix-~X*xE6={9~UrHo?Z{765d zL%E*Q2Rs!1`l?)8%o{hrVj0UHf8Ea!5eoGg=D(d(1VP`(Bw?uynhOTNQz};(e#aZu zB(PkX=nda3g@8(Om0~cfFnc%d{tFH275H z+hS8)Ym{c^ALxWT_Mt)lLQBKWx6V~3fnTw?ZhwL>5@0euNZR}^mWwdpNeP@fd-Ze|2h>S7mWg#c|ORm&X9yXihlgaP4197)pf+lbkd)s zYqcH(bFwKr#a;oAKJ>^JUTE!H`v*^QQ#<&6s~;M8#tv3gDGV!z_gV3di~4&ihH z41<7--C9Yk)CI%2VN^O7_*`6hdMkO@$aYMBydbLfX*NdH$)9iDEXtd`5JAROJoQ^jeMIouaC7 zrb>YpZ9EPKKF!$NCOC-}T*c&^pt%7ipFA?NSHCmbInUvsg5tp{l{C@f1LkSo1WXYx zEuCOs%X~$z+cOzMzn}!+8F@&RY$Q9G?MqHR*#B4_utO-0ohYyZ^|+G25@~z=2V^1W z36noG-Mkj9OdZ|Is)pm2Y`7wiFW!J#?WNc-=i6Z(J~1>MlJy zA)hvSf}2jbUpwbm=UW^!obX6~3G;zSD2Plgm<#bCh_+5}5cfW5rLU1RFeFx4e}m*` zResmhQt*9GX)C`WLG1JDxdT`VYz`H6$=MU!nY^#Ga}sniiT)XyAbH5Zmt+2)$D1I} zE~AR~r&aq;p!z8Uyt6^X=mVXO|GW(TLxl^{>G8#nWudsj@5T7%Cx*$uI|FR;Xn%hh zd`5&GG~!{0$ff?5tEKXScmAgbYX83g1kn1>_S2d#mfV&W05k0%n0wIz6o-0%rUKhc zayK8$8zuw+`rpX>F<2cz6?OmaoaOe3K~<0urCv(RJf?q=!U7VyZD6G8iwmAOAs z7=J$MmKZ$WpsXMu_Z)!e!4PSkxo$5ak&O>5_XQAF@1Bryn|-}G3U!-jJ$yS)Mnv?} z#t}rG&X%C0Oks#a@$OP)e-9NPHlcHX!R-=b@YT|Xl;75bzf48rZ^Mi)p1O)Q@$Zf) z7BV3IHv@_Jo(@^I9=D?o!m)Y{ki$Lw$RL^;iBu0N`wT5X;Fo*@&EzX8yovUS=B)vZ zDCRGZRu@3>aU%wJLhNdfga0}M%~-UL;@qv<5+u$;qb{So|U z+TzLg#x>BS;{iYgEj6!tRo?4oEjnzH+f74!ua4Dt0G3k6h$r`#wLmVOnvXUCI5Vq* ze7glNFa_pJ%C3r`neC%QkTYEXG0Ov5HC^mb1tQ;*>=f5o z!P}p0(9S$&BjSW-mPnoeCA=OF*`83*v^gd9`-M|UTWLo>lbHk(#BV8wetmi}u2|wr z%d9#^2uwdg;7VvYEgC*vm7q;}l75nna*EkXyMNBq`ov~HTb@Sw_z%7uuKZmq?OseXj+X0Lvd#0q< z4HUB0EZrU0ff~9T?fs_vUm6iw+^wacLyzXAHJ5({&$K9H34atchS;)Quu)-oRA#Zm z1*AJ?^#+bM63uM^0#V%-FCjHLAcWH+JO9ke%qpUVF{TH<2>4dT<|?f~d3)9M zs!!8VVgs~Qk)B0_Hp{R_dq#e42c|f!=_AA&pUl)8ellkvt&tG7AJ?9AnW&=>G705* zTz+8n)x6tLxq~8B`%tpwMF!GAb+LQ#m3bq z;-rHsk!(qG&MK(IQZ6qnC#5XJV+vi`ExT2}#C*_jp>fX)m4P+8{JGp13~?E zA8DnGaWSof*|j4S5dwIL6Ad5?4l&Tt3%_0fF}NoYQ+}7MK;$|(W#HslUVdR7B+Eju z5m@PKX^Nq8VDxTi;=cMuFvdyJIc0`E3b0HH&^QFr2M5Dqm^LX_{RZ;@(K%os0GLs^ z3M?H9QHs84jM4^o;}QDOJ7}@}crFT4M)@OC>wdPbYTS1MYz>kh+`x`KRcm1-t$5!g zaTW){7{O#}4sS=AA=Hy!zQVUHpfOg;aS(IlXA3s%5lD*5`H`tF9=bkZMISJ%)26^E zA3()emL4n$(hZ!dJ7N0K8j-_xHVv!2N+t`g5j~q2FF46m__`lKK07^A zVS_iWuTTsBkS-~sl~N_W|8BwVF$gWAx(ZVic7S(f^Bd3NfS~s%UbV9FOWGKL^T52; zvA2s#cN{27Bq=svG9p|&CZ+dMa-|QTrbdQD_<{!#u$~yhAiIefwBymhON69>Z8AngFoR&r$_?0bt_Pb5yo<6O@bGVbFMU$0;jC_FhcR>mY^BBG=v zN;w%47EY2O_Uv=no7Rd83KL=@-c;|j#qMGDvc|s^CFNRdV?XqW{j(DIpaORh=dt0_TvRYU!t7jPYMiLrit7Xfx;{*zx&nWs-lzjB**>{v18nJKMA+tv?Xqmd<#$|TsS;yB=a8l|iRpRi_ckm_J;|B#lH0{;yzx-COR-m3 zwu$pQ6p5J{TojwO_RmT4W`Qq{F#|eouo4#N`zj9663M*L&=0u1B=W+0yVq)=ysMo6 z5JsafJH+cW^uBTZzL7eG!PKZ6qUtM9iML9j~H@^0~gD~|$O#rtF2bx9cfU{&^xm&6~c3XX6AI!Grx zT5?DnX-M1Jt+3h$=HE2nZ(-0iHu5biE%1md?no^=E3nJavhj!4<9=t4Q|6#{DdDf$+OI9WyQQxszA zx|FJ?%I8|}sx_#>JRfy1BgLm8M;aiKxIR${U8o( zI&I*fH_ZWXeauPxoeaC|b9J(&iR<-T$*pKmh?k{d&xnRBNuYM+OR*+v+V6I`w8@vn%F~p)BX2 zXGf?w<;pN(t7ZIcx1D0<0>oiU)dd8(c}o&Wg&`HGm~SUW4X3@W_h zwM)FjE92rzd2H8&@OjT=rR`_CQU7eZe7*5|pRoCu5xF@k7j zB_%x&7CPlGYG>$4QpI_ihYtwd`k^XQhYlD;pmWJhBniPi%ZZHIH?VV}jctusb@!^; z8@0<9fci&6oueYnOa{`S9~Q3NSGgZB@N=cZ8w>?gIa>J9(Ms2_4oi-^-{W@-%VA9+ zrrnDW)`V#Tn*g9L_*~%UD`}Tv0}-1**Gd0t7a)|EKNE|Z&1z5TMg0Z)n<-CeF1rlA zEpUhE6>%(MS_26CS&5DdON3RQ9KM(?~A45tTRZHCKwjm1DGfb^^gtgS!nw=h^(WA zIVB}c5WtsTj|Dlb)a=cuiWl=`#zzYFos2dJdP7_sbD@>N20a;rr6aLVC%S z4qW-^s)jdDiy4|L1Qm;tEN09uSF#pN?qojeI&d;oMLU_mnM6qTvPZuqixWx8p^QKw zdK}p}YWJODyruZ^em@DZ98diG9u*cJ4gQgzJ5_+TzMcAmS|1$&eRV5UtB+P8h&EFT zoMbABO z?s9KxH_yMOj(K$2V^qo8F8mS7SGX@!A~t)<#MvvW7^1#3f^WeB1tWKz^5SWXiru z^t|7ot!;DX#Gz!^ta_5z-1Z1fV&De#>e}?=qRqL`Oc?XVUbsy>dn6KMOGotI%r?rp z&fB7q^NmZSg3Q*-x})n_FJF|lKx$XHsdfPg?vIhiNH=i2mcKARy37*bHjA7oaMmNF z1r=j73GEw%!uW&=Ta)MzwK3c-h0cBMm0RS_3qM3FsQw&P)CiwRc($H0G23?IWPkr| z>_ApRRgxrLjd@J}*N1?tDHSy{LvK@^O9IH?RY@1--cLkr@0EQq@2VQK=p(l{$)1kB zcEr>ABh+Z-ydXC;JHddSpRGBRMXrml&TEc38?xljGEJYH^w{gbk-`PNWJ}^O2ssmA zzYm~X1z1;^2J>v|aOvYAe2*uW%@}P(AHTpx+9B7=hWaUQJrkoEnR!f`8MB|kd>u)t zRG!W2T6j;S{Q6#e+wj{x;`()A_+Z&%b}=n=(fg~E9J(|ov?*)PMHj@KB`Uz69G#`U5OdS0c$fo{%|uiU8;Le2;3ff)WBB)9-LH&WZ|ah%dz`W$XnAX&6h+}*ia`I4 zrJEm4Sbpz{R5bid!KnFGHPr3x%?vHpdF&~TlS?MSdZfs}rtCUypqI4JR1@&yfeWG)6gx`+*x1}6k|Gs zb;w~dc#I5vJXsaE<MV>LDpW4W%r;)n(&+5dc}7Z*llr_ zD}##jpF%|jQl-g8{MN3olwa0}|6XRL67Ck=PY1V1#n8rR{9wWxS}l4YH%CH2q}+ww zs4plM_3aK91^WvRd8tL3#;Sg`CT$^UFx1O1OFfjpp%joOl3&Z7&yJFMnlZ53~Ex?7>y^Yb_RLof)uZ@a|1jN|F3EsUJak~IW^KQN z!7KdAk=4pecu-$?MNQSv{Z4bD^qZqkX2vs5CUWj*oZs_-6US|yOuplrrYPMSN5ZNl z(&8!S|1|o$Fzm%DZ_h1b(}aDIy=Sn&tInu*^h-CuPF!fdF4q_evsTmtM2jqW=;{kI zgoE-d1A1dJOVCbs=c>#jXnGSLz?li*Ei$-1?;uY7Lfug;Qm-oLcslH;%e%Fi`6fz( z?$IRC)ft-fFxt~2}rA+?q@9R8*-Dv%(rQ0|6i7+)) zz0P)WwON29=&`rNklsa>*>eQ^&dM>=jd8YuPzQPDAa;akc^&L9jpxd4T{Z6o#d;MY zUMMApe}+!TU;jktV84su`->y~u{!=RMbLj!1z?F4*NGW@|NeP*q?b5hFaGugCT40= z7#Oxo>6b4Q|MmU<{V)H&@P$u=4$rd@4Th3UH5|7eakyMtmjSw4dCwN;@E^vQ1}jh`QFAj}l{Y`i5R{2+fXeEsQ9kP} zEe!s>VkT*>4Zu8l4yE`FO+0SeqlvwoxexIoVG=o(J>ZbG>W{gt) zHtuT)A_IboDbC0KH2^w#R&KjLt2B_>nhKgKeoo`adXuO;ZT^fOFa@J)4jXUK<}m=n zyu^8EMe#hK z5!pW0{3L66C+3R*?ZqCrJyn!415z2glW&!t{_Wv|MX3l8@E5Z|4O@#d$b)Wx3OEjz zn{&>)n+xv1r=?PI!q33I-T-Z|i@Rbze(p)P>W+JE7;yz^)e0`MjHe2--lYgZ^Q4UZ zoUKIAY_ch@?#0eTKGiBH(&7T$3clTi`1+M*#&a0Fui0Y(B~|*%-h^ChE`ZZG00K;N zXh-QU&a*#3@6hR8sv&pS2Qr6?4R7WuO&J$WXoMFTV}e9CUVr4n3kq5G?a=Z-3x}D5Ccy5hBqt&VM8D*g?#sEQU-}yZi3aH5&nl-|H`=yR z(TS*Bp%lge0AAUZfeg=;Z{Rto2;^-0`Z$Oj$7crc_>3-cV@2?Y+yRVl-?GII5?%wz zP6vi3wX1>8D&wvIZee&bA{2|HZ3zbZ123VvbvVCC6*Q?vEaYq-o^}ebvN(`*>lsvg z(kpP^XI8hbAHusqR0c3&pX^h0U`*b^gL+Vi=UMUkBPwIvr^l;Ak)xNHMU3)v=q8Hw|2Tgc|!trE`3wIc!qaUP<;(X-H zxWn`glT>mBm_pMvwA(7(!7p-O&^LhqyxiLsY;kT+$v!0Q!vx|HD9Y>!^YD4XSIVK% z+XBt#aWF4zp>z||rbE%@W63*CV1bPT56-Z-@qDu(o6+#a&-+H<-&N8DUW+>@`o%>H zoHgZBE#Xw|Z)6M(bIb{%RU5B1@8Xhv@QyYX(K(hS4D4c`+i2ZZT|;}~nhbl^s#0*| zQ=i4}sGBUfoP*zAK5TZ+_w94oTdel{fOD)DmUP58Zi^bUEc z!)x!>)Cn&T4B&5!mx=hI6ks7{n$coO_~*)Wt*seCS8t z>HEOE8ujw|0&e4tZ~^hqWJypJt@BBwl7{yhLwCY{&;}bYZ%^9hcuqP6{pfxVG9B|c z&Z`zYb1Pj0T5zBi)1hr-;XdTCR+g=gZB4$t|FQV0*dtSPdl<76lljJ>uXRR#gb|uw z7ZeJ};{2<6%OlP+eTCa{*zv7#H1mBX|0}Z#%gkj2O1+vN9{=){2}7U7lQ!tR38kQ) zmXB0}>zyk6tgbkc7#trqcOi*d^8s}&&KQAm=h)p&Y*v!1axi{g3~EiatEFXAqUw-d z445PFs6CRAxJ|S@#Mdd$C%)Cog!3A;lLa=)J#mjxR8u0kK$Jf&PtY=pYi%>;1Hn(L zi8pEa>HJY413$+NT`9tGI3Or||LDyAYtSBE5_r;i@r#b_EX(%Qul?U~->%(lz|xjx zZDL%JZ8)qS9hc|jVEG{SR!^Fj^1Dgmt^4PNk0FDEGj#}*ak}S(aU&`V&pXQhSdm=& z=mUcMzo`ptSyJ=uLrM4^+PmeunmTLe{_^BEeM6!3{wBeNjtZZAkWg5tlCt1lTa>Tg zv3P})HO@1^6;8E#9^|q+rsw^1eVoDxW7jR}G9i+p{%LS0E3o|r<~P{M>#l@oc9VFp z9H1Cq`PMgYqJsLXKe?5heZb@hkrel=jm~flM$$3{ccMw1Q;?Nx%MK%_L}G;(^T_EO z`Y0@)-+ViS}y8Gvkrqfzp6O?M-yNX;eD z2j+`Z0n{EEe@%Lqy!Y%+7woaNf5t71XWZ$r#L7t5LXz##lO8|!)Xya56W+I&U@UTR zZG7oowbmzdEcoHtX?*2Ptf;&h5Otq_>Dv32KRn>`q;4N8+97Y0s#^-gVSAp)Vo4fy z$ZS>Ey|EvC>0@u*^|3-FGU;JVqVPUgytD7!U5EDTd?Ik3lZyds|6nrcWJ;S{4Ohj3 zHWkTeUxhX$Hi-RJdcuf-G2;h&AK%tct(ruh`NhE@3m)y|$R=C)|3fKMCTGVbOs`JNo^NoXn zfF8D2>bJX2^dmS{#ZanY-D$j+g}hMJ{7#8`Kb4OJ#%7<=ju*PyLwsTbd0vr^EuJ0` z7W)c$!CtUMmENG=q5Ya3?WlZkAs2}+Vy^1+KDxf3)z=eP|9kZo!0Offy?RR?nFy`6 z*x4<*m&sA3{w!TVUkbS7sTZC7kwGe3) zWaymrIl7Q+a&zCEJJ}?e>3!N#Sp`{~PgQZ*^{}a}OG3(nUvIql>teUHJZ)6`}T>#tji8)zCM%c0;612prN82Z;W?0JN zHL9`Cz&b_7XrhrV>-62`peF5{C!FY1t$Z6zWe@XwHpr)oUnRVPELX=kRZn|PPC)p` z1=_1uO6}&zfm+Z#>iz!K(yqBT_~dp_q*=*VEbpb6_Oj~cH4B<*D%aMLhUpYrEPjS744$ZHR(;N2GRrS>jnmP2S{`CXWyv*wC zI(MB)5sc20^FIYuIB!sx)7V?tG%G(oFbVg;A-Dd_kv1W8`-_Y?E4F1H1<~z{Zfch9 zh%XwqoSwbL?ZSjm&a{T@ptwx0$|P!)oqbsRC5mEEb0n~`pjnF0p`ZshpY zSF-Fdwl0NwzF#viES=53KX5F;Ni;%`;NP!eVL)m1mnsht9F^OL(V5qQTVE^`CeSIy zky5qAtwg_GRW12$oVE{pO@UKy!9n`>4;mPgiN_!6R`!jBOMNgk4=S>kWn(I5itFb} zO}w76Fsm_*+>jmQxY;%Yp!_EB)u(pe0FsKN0Xqkz7yir!x@j>3ztt zr=t8neb9?n_KERpP~UQc+Gnm=cSV@%-xQ?~Gc|>0)hQ)5irdL=4={+EDkK}r{cvcd zZHOG?4EIZSk4=}O;h`vF&$ym+_U3^&NM413D`tKC#EW0JJoaLFgQ{ElXiTh^*F75r zUZNKcx#eTyF>K_CaKjTO5T*JE`fknVcb1n- zJonx_dsSaHeKE*964RAb+OpKJ(WS`sQ@goWzz}wb;+=a+$tLqp3W!Ct{1OTD?^{*L z@KPQl?{xh{;Z8bC>bUD>{b~G(+fT*3H=KU(`44e7$?F?l9+$`zJj=a>M}4Il>X?2h zQ_d$gOE9UkutxEy_|3f>b_tOpY8!6L4<3M5w8)biz9PM0dYZ$EYylJ*RFrXiU=+N={Q2WG_2Up&hsTE3b?cjnIxB{oPZw%MUN9 zL{p=ahlN~@R#wK7UY1)Jd*)9h4?_xAAtxZ~34BTBI!abo%{IIFyU-A&`=Dbu1$G}H zwh&;Q$Z2DpYzHYDN(73v%(2CMxf7(Dp%KX3?RhG>et98=<@ls=bV3CEzUY>(nf z*aoRe3w*<bEYyZ3td@aI+>tnBO-2LZoPKcCxF4OFhNI1LY}MI+Ylc=9?TMdeBtuUaNh%CeTsj4 z1p}6l3@U9%jS2#M4E2{I(1^_^hil)w09=cFeD2LF zw%KQK6lNVGup0B{=acFpfIE{Wy_RAyM|K?ey z>K$$OJ_Y?^e1<3BljI&CIIR9O`D^Pf?>8fMJg(Y)0UHoG3L`Z{^CUE+iP!;te@cf@ z&49&}hUlE&D;E?y&!+=@<1A@XS!w({<66Ms2eC}^TXxAv;Q9AUKn)&Q2S}KTxsdPI z6Cz=#KT!&*Q$ZO8v{`t63m1TPf?zEcXCBG|){yZ8^obdW@sNh6xef4M^rEgYa3c-v z;OG44k9v77%-yFzo?JB5$UUm!E2;~hx9;03Vl^SqA1iqjyVAsO zgj|fk6Oa%ahnTJ+@0}{U(YO{WZE_Oa1*TQnyg_4&D|9Qh2hvCWmJR?A8%^l$86wp_ zMexl>qdp@l-N{Xb6Q{ZnIU7)Fi1?Hki9t<1=U3O;tDr&G1`6G9Di8*jG?qQ~2}pp4 zb~ZnK@&}{mB1lgKAm(r5-Us51tWWTqBgl(I;3%x_qF(Axw~RO@6|lRB3~Z^?8K!9S zZb{JIJ`qBgj{{Jt^@Cr<+;roIbUqW#s+kLR@;huEWxvGf4V8~>E3yuEDq74$kprdV z=bD512%-2!ljTd!g^V!s8mNZyp^BV^hrb-Z>y2-|zTPSjPtTs-GUbT7K31m3>)3zg zess%(p{vAK{EjX+juidJeTC9^qOYj^mh<-306rL|dC2eTwZJ1k*i zFZ2W%T&WZ+K9WgU);P{l3Oz2%kw(`~O|O%ASusYJF;XwJ^(vfu>QuDD$kL>1!WCyC zwAE&j=ePD38vRk|^)7!FTuNNR@d|frrdJeN)Rrg7N1 zn#gF3Jabreyq;4I?Gz4k!`BI8vUc!$H_<0U4{skaM(b=Lv&As-2ElSp8-r^^2L2vnYjtew1y$ zlh1QwW>SuKfwma{)AT!^fj3I;N8AD=ezOI6Yym?QAjEuZnWa<@#mh*y98c#`5|LS?oSibEbF%Pp{zg2x z?o90u^#{ILJoE&f9=Pe0C#iL;H4i0AREOPHWW5fn3Jn14SU?hYpKTlYHWg{ZWTc9374uX&-jI^uNc-vi^!gj;C@|GOQF)w9J`hH-i_v-f1 zg#hN~d}K0T_33TBzMsYeb<6B3Z6xN>(8JfEPB8}K@wWsibbT|Qbx^%xs^NK*AtjVJ z(bX=F>~bjJPFT7SdlEF`R}pSMhpGEKzu6#==Kb@Rm{cFI!l-+488t7)oUxQ|15Ov} z=RV*EheFjPKx?O0Qu*gCv^B`)VvIQ!Cf%2QKkFhEs`HJSPZ1_A`DY|km<|=T$b3r^ zDtd#Sp{zNy0OZFcnOK!NayrEBYDi%%3E(0PmkJB0<*XTw_>`kqtQ!!hbA6YS`p(Vib{2R3#AprMj<=-d&m0UC?NvB zG$l5#a~gqbY%>I5n7kNv%ehk8)J^G_28Y$C85k=1Qdn|dBZbNwkA9%h%=k9kj;DiG zDK;rOy6nA0Tqc~2pDTIa#S49SszxX1J}8o}_PEUqYyWoHkGL zp{DI)LKefd5I1>RUi8DOtc6iGRnzzLCg8l^&5}{z)v4K6#6S5Q{r>uqF z{D7U{r&>+F#6sNF3j@baCl(!$d8@}%tA8A+Ik)$!#imy|38B9~)W}HW1O__4n=_&~Bs{l+>BVOpjlZCkL`BQ~nvVf-2J$q1*AY+%HG#)CVLEY7Q{_b8!5z3uxt?AMZ4jp{eaujet4=v|rR z>+DEXBvGcb-0(t2P2DEYsFey1g>34yIK>_Qb-h?XHSeL+B=xMoJ&;W08ZUeOcCU0S$)v7IKC zp(r7&X0D5`yddG0csesYYoXXnSw&uf$+0L(mNxm&GIIgFe`8nk6XQF1@Kq~P5bR1& zk6_n;X7gKCjeCtTCFa(3X7!%;-X@z^)zuOUDfuOy(f!N1qQOMyOWO@hoxhH|mNg+H zH{cD)mbiP-m>MTCo<_W3SwE9EIj=nD#^j0UH``RH53csG>A^i3a~?Lpp`NU7IbZdg zD;%iW*0L;)uGB;V1B1&UNbL3IAuE}&RnG$&6-d63q0C6FGk%3JP`2ve#+4x9J*E~zB6?T9Luspe7iL89*clA&>RNf5OyDfI2hu?bQAV^Nwi6=}lk=d(;8R^hIb*C-m5;~HmgH-pj+c? z4uH1i^fPI2Ic${^gCI8m8j@fwT4YcBugfkB!@)&8442~3lK2~x8L-f|7axdk@co5} zi&d+)695(oA;h3(-a89c6Q?9fE$!KQN4-;2ix}d{8)yA&psHa-u?ojOrc;6`x~Fh4 zUlHU@#qLk60`V-UcJ+HGOH_y_V5T%JRnfvouAZPDbLY09=-6Wj!3KA}O-~?LgsY~P zQT9MFAg>+b#<6Ud373~jzd%MY0Ak?*kQ^z)zA_;2mdld-!LsK5#>WAu1#5#88+KH_ zP3@{tSA*y-Alc2$8F6?lw|0^nY}Q!*bE6RFSRh4|@84cz zjV*}bY3bzxO+#206fxrM-)(`44+EwrTVzOTmUOVzqn9Bf4V)uRf-5*(59ac z;m4dP8m@Y87#U`gDYfpHtFA!VWcx;ic@EchY?RRgOX0hioS>7*_FSVoBeE4dT+dz+ z?JbzJS7}zLDS~J&S$}N^L}CZmD$A~uintDDiiS!1+&Aj{JPFyfZ|V}>xK((xoL6Nq z@?Kn-Ml3fgGSiR>YUxeuPGB-ix44R zKB;f+N4$K~+*2oDw-vd64qpUm+a2>@?UY7IW(p<@>&c=U(7^7B_V9@cQ_~&G;Efp^39b0gC*I<$kbpXZG_#kFNCz+YPjV-Fk zTy2?xsAFxd1&_3Q7;uUeWDT#~PmMY!iEU{Qat1b|vxz%t`}2cyXq5lXy!%2q`p$ea z!i~_o@=co>hT&u_cfb;v4vE`-BM9m@5@;&-fogbsLF7ZO8`sQS#2Zk-=w0dWif|Nz zgd>hL(RTw;{96nKja>v?NF^(@E);+=l)JqivPJe0f6jh`TGs5=PR7{M?EdIlu(hlo zi2XUsisTijTU>VU+42qbqC{67+@{TvyomFlc1B4Nbz?6zt!&H1&E4ylRm?b=^Bp99)ykTha15o9Mb`2< z`F0jQ?;3zjvK%Y?AnVSkf>+M&Gashj#~pl#Q%z*~H7tF*CDX*zS6#}df&3SO&w;&0 z!_48@Y-F2f6V-v{h{yn*f zHi01I3Wg#Dw17L{D<3*LJvV!A?zKAIwZJb|YC7+xs;V$dWlC>cAsQ%(EsW zE$!ybS@7<@X{WcE4OJr7P3~cPsIgEyf0whZ*ZWt!_8N%yZZ>RSj)C9W`o1(@X7CQ6 z*QttMJ^M#)GjRttpW-un9yba_HS3j!$Wn?prDdrtgwwgNgJQf6pL$P;B_FSa#4l$i zp3FP@oaPTEYan90o_>2|ckh%JNC-V6Ep%gugxAM!f5Z7giTcI;OC}e;pC-lEFr%=_t;CN zSYm(X9YU!sf;8gU7GF_jUN?a>ZmGLH)UxKVx;>)qGkx=mb52g$4$Y-}4))VH-2lDS zd5?_uCLV1`)7rszX+Jn1$2k}7mL)_{drK-!UrQ;&4}liZQ+V6kj!S20Unc6izoO9G zxH@zVm+RWqf;ac^nr!(Fe0-y3gqUs^NlcBW219D*s8$~|(J8x%@D39@CT)J{NU=2n zxy(C|^?i)=2jc<-+Mc*;=ga`L9`j3v%$L%b;f#EDST_8$b&L0xK)c3Eu7&hZz6Bid zx2|yWyBgi`dUe%rTX`khKoewBJ0MaUk(swRxW+IqZ-*pXxzXG8XwrR(zEElfQn7W_ zkeq;Y}J;`K`Euoe0`><5_i#o1_F_ybkeV(;>iEk?*#y{4%&>!@b z^JN_lW1z3(V9LV2AFV|H-M0cjyG2~#I&m#KO=QbiqafJ(qhelqXEkfFbS$mvjAQq~1XNlr#*q!VW_wMB9id)}n zlIB8uiZZhqCVY8~O`Nx{!@P+PEVbs`#VyJ7vccsDzgV4}Ol5Kz31^^E+0-VYIJr>p zU{0npvIShd(UsSB2uQQIw$E0*2SVSB?rQ(S7viETIP0UA7DJmKkHLwp!yFzligXLV zqihPho=mRh-;>$+u76Kvzdd5T*6w}2AaY6F$g@=`vJ_n9?o!NfN!YKbE%6d~`ydIduyY6?E%N_MOrXRiNu;|1LdY%pH*1lh3I z3oo#3QjPU`W9ky!>NAuC^TFY>A@_l~V~N&ZPwnsiJGE*r_>22>)h!n@?P+qk%Mgh; zhMFn!&+s@Og5lVbr)@{m&>!{rC8ipQ2gH%VPooJo20t*On~|fpHT!+^dEc~Mo$;{H z1HmKe(Mb0Y=ZW*~OTMC{a%7%MUtF4p4&UBHS=d1>$XG+8gH`3=1yP^1b=vRc5s?w> z{=TVC(p}Q%3S{J4e^|O?btuad`Suy!g@>II9FmUn3)h}iN~hRLo!9)4H_ZDQytnRuGzm0^C3G@Q6cE{@Wgi9&-e{31hG3NoeOqF=*6@g0^>YEWj~>`SE@|C)pR zy3k{mwq6su64?XhVHD;Vl#H<52EFZvWm&BvWqwFUf*(HsWXZw(*441bnTmoT4_*v{D1KT0=6 z&2oYzQkYF?-HWB!B{3qqmm+T1Fw8>sMb}E5Fd1DmaI4_tpr<}Z1;*29PpQqY5S%X( z>f6;TDVJ{%{r-6VzbzGPlBP+=h(iLItas5{*>>)$6V#*$M;@uKDj3L$_WjI@PgIjo z{Ex=|UlSQo0Q`52K!}@#D1Oaw7m2ho1J3WvJ43CPfI{$Gfd7%G7MIx26!=ZdX2Kul zxF>sKH&^0$D^ITzy9EFR9|#Kmu(@O7p@jJzYjqaeA|hmRgTkQo07v31LTG&KuI8#S z{5k#leYJoQpON=@X^MhKGt%2}99zFF6-He1oD1?ono%V8v~yl z>aKk8(&)y&8XTL=RZY3~ca;=T>D@|5I-w_X3yBQ*L6D2lh?XK~QFX_kU#Lfgp$pt8EQ1=3* zwiC4=Gu7ytqsHb?-$p0T`vmJ6nuN4J<(vKK{tn-hjMg;8-vHDq@k~t8wluqPYsw;! zB4nCb)l>7f~ZeBOR<-xrz zc_xf=DYnFIFigD4IS?Yvt#^9$P9@n4D|T;l6?;?)PuJN)3@qn?>Nd6l4u$*t2xX#< zGGk^hYn^2J9C(#AU2?(n>@4T3+1KCqE`cKQGRKb+8gW%UZ^kD~B7 P1Ai1`Rb?t~nBDsyC^KEq literal 0 HcmV?d00001 diff --git a/vignettes/articles/wrangling_survey_responses.Rmd b/vignettes/articles/wrangling_survey_responses.Rmd new file mode 100644 index 0000000..44499e5 --- /dev/null +++ b/vignettes/articles/wrangling_survey_responses.Rmd @@ -0,0 +1,233 @@ +--- +title: "Wrangling form submissions" +output: + html_document: + toc: yes + toc_depth: 3 +--- + +```{r, include = FALSE} +knitr::opts_chunk$set( + collapse = TRUE, + comment = "#>", + message = FALSE +) +``` + +## Introduction + +This article demonstrates some techniques for cleaning and wrangling data returned by the `get_submissions` method of the `Kobo` and `Asset` classes. The vignette is broken down by the different question types. In general, users should make heavy use of the question options to give [custom column names](https://support.kobotoolbox.org/question_options.html#data-column-name) and labels for answer options. This will result in better behaving column names and make data cleaning easier. + +```{r setup} +library(kbtbr) +library(tidyr) +library(stringr) +library(dplyr) +BASE_URL <- "https://kobo.correlaid.org" +``` + +```{r include=FALSE} +kobo <- + Kobo$new(base_url_v2 = BASE_URL, + kobo_token = Sys.getenv("KBTBR_TOKEN")) +vcr::use_cassette("kobo-asset-submissions-data", { + submissions_df <- kobo$get_submissions("aRo4wg5utWT7dwdnQQEAE7") +}) +``` + + +```{r eval=FALSE} +kobo <- + Kobo$new(base_url_v2 = BASE_URL, + kobo_token = Sys.getenv("KBTBR_TOKEN")) +asset_id <- "aRo4wg5utWT7dwdnQQEAE7" +submissions_df <- kobo$get_submissions(asset_id) +``` + +Let's look at the column names: +```{r} +colnames(submissions_df) +``` + +The form contains questions of several of the available types in KoboToolbox. The whole list of available types can be found [here](https://support.kobotoolbox.org/question_types.html). More information also on the [xlsform](https://xlsform.org/en/) page. + +Our test form includes: + +- select one: `Taking_all_things_to_ould_you_say_you_are` (an example for a bad question label!), `health_self_assessment`, `voluntary_activity`, `trust_in_others` +- [rating](https://support.kobotoolbox.org/rating_ranking.html#how-to-add-a-rating-question): `trust_in_groups/{category}`, `trust_in_groups/{importance_in_life}` +- range: `control_over_life` +- point (location): `locate_hamburg` +- file upload: `file_upload` + +The rest of the columns are metadata automatically added by KoboToolbox. Most of them start with `_`. + + + +## Column names +### Sorting +As could be seen above, the API does not provide a meaningful sorting of the columns. + +Some initial reordering to at least put the metadata columns to the front: + + +```{r} +library(dplyr) +submissions_df <- submissions_df %>% + select(starts_with("_"), start, end, everything()) +colnames(submissions_df) +``` + +For very large forms, it might be useful to investigate on how to sort the columns alphabetically or by the order they appeard in the form. With the small form here, we can still individually select the columns to put them into a meaningful order: + + +```{r} +submissions_df <- submissions_df %>% + select( + starts_with("_"), + start, + end, + Taking_all_things_to_ould_you_say_you_are, + starts_with("importance_in_life"), + trust_in_others, + starts_with("trust_in_groups"), + control_over_life, + voluntary_activity, + locate_hamburg, + health_self_assessment, + file_upload + ) +``` + +### Cleaning column names +Fortunately, the KoBoToolbox API already has quite sensible column names, with snakecase (i.e. "_" separator) being the default. Column names are determined by the *question name* and thus are configurable via [xlsform](https://xlsform.org/en/#the-survey-worksheet) or the KoboToolbox interface (question settings -> "Data column name"). + +Typically, it is a good idea to immediately clean column names with a function like `janitor::clean_names`. However, this might be disadvantageous when wrangling rating type questions because question name and category name are conveniently separated by a "/" for those questions. + +Hence, we can only clean the meta data column names, removing the "_" at the beginning: +```{r} +library(janitor) +renamed_meta <- submissions_df %>% + rename_with(make_clean_names, starts_with("_")) +``` + +Alternatively, we can exclude the rating questions and clean all the other names: + +```{r} +library(janitor) +renamed_except_rating <- submissions_df %>% + rename_with(make_clean_names,-starts_with(c("importance_in_life", "trust_in_groups"))) +colnames(renamed_except_rating) +``` + +For the purposes of the rest of this article, we choose the second version: + +```{r} +submissions_df <- renamed_except_rating +``` + +## Data cleaning + +### Type conversion +In general, the KoBoToolbox API will return all data as character vectors. Hence, conversion is necessary where applicable. + +To convert multiple columns at once, you can use [`dplyr::across`](https://dplyr.tidyverse.org/reference/across.html) in combination with the [tidyselect helpers](https://tidyselect.r-lib.org/reference/select_helpers.html): + + +To check which columns need converting: +```{r} +glimpse(submissions_df) +``` + +```{r} +submissions_df <- submissions_df %>% + mutate(across(c(starts_with( + c("importance_in_life", "trust_in_groups") + ), + any_of( + c( + "voluntary_activity", + "control_over_life", + "health_self_assessment", + "trust_in_others", + "Taking_all_things_to_ould_you_say_you_are" + ) + )), as.integer)) +glimpse(submissions_df) +``` + +### Location/Point type +For the geographic point question type where respondents can pick a location on a map, the response is returned as a character vector which contains the following elements seperated by whitespace: +- latitude +- longitude +- altitude +- accuracy + +```{r} +head(submissions_df$locate_hamburg) +``` + +To seperate them into their individual components, you can use `tidyr::seperate`: + + +```{r} +# define the new column names +new_column_names <- + paste("locate_hamburg", c("lat", "lon", "altitude", "accuracy"), sep = "_") + +# use separate to split the column into four columns +submissions_df <- submissions_df %>% + separate(locate_hamburg, new_column_names, sep = " ") %>% + mutate(across(starts_with("locate_hamburg"), as.numeric)) # convert to double +# inspect the result +submissions_df %>% + select(starts_with("locate_hamburg")) +``` +### Rating questions + +For rating questions - the question type corresponding to Likert scale type question matrices - one column is returned for each "subquestion". For example: + +![](rating_question.png) + +will be returned as six columns starting with the question label for the whole question, in this case `importance_in_life`: + +```{r} +submissions_df %>% + select(starts_with("importance_in_life")) +``` + +The overall question label and the label for each "subquestion" are divided by a '/'. This is an important detail for data cleaning because it allows us to use functions like `tidyr::pivot_longer` to bring the data into a long format (e.g. useful for plotting): + + +```{r} +imp_life_long <- submissions_df %>% + select(id, starts_with("importance_in_life")) %>% + pivot_longer(-id, names_to = "category", values_to = "level") %>% + mutate(category = str_remove(category, "importance_in_life/") %>% str_replace_all("_", " ")) +imp_life_long +``` + + +```{r} +library(ggplot2) +imp_life_long %>% + group_by(category) %>% + summarize(mean_level = mean(level)) %>% + ggplot(aes(x = category, y = mean_level)) + + geom_col() + + coord_flip() + + labs(title = "Mean importance in life by category", y = "mean importance", x = "category") +``` + + +You can wrap this approach in a function: +```{r} +pivot_longer_rating <- function(data, question_name) { + data %>% + select(id, starts_with(question_name)) %>% + pivot_longer(-id, names_to = "category", values_to = "level") %>% + mutate(category = str_remove(category, paste0(question_name, "/")) %>% str_replace_all("_", " ")) +} + +submissions_df %>% + pivot_longer_rating("trust_in_groups") +``` From ff84433a437604f32f13822ec90acef00629aeff Mon Sep 17 00:00:00 2001 From: Frie Date: Tue, 14 Sep 2021 08:37:17 +0200 Subject: [PATCH 17/57] first draft --- vignettes/README.Rmd | 30 +++++++++++++++++++++ vignettes/articles/get-started.Rmd | 42 ++++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+) create mode 100644 vignettes/README.Rmd create mode 100644 vignettes/articles/get-started.Rmd diff --git a/vignettes/README.Rmd b/vignettes/README.Rmd new file mode 100644 index 0000000..48ddb08 --- /dev/null +++ b/vignettes/README.Rmd @@ -0,0 +1,30 @@ +--- +title: "kbtbr" +output: github_document +--- + + +[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental) +[![R-CMD-check](https://github.com/CorrelAid/kbtbr/workflows/R-CMD-check/badge.svg)](https://github.com/CorrelAid/kbtbr/actions) +[![Codecov test coverage](https://codecov.io/gh/CorrelAid/kbtbr/branch/main/graph/badge.svg)](https://codecov.io/gh/CorrelAid/kbtbr?branch=main) + + +```{r setup, include=FALSE} +knitr::opts_chunk$set(echo = TRUE) +``` + +# Overview + +# Installation + +`kbtbr` is not on CRAN yet. You can install the current version from GitHub: + +```{r installation, eval=FALSE} +# using remotes +remotes::install_github("CorrelAid/kbtbr") + +# using devtools +devtools::install_github("CorrelAid/kbtbr") +``` + +# Documentation diff --git a/vignettes/articles/get-started.Rmd b/vignettes/articles/get-started.Rmd new file mode 100644 index 0000000..d3032e7 --- /dev/null +++ b/vignettes/articles/get-started.Rmd @@ -0,0 +1,42 @@ +--- +title: "Get started" +output: + html_document: + toc: yes + toc_depth: 3 +--- + + +```{r setup, include=FALSE} +knitr::opts_chunk$set(echo = TRUE, eval=FALSE) +devtools::load_all() +library(kbtbr) +library(dplyr) +library(purrr) +library(tidyr) + +``` + +# Overview +kbtbr uses R6 classes. + +# Authentication + +# Setup +```{r kobo} +library(kbtbr) +base_url_v2 <- Sys.getenv("KBTBR_BASE_URL") # e.g. https://kobo.correlaid.org +token <- Sys.getenv("KBTBR_TOKEN") + +kobo <- Kobo$new(base_url_v2, token) +kobo +``` + +```{r} +assets <- kobo$get_assets() +``` + +```{r} +surveys <- kobo$get_surveys() +``` + From 81199054dd345212c1d90a562ccc8d864cf1ca7c Mon Sep 17 00:00:00 2001 From: Frie Date: Tue, 14 Sep 2021 08:38:19 +0200 Subject: [PATCH 18/57] move readme to top level --- vignettes/README.Rmd => README.Rmd | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename vignettes/README.Rmd => README.Rmd (100%) diff --git a/vignettes/README.Rmd b/README.Rmd similarity index 100% rename from vignettes/README.Rmd rename to README.Rmd From 3e5dab62b2685276bd9da92e66fd10771b35cc65 Mon Sep 17 00:00:00 2001 From: Frie Date: Sun, 3 Oct 2021 18:30:38 +0200 Subject: [PATCH 19/57] readme and contributing md --- .github/CONTRIBUTING.md | 36 ++++++++++++++++++++ README.Rmd | 18 +++++++++- README.md | 75 ++++++++++++++++++----------------------- 3 files changed, 85 insertions(+), 44 deletions(-) create mode 100644 .github/CONTRIBUTING.md diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md new file mode 100644 index 0000000..f38e9e7 --- /dev/null +++ b/.github/CONTRIBUTING.md @@ -0,0 +1,36 @@ +# Contributing to kbtbr + +## Code of Conduct +By contributing to this project, you agree to abide by the terms of the [CorrelAid Code of Conduct](https://correlaid.org/about/codeofconduct/). For more technical details on how to contribute, see the [CONTRIBUTING.md](https://github.com/correlaid/kbtbr/blob/main/.github/CONTRIBUTING.md). + +## Code styling +Please style any code with the following [styler](https://styler.r-lib.org/) command: + +```r +styler::style_pkg(style = styler::tidyverse_style, indent_by = 4) +``` +## Package development workflow + +## Branching model +We follow a [feature (or topic) branching workflow](https://git-scm.com/book/en/v2/Git-Branching-Branching-Workflows). This means that you should create a new Git branch for each issue (or set of related issues) that you are working on. The branch name should contain the issue number to allow for easier cross-referencing. + +### Long-lived branches + +- `main`: default branch. Should only contain the releases of the package + hotfixes (small, critical bug fixes that can't wait until the next release) +- `dev`: this is where we develop and branch off the feature branches + +### Short-lived branches +Short-lived branches for feature development and bugfixes ("feature branches") should be branched off from the `dev` branch. + +```bash +# create branch from dev branch +git checkout dev +git switch -c 1-project-skeleton # or git checkout -b 1-project-skeleton +# ... work on your branch with add, commit, push +``` + +before making a Pull Request to `dev`, pull in the changes from the `dev` branch to avoid running into merge conflicts. With your feature branch checked out, run: + +```bash +git merge dev +``` diff --git a/README.Rmd b/README.Rmd index 48ddb08..ca448e0 100644 --- a/README.Rmd +++ b/README.Rmd @@ -13,7 +13,7 @@ output: github_document knitr::opts_chunk$set(echo = TRUE) ``` -# Overview +`kbtbr` is a wrapper for the [KoBoToolbox APIs](https://support.kobotoolbox.org/api.html). It focuses on API v2 but also makes use of v1 if required. # Installation @@ -27,4 +27,20 @@ remotes::install_github("CorrelAid/kbtbr") devtools::install_github("CorrelAid/kbtbr") ``` +# Get started + +Check out the _Get started_: + +- [stable version](https://correlaid.github.io/kbtbr/get-started) +- [development version](https://correlaid.github.io/kbtbr/dev/get-started) + # Documentation + +Documentation is available as a [`pkgdown`](https://pkgdown.r-lib.org/) website: + +- [stable version](https://correlaid.github.io/kbtbr/) +- [development version](https://correlaid.github.io/kbtbr/dev/) + +# Contributing to kbtbr + +See the [CONTRIBUTING.md](https://github.com/correlaid/kbtbr/blob/main/.github/CONTRIBUTING.md). diff --git a/README.md b/README.md index 7825ba7..ec63325 100644 --- a/README.md +++ b/README.md @@ -1,60 +1,49 @@ -# kbtbr +kbtbr +================ + -[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental) + +[![Lifecycle: +experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental) [![R-CMD-check](https://github.com/CorrelAid/kbtbr/workflows/R-CMD-check/badge.svg)](https://github.com/CorrelAid/kbtbr/actions) -[![Codecov test coverage](https://codecov.io/gh/CorrelAid/kbtbr/branch/main/graph/badge.svg)](https://codecov.io/gh/CorrelAid/kbtbr?branch=main) +[![Codecov test +coverage](https://codecov.io/gh/CorrelAid/kbtbr/branch/main/graph/badge.svg)](https://codecov.io/gh/CorrelAid/kbtbr?branch=main) -R Wrapper for the [KoboToolbox API](https://support.kobotoolbox.org/api.html). - +`kbtbr` is a wrapper for the [KoBoToolbox +APIs](https://support.kobotoolbox.org/api.html). It focuses on API v2 +but also makes use of v1 if required. -**This package is still under development. So far, there are no features here! Check back in a couple of weeks / months :)** -# Documentation -HTML documentation is available for: - -- the latest version on the `main` branch: [https://correlaid.github.io/kbtbr/main/](https://correlaid.github.io/kbtbr/main/) -- the `dev` branch [here](https://correlaid.github.io/kbtbr/dev/) +# Installation -# Contribute -## Development setup -This project uses the [`renv`](https://rstudio.github.io/renv/) package to ensure a consistent R environment across developer machines. +`kbtbr` is not on CRAN yet. You can install the current version from +GitHub: -To install the package dependencies: +``` r +# using remotes +remotes::install_github("CorrelAid/kbtbr") -```r -install.packages("renv") -renv::install() +# using devtools +devtools::install_github("CorrelAid/kbtbr") ``` -## Code styling -Please style any code with the following [styler](https://styler.r-lib.org/) command: +# Get started -```r -styler::style_pkg(style = styler::tidyverse_style, indent_by = 4) -``` -## Package development workflow +Check out the *Get started*: -## Branching model -We follow a [feature (or topic) branching workflow](https://git-scm.com/book/en/v2/Git-Branching-Branching-Workflows). This means that you should create a new Git branch for each issue (or set of related issues) that you are working on. The branch name should contain the issue number to allow for easier cross-referencing. + - [stable version](https://correlaid.github.io/kbtbr/get-started) + - [development + version](https://correlaid.github.io/kbtbr/dev/get-started) -### Long-lived branches - -- `main`: default branch. Should only contain the releases of the package + hotfixes (small, critical bug fixes that can't wait until the next release) -- `dev`: this is where we develop and branch off the feature branches +# Documentation -### Short-lived branches -Short-lived branches for feature development and bugfixes ("feature branches") should be branched off from the `dev` branch. +Documentation is available as a [`pkgdown`](https://pkgdown.r-lib.org/) +website: -```bash -# create branch from dev branch -git checkout dev -git switch -c 1-project-skeleton # or git checkout -b 1-project-skeleton -# ... work on your branch with add, commit, push -``` + - [stable version](https://correlaid.github.io/kbtbr/) + - [development version](https://correlaid.github.io/kbtbr/dev/) -before making a Pull Request to `dev`, pull in the changes from the `dev` branch to avoid running into merge conflicts. With your feature branch checked out, run: - -```bash -git merge dev -``` +# Contributing to kbtbr +See the +[CONTRIBUTING.md](https://github.com/correlaid/kbtbr/blob/main/.github/CONTRIBUTING.md). From e542c87e4f2c85983df683c5a1729792c0569868 Mon Sep 17 00:00:00 2001 From: Frie Date: Sun, 3 Oct 2021 19:00:42 +0200 Subject: [PATCH 20/57] progress on get started --- vignettes/articles/get-started.Rmd | 54 ++++++++++++++++++++++++++++-- 1 file changed, 51 insertions(+), 3 deletions(-) diff --git a/vignettes/articles/get-started.Rmd b/vignettes/articles/get-started.Rmd index d3032e7..9142621 100644 --- a/vignettes/articles/get-started.Rmd +++ b/vignettes/articles/get-started.Rmd @@ -18,20 +18,68 @@ library(tidyr) ``` # Overview -kbtbr uses R6 classes. +kbtbr is a wrapper for the [KoBoToolbox APIs](https://support.kobotoolbox.org/api.html). It focuses on API v2 but also makes use of v1 if required. + +kbtbr uses [R6](https://r6.r-lib.org/articles/Introduction.html) classes. This means it has an object-oriented user interface which might feel unfamiliar to R users at first. But don't worry - you should get used to it quickly! + -# Authentication # Setup +## Authentication + +Get an API token using any of the methods described in the [KoBoToolbox documentation](https://support.kobotoolbox.org/api.html#getting-your-api-token). +Then store it as an environment variable by opening and editing your `.Renviron`: + + +```{r eval=FALSE} +usethis::edit_r_environ() +``` + +Add your token on a new line as follows: + +``` +KBTBR_TOKEN=yourapitokenhere +``` +Save the file and restart R/RStudio. + + +Of course, you can also use local environment files or any other method to securely store the API token. + +## Base URL +In order to use kbtbr, you need to know the _base URLs_ of your KoBoToolbox server (cf. [here](https://support.kobotoolbox.org/api.html#using-the-api)). There are two _base URLs_, one for API version 2 and one for version 1. +To use the kbtbr package, you only need to specify the _base URL_ for version 2. However, certain functionalities that rely on the version 1 API will require its _base URL_. + +If you are using one of the [two hosted instances](https://support.kobotoolbox.org/server.html), those are the base URLs: + + +```{r echo=FALSE, eval=TRUE} +baseurls <- tibble::tribble( + ~version, ~`Humanitarian Server (OCHA)`, ~`Non-Humanitarian Server`, + "v2", "https://kobo.humanitarianresponse.info", "https://kf.kobotoolbox.org", + "v1", "https://kc.humanitarianresponse.info", "https://kc.kobotoolbox.org" +) + +knitr::kable(baseurls) + +``` + +## Creating the Kobo instance + +With the right base URL(s), we can create an instance of the Kobo class. + ```{r kobo} library(kbtbr) -base_url_v2 <- Sys.getenv("KBTBR_BASE_URL") # e.g. https://kobo.correlaid.org +base_url_v2 <- "https://kf.kobotoolbox.org" # replace with your base URL for v2 +base_url_v1 <- "https://kc.kobotoolbox.org" # replace with your base URL for v1 token <- Sys.getenv("KBTBR_TOKEN") kobo <- Kobo$new(base_url_v2, token) kobo ``` + +# Working with the Kobo class + ```{r} assets <- kobo$get_assets() ``` From 746d08bc76c4fd216a4176273746c7b3ef5e9958 Mon Sep 17 00:00:00 2001 From: Malte Kyhos Date: Sat, 13 Nov 2021 10:21:16 +0100 Subject: [PATCH 21/57] Running automated reformatting --- R/kobo.R | 7 +++---- tests/testthat/test-kobo.R | 35 +++++++++++++++++------------------ 2 files changed, 20 insertions(+), 22 deletions(-) diff --git a/R/kobo.R b/R/kobo.R index 7c8f4bf..dc65ad2 100644 --- a/R/kobo.R +++ b/R/kobo.R @@ -154,7 +154,7 @@ Kobo <- R6::R6Class("Kobo", #' @param show_all_cols if true returns all the columns available #' for an asset #' @return An user-friendly summary of the available surveys as a tibble - get_surveys = function(show_all_cols=FALSE) { + get_surveys = function(show_all_cols = FALSE) { assets_res <- self$get_assets() fil <- assets_res$asset_type == "survey" columns_of_interest <- c( @@ -162,12 +162,11 @@ Kobo <- R6::R6Class("Kobo", "owner__username", "parent", "has_deployment", "deployment__active", "deployment__submission_count" ) - if (show_all_cols){ - return(assets_res[fil,]) + if (show_all_cols) { + return(assets_res[fil, ]) } else { return(assets_res[fil, columns_of_interest]) } - }, #' @description diff --git a/tests/testthat/test-kobo.R b/tests/testthat/test-kobo.R index c976ed5..4419ef5 100644 --- a/tests/testthat/test-kobo.R +++ b/tests/testthat/test-kobo.R @@ -1,14 +1,14 @@ BASE_URL <- "https://kobo.correlaid.org" ASSET_COLUMNS <- c( - "url", "date_modified", "date_created", "owner", "summary", "owner__username", - "parent", "uid", - "tag_string", "settings", - "kind", "name", - "asset_type", "version_id", - "has_deployment", "deployed_version_id", - "deployment__identifier", "deployment__active", - "deployment__submission_count", "permissions", - "downloads", "data" + "url", "date_modified", "date_created", "owner", "summary", "owner__username", + "parent", "uid", + "tag_string", "settings", + "kind", "name", + "asset_type", "version_id", + "has_deployment", "deployed_version_id", + "deployment__identifier", "deployment__active", + "deployment__submission_count", "permissions", + "downloads", "data" ) #' ----------------------------------------------------------------------------- #' Testing basic properties, construction @@ -121,7 +121,7 @@ test_that("Kobo can fetch surveys", { vcr::use_cassette("kobo-get-surveys", { kobo <- Kobo$new(base_url_v2 = BASE_URL, kobo_token = Sys.getenv("KBTBR_TOKEN")) surveys <- kobo$get_surveys() - surveys_all <- kobo$get_surveys(show_all_cols=TRUE) + surveys_all <- kobo$get_surveys(show_all_cols = TRUE) }) columns_of_interest <- c( "name", "uid", "date_created", "date_modified", @@ -133,7 +133,6 @@ test_that("Kobo can fetch surveys", { expect_equal(ncol(surveys_all), 22) expect_equal(nrow(surveys_all), 40) - }) @@ -451,19 +450,19 @@ test_that("kobo$create_asset can create assets with dafault settings", { }) test_that("kobo$create_asset returns error when name isn't provided", { - kobo <- suppressMessages(Kobo$new( + kobo <- suppressMessages(Kobo$new( base_url_v2 = BASE_URL, kobo_token = Sys.getenv("KBTBR_TOKEN") )) - expect_error(kobo$create_asset(asset_type = "survey"), regexp = "is missing") + expect_error(kobo$create_asset(asset_type = "survey"), regexp = "is missing") }) test_that("kobo$create_asset returns error when asset_type isn't provided", { - kobo <- suppressMessages(Kobo$new( + kobo <- suppressMessages(Kobo$new( base_url_v2 = BASE_URL, kobo_token = Sys.getenv("KBTBR_TOKEN") )) - expect_error(kobo$create_asset(name = "vcr_test_name"), regexp = "is missing") + expect_error(kobo$create_asset(name = "vcr_test_name"), regexp = "is missing") }) test_that("kobo$import_xls_form fails because of an incorrect path", { @@ -478,7 +477,7 @@ test_that("kobo$import_xls_form fails because of an incorrect path", { }) test_that("kobo$import_xls_form fails because of the missing path", { - kobo <- suppressMessages(Kobo$new( + kobo <- suppressMessages(Kobo$new( base_url_v2 = BASE_URL, kobo_token = Sys.getenv("KBTBR_TOKEN") )) @@ -488,11 +487,11 @@ test_that("kobo$import_xls_form fails because of the missing path", { }) test_that("kobo$import_xls_form fails because of the missing name", { - kobo <- suppressMessages(Kobo$new( + kobo <- suppressMessages(Kobo$new( base_url_v2 = BASE_URL, kobo_token = Sys.getenv("KBTBR_TOKEN") )) expect_error(kobo$import_xls_form(name = "vcr_test_name"), regexp = "is missing" ) - }) +}) From 86414bbcf24bad884a370516ccde9c932a0d1c61 Mon Sep 17 00:00:00 2001 From: Malte Kyhos Date: Sat, 13 Nov 2021 10:29:40 +0100 Subject: [PATCH 22/57] Fix namespace import with checkmate --- NAMESPACE | 2 +- R/asset.R | 4 ++-- R/kobo-client.R | 3 +-- R/kobo.R | 28 ++++++++++++++-------------- R/zzz.R | 2 ++ 5 files changed, 20 insertions(+), 19 deletions(-) create mode 100644 R/zzz.R diff --git a/NAMESPACE b/NAMESPACE index ce209c7..9b2bc22 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -3,7 +3,7 @@ export("%>%") export(Kobo) export(KoboClient) -importFrom(checkmate,assert_character) +import(checkmate) importFrom(crul,HttpClient) importFrom(magrittr,"%>%") importFrom(usethis,ui_stop) diff --git a/R/asset.R b/R/asset.R index ac4722f..854078d 100644 --- a/R/asset.R +++ b/R/asset.R @@ -76,7 +76,7 @@ Asset <- R6::R6Class("Asset", initialize = function(asset_list, kobo) { # check that everything exists in list that we need needed_names <- c("uid", "name", "url", "data", "owner__username", "asset_type") - if (!checkmate::test_subset(needed_names, names(asset_list))) { + if (!test_subset(needed_names, names(asset_list))) { missing_elements <- setdiff(needed_names, names(asset_list)) %>% paste(collapse = ", ") usethis::ui_stop(glue::glue("Argument asset_list is missing the following required elements: {missing_elements}")) } @@ -89,7 +89,7 @@ Asset <- R6::R6Class("Asset", private$.type <- asset_list$asset_type # kobo instance - checkmate::assert_class(kobo, c("R6", "Kobo")) + assert_class(kobo, c("R6", "Kobo")) private$.kobo <- kobo }, diff --git a/R/kobo-client.R b/R/kobo-client.R index 9207779..c0a4f64 100644 --- a/R/kobo-client.R +++ b/R/kobo-client.R @@ -2,7 +2,6 @@ #' @description #' A class to interact with the KoboToolbox API, extending [`crul::HttpClient`]. #' @importFrom crul HttpClient -#' @importFrom checkmate assert_character #' @importFrom usethis ui_stop #' @export KoboClient <- R6::R6Class("KoboClient", @@ -22,7 +21,7 @@ KoboClient <- R6::R6Class("KoboClient", kobo_token = Sys.getenv("KBTBR_TOKEN")) { # Check and set private fields - checkmate::assert_character(kobo_token) + assert_character(kobo_token) if (kobo_token == "") { usethis::ui_stop( "No valid token detected. Set the KBTBR_TOKEN environment diff --git a/R/kobo.R b/R/kobo.R index dc65ad2..74da7fc 100644 --- a/R/kobo.R +++ b/R/kobo.R @@ -33,21 +33,21 @@ Kobo <- R6::R6Class("Kobo", # one has to pass at least base_url_v2 or session_v2 if (!xor( - checkmate::test_null(base_url_v2), - checkmate::test_null(session_v2) + test_null(base_url_v2), + test_null(session_v2) )) { stop("Either base_url_v2 or session_v2 must be provided") } - if (!checkmate::test_null(base_url_v2)) { + if (!test_null(base_url_v2)) { self$session_v2 <- KoboClient$new(base_url_v2, kobo_token) } else { self$session_v2 <- session_v2 } - if (!checkmate::test_null(base_url_v1)) { + if (!test_null(base_url_v1)) { self$session_v1 <- KoboClient$new(base_url_v1, kobo_token) - } else if (!checkmate::test_null(session_v1)) { + } else if (!test_null(session_v1)) { self$session_v1 <- session_v1 } else { # TODO: add to warning once we know what functnality is covered by v1. @@ -78,7 +78,7 @@ Kobo <- R6::R6Class("Kobo", query = query ) } else if (version == "v1") { - if (checkmate::test_null(self$session_v1)) { + if (test_null(self$session_v1)) { usethis::ui_stop( paste( "Session for API v1 is not initalized.", @@ -130,7 +130,7 @@ Kobo <- R6::R6Class("Kobo", self$session_v2$post(path = path, body = body) } } else if (version == "v1") { - if (checkmate::test_null(self$session_v1)) { + if (test_null(self$session_v1)) { usethis::ui_stop("Session for API v1 is not initalized. Please re-initalize the Kobo client with the base_url_v1 argument.") } @@ -252,13 +252,13 @@ Kobo <- R6::R6Class("Kobo", share_metadata = FALSE) { # Input validation / assertions - checkmate::assert_character(name) - checkmate::assert_character(asset_type) - checkmate::assert_logical(share_metadata) - checkmate::assert_list(sector, names = "named") - checkmate::assert_list(country, names = "named") - checkmate::assertSetEqual(names(sector), c("label", "value")) - checkmate::assertSetEqual(names(country), c("label", "value")) + assert_character(name) + assert_character(asset_type) + assert_logical(share_metadata) + assert_list(sector, names = "named") + assert_list(country, names = "named") + assertSetEqual(names(sector), c("label", "value")) + assertSetEqual(names(country), c("label", "value")) body <- list( "name" = name, diff --git a/R/zzz.R b/R/zzz.R new file mode 100644 index 0000000..dd99ba8 --- /dev/null +++ b/R/zzz.R @@ -0,0 +1,2 @@ +#' @import checkmate +NULL From f70f34d651aa0b1ce5533610b92d72e3fe6ae762 Mon Sep 17 00:00:00 2001 From: Malte Kyhos Date: Sat, 13 Nov 2021 10:32:08 +0100 Subject: [PATCH 23/57] Update docs --- man/Kobo.Rd | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/man/Kobo.Rd b/man/Kobo.Rd index a79a617..a3e8161 100644 --- a/man/Kobo.Rd +++ b/man/Kobo.Rd @@ -25,6 +25,7 @@ interactions with the various endpoints. \item \href{#method-get}{\code{Kobo$get()}} \item \href{#method-post}{\code{Kobo$post()}} \item \href{#method-get_assets}{\code{Kobo$get_assets()}} +\item \href{#method-get_surveys}{\code{Kobo$get_surveys()}} \item \href{#method-get_asset}{\code{Kobo$get_asset()}} \item \href{#method-get_submissions}{\code{Kobo$get_submissions()}} \item \href{#method-clone_asset}{\code{Kobo$clone_asset()}} @@ -131,12 +132,32 @@ Returns an object of class \code{crul::HttpResponse}. \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-get_assets}{}}} \subsection{Method \code{get_assets()}}{ -Example method to send a GET request to the \code{assets} endpoint -(due to default to \code{v2}, no further specification is needed). +Returns a list of all assets available in the server as tibble \subsection{Usage}{ \if{html}{\out{

}}\preformatted{Kobo$get_assets()}\if{html}{\out{
}} } +} +\if{html}{\out{
}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-get_surveys}{}}} +\subsection{Method \code{get_surveys()}}{ +High-level GET request for \code{surveys} endpoints endpoint +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{Kobo$get_surveys(show_all_cols = FALSE)}\if{html}{\out{
}} +} + +\subsection{Arguments}{ +\if{html}{\out{
}} +\describe{ +\item{\code{show_all_cols}}{if true returns all the columns available +for an asset} +} +\if{html}{\out{
}} +} +\subsection{Returns}{ +An user-friendly summary of the available surveys as a tibble +} } \if{html}{\out{
}} \if{html}{\out{}} From 8bc0a77f1ed629271712422b409f98103d0b61b9 Mon Sep 17 00:00:00 2001 From: Frie Date: Mon, 24 Jan 2022 15:03:01 +0100 Subject: [PATCH 24/57] get started and restructure vignettes/articles --- _pkgdown.yml | 19 + vignettes/articles/get-started.Rmd | 90 --- vignettes/articles/kobo-assets.yml | 530 ---------------- vignettes/assets/clone-asset.yml | 106 ++++ vignettes/assets/create-asset.yml | 56 ++ vignettes/assets/deploy-asset.yml | 89 +++ .../export_downloaded.xls | Bin .../get-assets.yml} | 68 +- .../get-submissions.yml} | 8 +- vignettes/assets/get-surveys.yml | 590 ++++++++++++++++++ vignettes/assets/import-xls-form.yml | 36 ++ .../{articles => assets}/rating_question.png | Bin .../xls_form_downloaded.xls | Bin .../xls_form_downloaded.xml | 0 .../response_overview.Rmd | 7 +- .../{articles => dev_only}/using_crul.Rmd | 0 vignettes/kbtbr.Rmd | 261 ++++++++ ...oClient_class.Rmd => koboclient-class.Rmd} | 73 ++- ...ses.Rmd => wrangling-survey-responses.Rmd} | 21 +- 19 files changed, 1280 insertions(+), 674 deletions(-) delete mode 100644 vignettes/articles/get-started.Rmd delete mode 100644 vignettes/articles/kobo-assets.yml create mode 100644 vignettes/assets/clone-asset.yml create mode 100644 vignettes/assets/create-asset.yml create mode 100644 vignettes/assets/deploy-asset.yml rename vignettes/{articles => assets}/export_downloaded.xls (100%) rename vignettes/{articles/kobo-assets2.yml => assets/get-assets.yml} (90%) rename vignettes/{articles/kobo-asset-submissions-data.yml => assets/get-submissions.yml} (99%) create mode 100644 vignettes/assets/get-surveys.yml create mode 100644 vignettes/assets/import-xls-form.yml rename vignettes/{articles => assets}/rating_question.png (100%) rename vignettes/{articles => assets}/xls_form_downloaded.xls (100%) rename vignettes/{articles => assets}/xls_form_downloaded.xml (100%) rename vignettes/{articles => dev_only}/response_overview.Rmd (99%) rename vignettes/{articles => dev_only}/using_crul.Rmd (100%) create mode 100644 vignettes/kbtbr.Rmd rename vignettes/{articles/KoboClient_class.Rmd => koboclient-class.Rmd} (62%) rename vignettes/{articles/wrangling_survey_responses.Rmd => wrangling-survey-responses.Rmd} (92%) diff --git a/_pkgdown.yml b/_pkgdown.yml index e69de29..bd5fc6f 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -0,0 +1,19 @@ +template: + bootstrap: 5 +navbar: + structure: + left: [intro, reference, articles, tutorials, news] + right: [search, github] + +articles: +- title: Working with kbtbr + navbar: ~ + contents: + - kbtbr + - wrangling-survey-responses + - koboclient-class +- title: For kbtbr developers + desc: > + These articles might be useful for developers who want to contribute to kbtbr. They were written in the process of developing kbtbr. + contents: + - starts_with("dev_only") diff --git a/vignettes/articles/get-started.Rmd b/vignettes/articles/get-started.Rmd deleted file mode 100644 index 9142621..0000000 --- a/vignettes/articles/get-started.Rmd +++ /dev/null @@ -1,90 +0,0 @@ ---- -title: "Get started" -output: - html_document: - toc: yes - toc_depth: 3 ---- - - -```{r setup, include=FALSE} -knitr::opts_chunk$set(echo = TRUE, eval=FALSE) -devtools::load_all() -library(kbtbr) -library(dplyr) -library(purrr) -library(tidyr) - -``` - -# Overview -kbtbr is a wrapper for the [KoBoToolbox APIs](https://support.kobotoolbox.org/api.html). It focuses on API v2 but also makes use of v1 if required. - -kbtbr uses [R6](https://r6.r-lib.org/articles/Introduction.html) classes. This means it has an object-oriented user interface which might feel unfamiliar to R users at first. But don't worry - you should get used to it quickly! - - - -# Setup -## Authentication - -Get an API token using any of the methods described in the [KoBoToolbox documentation](https://support.kobotoolbox.org/api.html#getting-your-api-token). -Then store it as an environment variable by opening and editing your `.Renviron`: - - -```{r eval=FALSE} -usethis::edit_r_environ() -``` - -Add your token on a new line as follows: - -``` -KBTBR_TOKEN=yourapitokenhere -``` -Save the file and restart R/RStudio. - - -Of course, you can also use local environment files or any other method to securely store the API token. - -## Base URL -In order to use kbtbr, you need to know the _base URLs_ of your KoBoToolbox server (cf. [here](https://support.kobotoolbox.org/api.html#using-the-api)). There are two _base URLs_, one for API version 2 and one for version 1. -To use the kbtbr package, you only need to specify the _base URL_ for version 2. However, certain functionalities that rely on the version 1 API will require its _base URL_. - -If you are using one of the [two hosted instances](https://support.kobotoolbox.org/server.html), those are the base URLs: - - -```{r echo=FALSE, eval=TRUE} -baseurls <- tibble::tribble( - ~version, ~`Humanitarian Server (OCHA)`, ~`Non-Humanitarian Server`, - "v2", "https://kobo.humanitarianresponse.info", "https://kf.kobotoolbox.org", - "v1", "https://kc.humanitarianresponse.info", "https://kc.kobotoolbox.org" -) - -knitr::kable(baseurls) - -``` - -## Creating the Kobo instance - -With the right base URL(s), we can create an instance of the Kobo class. - -```{r kobo} -library(kbtbr) -base_url_v2 <- "https://kf.kobotoolbox.org" # replace with your base URL for v2 -base_url_v1 <- "https://kc.kobotoolbox.org" # replace with your base URL for v1 -token <- Sys.getenv("KBTBR_TOKEN") - -kobo <- Kobo$new(base_url_v2, token) -kobo -``` - - -# Working with the Kobo class - -```{r} -assets <- kobo$get_assets() -``` - -```{r} -surveys <- kobo$get_surveys() -``` - diff --git a/vignettes/articles/kobo-assets.yml b/vignettes/articles/kobo-assets.yml deleted file mode 100644 index 6665e8a..0000000 --- a/vignettes/articles/kobo-assets.yml +++ /dev/null @@ -1,530 +0,0 @@ -http_interactions: -- request: - method: get - uri: https://kobo.correlaid.org/api/v2/assets/ - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3 crul/1.1.0 - Accept-Encoding: gzip, deflate - Authorization: fakebearertoken - Accept: application/json - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - server: nginx - date: Sun, 03 Oct 2021 17:13:04 GMT - content-type: application/json - content-length: '175089' - connection: keep-alive - vary: Accept, Accept-Language, Cookie, Origin - allow: GET, POST, HEAD, OPTIONS - x-kobonaut: api_user - x-frame-options: SAMEORIGIN - content-language: en - body: - encoding: UTF-8 - file: no - string: '{"count":60,"next":null,"previous":null,"results":[{"url":"https://kobo.correlaid.org/api/v2/assets/aRo4wg5utWT7dwdnQQEAE7/","date_modified":"2021-09-24T11:42:42.761924Z","date_created":"2021-05-02T12:12:11.859577Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/","summary":{"geo":true,"labels":["Please - say, for each of the following, how important it is in your life.","Work","Family","Friends - and acquaintances","Leisure time"],"columns":["name","type","label","required","kobo--score-choices","select_from_list_name","hint","parameters"],"languages":[null],"row_count":21,"default_translation":null},"owner__username":"api_user","parent":null,"uid":"aRo4wg5utWT7dwdnQQEAE7","tag_string":"","settings":{"sector":{"label":"Other","value":"Other"},"country":{"label":"Germany","value":"DEU"},"description":"Yet - another testing form for package development","share-metadata":false},"kind":"asset","name":"kbtbr - Testing Survey","asset_type":"survey","version_id":"vyzdxQoDi9hAcFngmtr7be","has_deployment":true,"deployed_version_id":"vkhZEtuEwyhNgJropgVs7h","deployment__identifier":"https://kc.correlaid.org/api_user/forms/aRo4wg5utWT7dwdnQQEAE7","deployment__active":true,"deployment__submission_count":8,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/aRo4wg5utWT7dwdnQQEAE7/permission-assignments/pTCqxaESxYx2SUYkWiALnC/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/","label":"Add - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aRo4wg5utWT7dwdnQQEAE7/permission-assignments/pyjSr8wPH8oBVMDrYi9FpE/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/","label":"Edit - form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aRo4wg5utWT7dwdnQQEAE7/permission-assignments/pJACpAkTmtp8s5p6utU9YT/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/","label":"Edit - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aRo4wg5utWT7dwdnQQEAE7/permission-assignments/pVbeK2y8YgtihrRG6byMx2/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/","label":"Delete - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aRo4wg5utWT7dwdnQQEAE7/permission-assignments/phtqCFWEDWQzNuqnZxPpBM/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/","label":"Manage - project"},{"url":"https://kobo.correlaid.org/api/v2/assets/aRo4wg5utWT7dwdnQQEAE7/permission-assignments/pNayyKXD3QNNXGr5FZEizm/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/","label":"Validate - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aRo4wg5utWT7dwdnQQEAE7/permission-assignments/poJy52KAry8a5SPPRyPThh/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/","label":"View - form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aRo4wg5utWT7dwdnQQEAE7/permission-assignments/pyDdK9tLBLkpRGakcShXPj/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/","label":"View - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aRo4wg5utWT7dwdnQQEAE7/permission-assignments/pfWCMzdRisSwRiUzzdtLsR/","user":"https://kobo.correlaid.org/api/v2/users/frie_preu/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/","label":"Edit - form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aRo4wg5utWT7dwdnQQEAE7/permission-assignments/pczJm4pANtqBCqyuMjJ2VM/","user":"https://kobo.correlaid.org/api/v2/users/frie_preu/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/","label":"View - form"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/aRo4wg5utWT7dwdnQQEAE7.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/aRo4wg5utWT7dwdnQQEAE7.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/aRo4wg5utWT7dwdnQQEAE7/data/"},{"url":"https://kobo.correlaid.org/api/v2/assets/aRguvCamLrn987Mv96CiTS/","date_modified":"2021-08-23T09:24:14.152541Z","date_created":"2021-08-23T09:24:14.152515Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/","summary":{},"owner__username":"api_user","parent":null,"uid":"aRguvCamLrn987Mv96CiTS","tag_string":"","settings":{"sector":null,"country":null,"description":"","share-metadata":false},"kind":"asset","name":"test","asset_type":"survey","version_id":"vncQSwKmSr9BoQHRy37KNT","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/aRguvCamLrn987Mv96CiTS/permission-assignments/pbSJYjG5btuXYK5ezG7KX3/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/","label":"Add - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aRguvCamLrn987Mv96CiTS/permission-assignments/pJSQdBhwfBdL7DHAStErDa/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/","label":"Edit - form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aRguvCamLrn987Mv96CiTS/permission-assignments/pmH5TqphUWPt7bGNdtFDoW/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/","label":"Edit - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aRguvCamLrn987Mv96CiTS/permission-assignments/pLfz4sqWxMA2syRiwKy88x/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/","label":"Delete - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aRguvCamLrn987Mv96CiTS/permission-assignments/pUa984PDRZDYgiVxnkGjHU/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/","label":"Manage - project"},{"url":"https://kobo.correlaid.org/api/v2/assets/aRguvCamLrn987Mv96CiTS/permission-assignments/pZVFi7t2QnxDWJhjqt23K5/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/","label":"Validate - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aRguvCamLrn987Mv96CiTS/permission-assignments/pi2kzET9b6cJBnr9AzHJ9w/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/","label":"View - form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aRguvCamLrn987Mv96CiTS/permission-assignments/pVvuvZTwxybvtD4huU7D7P/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/","label":"View - submissions"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/aRguvCamLrn987Mv96CiTS.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/aRguvCamLrn987Mv96CiTS.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/aRguvCamLrn987Mv96CiTS/data/"},{"url":"https://kobo.correlaid.org/api/v2/assets/aB7nncGhiyNcxoQ6uzPLy8/","date_modified":"2021-08-10T18:06:30.235047Z","date_created":"2021-08-10T18:06:30.235022Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/","summary":{},"owner__username":"api_user","parent":null,"uid":"aB7nncGhiyNcxoQ6uzPLy8","tag_string":"","settings":{"sector":{"label":"Arts, - Entertainment, and Recreation","value":"Arts, Entertainment, and Recreation"},"country":{"label":"Åland - Islands","value":"ALA"},"description":"qwe","share-metadata":false},"kind":"asset","name":"q","asset_type":"survey","version_id":"vjFfR9bFMmPwnj9gJNPwkd","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/aB7nncGhiyNcxoQ6uzPLy8/permission-assignments/p5LQkhcNUF4aWbtsSmS35F/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/","label":"Add - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aB7nncGhiyNcxoQ6uzPLy8/permission-assignments/pQhhKEH6fQUsDpRfnJwKTv/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/","label":"Edit - form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aB7nncGhiyNcxoQ6uzPLy8/permission-assignments/p2PwWkYJjUCZBp6nNZRtot/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/","label":"Edit - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aB7nncGhiyNcxoQ6uzPLy8/permission-assignments/p9CpSVKxa83HPDFGEjTBRi/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/","label":"Delete - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aB7nncGhiyNcxoQ6uzPLy8/permission-assignments/pwJrYzdZzLMNFzyo7Ya8ws/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/","label":"Manage - project"},{"url":"https://kobo.correlaid.org/api/v2/assets/aB7nncGhiyNcxoQ6uzPLy8/permission-assignments/p3vTyu3bgXynF5pRnVjyG8/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/","label":"Validate - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aB7nncGhiyNcxoQ6uzPLy8/permission-assignments/pe2vPNwCCs3NJ6yEjzrmSG/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/","label":"View - form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aB7nncGhiyNcxoQ6uzPLy8/permission-assignments/p3UTyQbSnQQfor98nZEGdo/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/","label":"View - submissions"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/aB7nncGhiyNcxoQ6uzPLy8.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/aB7nncGhiyNcxoQ6uzPLy8.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/aB7nncGhiyNcxoQ6uzPLy8/data/"},{"url":"https://kobo.correlaid.org/api/v2/assets/aVYGrf26S3PfV4H5NLHCXa/","date_modified":"2021-08-10T18:03:57.796483Z","date_created":"2021-08-10T18:03:57.796460Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/","summary":{},"owner__username":"api_user","parent":null,"uid":"aVYGrf26S3PfV4H5NLHCXa","tag_string":"","settings":{"sector":{"label":"Arts, - Entertainment, and Recreation","value":"Arts, Entertainment, and Recreation"},"country":{"label":"Albania","value":"ALB"},"description":"kjhsdaflkj","share-metadata":false},"kind":"asset","name":"aklsdgjh","asset_type":"survey","version_id":"vfzzyv82ucSYk8fdNy4KKr","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/aVYGrf26S3PfV4H5NLHCXa/permission-assignments/pBRwJiP44ZPwxyAmqoB2kT/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/","label":"Add - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aVYGrf26S3PfV4H5NLHCXa/permission-assignments/ppKVMt4p3U6WwJznDnfdbZ/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/","label":"Edit - form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aVYGrf26S3PfV4H5NLHCXa/permission-assignments/pvZdzn42CEJHU2T3Zy3Qnj/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/","label":"Edit - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aVYGrf26S3PfV4H5NLHCXa/permission-assignments/p2Dbp8GosSr7PKPZJBaRKD/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/","label":"Delete - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aVYGrf26S3PfV4H5NLHCXa/permission-assignments/pqJxU68YQDMEkN2oApQL3b/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/","label":"Manage - project"},{"url":"https://kobo.correlaid.org/api/v2/assets/aVYGrf26S3PfV4H5NLHCXa/permission-assignments/pYjZHDK88AnJ7Y8UCbYZ4U/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/","label":"Validate - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aVYGrf26S3PfV4H5NLHCXa/permission-assignments/pfuMuE6cZv2RD8ytUMvDZm/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/","label":"View - form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aVYGrf26S3PfV4H5NLHCXa/permission-assignments/pfYD3Ab6LMmZ37yjNgxF79/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/","label":"View - submissions"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/aVYGrf26S3PfV4H5NLHCXa.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/aVYGrf26S3PfV4H5NLHCXa.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/aVYGrf26S3PfV4H5NLHCXa/data/"},{"url":"https://kobo.correlaid.org/api/v2/assets/a6GR4hhbjwzag26tQQp97N/","date_modified":"2021-08-10T18:03:56.337126Z","date_created":"2021-08-10T18:03:56.337102Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/","summary":{},"owner__username":"api_user","parent":null,"uid":"a6GR4hhbjwzag26tQQp97N","tag_string":"","settings":{"sector":{"label":"Arts, - Entertainment, and Recreation","value":"Arts, Entertainment, and Recreation"},"country":{"label":"Albania","value":"ALB"},"description":"kjhsdaflkj","share-metadata":false},"kind":"asset","name":"aklsdgjh","asset_type":"survey","version_id":"vWwAJ2KbvhvcGzzPCGzeDC","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/a6GR4hhbjwzag26tQQp97N/permission-assignments/pZeU3m7w37q24WXsb7tQeX/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/","label":"Add - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/a6GR4hhbjwzag26tQQp97N/permission-assignments/pSf86LNDfLtn5WqepnfqhX/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/","label":"Edit - form"},{"url":"https://kobo.correlaid.org/api/v2/assets/a6GR4hhbjwzag26tQQp97N/permission-assignments/phYeVr4UA7tUfAPtVTDq7z/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/","label":"Edit - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/a6GR4hhbjwzag26tQQp97N/permission-assignments/pYCzdQ5aEJLWDZzsyi5pdK/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/","label":"Delete - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/a6GR4hhbjwzag26tQQp97N/permission-assignments/pzhN7tcxXWFuw7t2GmA5av/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/","label":"Manage - project"},{"url":"https://kobo.correlaid.org/api/v2/assets/a6GR4hhbjwzag26tQQp97N/permission-assignments/pa9XHeZdNhsJNFpgxu2m7z/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/","label":"Validate - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/a6GR4hhbjwzag26tQQp97N/permission-assignments/pcv3isSrvjYk7bAFDeC96q/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/","label":"View - form"},{"url":"https://kobo.correlaid.org/api/v2/assets/a6GR4hhbjwzag26tQQp97N/permission-assignments/pDRZTFVRNQjw26kdZkPRA5/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/","label":"View - submissions"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/a6GR4hhbjwzag26tQQp97N.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/a6GR4hhbjwzag26tQQp97N.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/a6GR4hhbjwzag26tQQp97N/data/"},{"url":"https://kobo.correlaid.org/api/v2/assets/aFKo6XhXtYRoYKnvufEDRK/","date_modified":"2021-08-10T18:00:20.026525Z","date_created":"2021-08-10T18:00:20.026503Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/","summary":{},"owner__username":"api_user","parent":null,"uid":"aFKo6XhXtYRoYKnvufEDRK","tag_string":"","settings":{"sector":{"label":"Arts, - Entertainment, and Recreation","value":"Arts, Entertainment, and Recreation"},"country":{"label":"Åland - Islands","value":"ALA"},"description":"qwe","share-metadata":false},"kind":"asset","name":"q","asset_type":"survey","version_id":"vEBCrpBMEgH2rAh73iDn3k","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/aFKo6XhXtYRoYKnvufEDRK/permission-assignments/pTD2nSHwtCXLjQsmkVNXs2/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/","label":"Add - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aFKo6XhXtYRoYKnvufEDRK/permission-assignments/pqB5fkbKacra6xRZjx8PYV/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/","label":"Edit - form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aFKo6XhXtYRoYKnvufEDRK/permission-assignments/pKEADJZbn2BPR7MAh5ChS3/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/","label":"Edit - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aFKo6XhXtYRoYKnvufEDRK/permission-assignments/pJef5YUEBg6sBasDMpMBFH/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/","label":"Delete - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aFKo6XhXtYRoYKnvufEDRK/permission-assignments/pDwSPF6WiFnDxfojdfXCDy/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/","label":"Manage - project"},{"url":"https://kobo.correlaid.org/api/v2/assets/aFKo6XhXtYRoYKnvufEDRK/permission-assignments/p3RbAbJUUgNit3U6xEG9NV/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/","label":"Validate - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aFKo6XhXtYRoYKnvufEDRK/permission-assignments/pLJxso6frfAHjQJAa9LifY/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/","label":"View - form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aFKo6XhXtYRoYKnvufEDRK/permission-assignments/pAyRQvFf2VGQMJyRKek5oF/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/","label":"View - submissions"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/aFKo6XhXtYRoYKnvufEDRK.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/aFKo6XhXtYRoYKnvufEDRK.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/aFKo6XhXtYRoYKnvufEDRK/data/"},{"url":"https://kobo.correlaid.org/api/v2/assets/a4Jx4YhpZSi8ZLjpYkTovL/","date_modified":"2021-08-10T17:55:26.824905Z","date_created":"2021-08-10T17:55:26.824883Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/","summary":{},"owner__username":"api_user","parent":null,"uid":"a4Jx4YhpZSi8ZLjpYkTovL","tag_string":"","settings":{"sector":{"label":"Arts, - Entertainment, and Recreation","value":"Arts, Entertainment, and Recreation"},"country":{"label":"Albania","value":"ALB"},"description":"kjhsdaflkj","share-metadata":false},"kind":"asset","name":"aklsdgjh","asset_type":"survey","version_id":"v73fhkPHxbpfdBW92NmXAW","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/a4Jx4YhpZSi8ZLjpYkTovL/permission-assignments/poTLJSUZ84qzpgFt8fgAB4/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/","label":"Add - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/a4Jx4YhpZSi8ZLjpYkTovL/permission-assignments/pFtSeK5S9VZs7FemGtJijm/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/","label":"Edit - form"},{"url":"https://kobo.correlaid.org/api/v2/assets/a4Jx4YhpZSi8ZLjpYkTovL/permission-assignments/pSUroxoYouXNskdYZ9HC5Q/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/","label":"Edit - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/a4Jx4YhpZSi8ZLjpYkTovL/permission-assignments/pp9z9uSCbBFHDxrQwb7nur/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/","label":"Delete - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/a4Jx4YhpZSi8ZLjpYkTovL/permission-assignments/pEVuWvXtvdM8iX7wmJ78Fp/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/","label":"Manage - project"},{"url":"https://kobo.correlaid.org/api/v2/assets/a4Jx4YhpZSi8ZLjpYkTovL/permission-assignments/pTANkTC4iqkN7zsay36G4f/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/","label":"Validate - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/a4Jx4YhpZSi8ZLjpYkTovL/permission-assignments/psQVANWRijwj2vXb7MR7G5/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/","label":"View - form"},{"url":"https://kobo.correlaid.org/api/v2/assets/a4Jx4YhpZSi8ZLjpYkTovL/permission-assignments/pFSR9iDpYDcbmbrh49EX8N/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/","label":"View - submissions"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/a4Jx4YhpZSi8ZLjpYkTovL.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/a4Jx4YhpZSi8ZLjpYkTovL.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/a4Jx4YhpZSi8ZLjpYkTovL/data/"},{"url":"https://kobo.correlaid.org/api/v2/assets/a3bi7muZnw92kgmrx3L2cH/","date_modified":"2021-08-10T16:54:12.946047Z","date_created":"2021-08-10T16:54:12.946026Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/","summary":{},"owner__username":"api_user","parent":null,"uid":"a3bi7muZnw92kgmrx3L2cH","tag_string":"","settings":{"sector":{"label":"Educational - Services / Higher Education","value":"Educational Services / Higher Education"},"country":{"label":"Åland - Islands","value":"ALA"},"description":"World","share-metadata":false},"kind":"asset","name":"Hello","asset_type":"survey","version_id":"vBuivfoVhwCUXSFvxUQNWV","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/a3bi7muZnw92kgmrx3L2cH/permission-assignments/pQe8ebhLciFRMmjEE9CNCP/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/","label":"Add - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/a3bi7muZnw92kgmrx3L2cH/permission-assignments/pgbAkgxNP49kWeAe8gfCMk/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/","label":"Edit - form"},{"url":"https://kobo.correlaid.org/api/v2/assets/a3bi7muZnw92kgmrx3L2cH/permission-assignments/ppSkBBiJPUuA5qdPHEiBwF/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/","label":"Edit - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/a3bi7muZnw92kgmrx3L2cH/permission-assignments/pCJNXH5QVHfiV6j7WwLXsx/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/","label":"Delete - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/a3bi7muZnw92kgmrx3L2cH/permission-assignments/pjBjQiWKCgyBGxZAbFnv7K/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/","label":"Manage - project"},{"url":"https://kobo.correlaid.org/api/v2/assets/a3bi7muZnw92kgmrx3L2cH/permission-assignments/po75ccbRetZUf8wH4Lnxiv/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/","label":"Validate - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/a3bi7muZnw92kgmrx3L2cH/permission-assignments/pbt7MGeYbRpsTThWn6eBSU/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/","label":"View - form"},{"url":"https://kobo.correlaid.org/api/v2/assets/a3bi7muZnw92kgmrx3L2cH/permission-assignments/p6syNWbfyDudBVKPWwFtQ6/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/","label":"View - submissions"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/a3bi7muZnw92kgmrx3L2cH.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/a3bi7muZnw92kgmrx3L2cH.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/a3bi7muZnw92kgmrx3L2cH/data/"},{"url":"https://kobo.correlaid.org/api/v2/assets/aj88soPozxDVg2WCnMGVzX/","date_modified":"2021-08-09T21:14:17.153977Z","date_created":"2021-08-09T21:14:17.153939Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/","summary":{"geo":false,"labels":["Your - name","Your age","Your favourite dog","Your favourite cat"],"columns":["type","name","label","required","select_from_list_name","calculation"],"languages":[null],"row_count":5,"default_translation":null},"owner__username":"api_user","parent":null,"uid":"aj88soPozxDVg2WCnMGVzX","tag_string":"","settings":{},"kind":"asset","name":"amP4TBwoEcCAzBMZJ96ata","asset_type":"block","version_id":"vTAwyyPiQBsCM7tqFB2dUw","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/aj88soPozxDVg2WCnMGVzX/permission-assignments/pQkLPqESkNkUBrkMjxwDoG/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/","label":"Edit - block"},{"url":"https://kobo.correlaid.org/api/v2/assets/aj88soPozxDVg2WCnMGVzX/permission-assignments/pGWjansPZeRCbbevnaTdcL/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/","label":"Manage - block"},{"url":"https://kobo.correlaid.org/api/v2/assets/aj88soPozxDVg2WCnMGVzX/permission-assignments/pbAyyYaYNvfFWnhNtXKssT/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/","label":"View - block"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/aj88soPozxDVg2WCnMGVzX.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/aj88soPozxDVg2WCnMGVzX.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/aj88soPozxDVg2WCnMGVzX/data/"},{"url":"https://kobo.correlaid.org/api/v2/assets/amP4TBwoEcCAzBMZJ96ata/","date_modified":"2021-08-09T21:09:30.189833Z","date_created":"2021-06-22T19:27:08.246420Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/","summary":{"geo":false,"labels":["Your - name","Your age","Your favourite dog","Your favourite cat"],"columns":["type","label","required","select_from_list_name"],"languages":[null],"row_count":4,"default_translation":null},"owner__username":"api_user","parent":null,"uid":"amP4TBwoEcCAzBMZJ96ata","tag_string":"","settings":{"sector":{"label":"Information - / Media","value":"Information / Media"},"country":{"label":"Germany","value":"DEU"},"description":"bla","share-metadata":true},"kind":"asset","name":"[Malte/cloning]","asset_type":"survey","version_id":"vxqXfWoTA2u2vMdeYdddzT","has_deployment":true,"deployed_version_id":"vxqXfWoTA2u2vMdeYdddzT","deployment__identifier":"https://kc.correlaid.org/api_user/forms/amP4TBwoEcCAzBMZJ96ata","deployment__active":true,"deployment__submission_count":3,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/amP4TBwoEcCAzBMZJ96ata/permission-assignments/p7BLLLdhjzbp3yfHY99sPn/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/","label":"Add - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/amP4TBwoEcCAzBMZJ96ata/permission-assignments/pBzudoNfF4Wp6CSNGeaxBm/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/","label":"Edit - form"},{"url":"https://kobo.correlaid.org/api/v2/assets/amP4TBwoEcCAzBMZJ96ata/permission-assignments/pFHNYCG6HXrJZHNJa9tHnG/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/","label":"Edit - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/amP4TBwoEcCAzBMZJ96ata/permission-assignments/peYkkSYHVSRySy5BR7pQhE/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/","label":"Delete - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/amP4TBwoEcCAzBMZJ96ata/permission-assignments/p5hZt3cCDxArixjPpm7uzy/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/","label":"Manage - project"},{"url":"https://kobo.correlaid.org/api/v2/assets/amP4TBwoEcCAzBMZJ96ata/permission-assignments/pdNmxwrgWpjN52dsqDrknr/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/","label":"Validate - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/amP4TBwoEcCAzBMZJ96ata/permission-assignments/pgd4AaBUaLRqx6sZCKUqW5/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/","label":"View - form"},{"url":"https://kobo.correlaid.org/api/v2/assets/amP4TBwoEcCAzBMZJ96ata/permission-assignments/pCD83TPLg3Pdt3s7FQDAiC/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/","label":"View - submissions"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/amP4TBwoEcCAzBMZJ96ata.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/amP4TBwoEcCAzBMZJ96ata.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/amP4TBwoEcCAzBMZJ96ata/data/"},{"url":"https://kobo.correlaid.org/api/v2/assets/aDfgacXboQEheygYpsrVuN/","date_modified":"2021-07-29T15:37:05.880856Z","date_created":"2021-07-29T15:37:05.880833Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/","summary":{},"owner__username":"api_user","parent":null,"uid":"aDfgacXboQEheygYpsrVuN","tag_string":"","settings":{"sector":{"label":"","value":""},"country":{"label":"","value":""},"description":"","share-metadata":false},"kind":"asset","name":"vcr_test_name","asset_type":"survey","version_id":"vsybrkg3WUncv9bBzbUDAk","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/aDfgacXboQEheygYpsrVuN/permission-assignments/pubPKkxn66xsb9XSHf7xC7/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/","label":"Add - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aDfgacXboQEheygYpsrVuN/permission-assignments/phpfZvGdojthcX9MmCywGE/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/","label":"Edit - form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aDfgacXboQEheygYpsrVuN/permission-assignments/pQddSPmwoYPUF5u3h8Cdzv/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/","label":"Edit - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aDfgacXboQEheygYpsrVuN/permission-assignments/pXDmiJWonPcgQkpJyFh8Pr/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/","label":"Delete - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aDfgacXboQEheygYpsrVuN/permission-assignments/p2Xrwu6cieSz4ZbQAzYrGg/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/","label":"Manage - project"},{"url":"https://kobo.correlaid.org/api/v2/assets/aDfgacXboQEheygYpsrVuN/permission-assignments/pruJQzXQ9V386Rm3wvAU9j/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/","label":"Validate - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aDfgacXboQEheygYpsrVuN/permission-assignments/pUJXaLZLiuKbbUjvGJ47g9/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/","label":"View - form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aDfgacXboQEheygYpsrVuN/permission-assignments/pmVUcpXMPUkodM55pTL3tC/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/","label":"View - submissions"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/aDfgacXboQEheygYpsrVuN.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/aDfgacXboQEheygYpsrVuN.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/aDfgacXboQEheygYpsrVuN/data/"},{"url":"https://kobo.correlaid.org/api/v2/assets/au6GRDfpigXuPhSfP27tVB/","date_modified":"2021-07-29T15:37:05.706889Z","date_created":"2021-07-29T15:37:05.706865Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/","summary":{},"owner__username":"api_user","parent":null,"uid":"au6GRDfpigXuPhSfP27tVB","tag_string":"","settings":{"sector":{"label":"Environment","value":"ENV"},"country":{"label":"Angola","value":"AGO"},"description":"description","share-metadata":false},"kind":"asset","name":"vcr_test_name","asset_type":"survey","version_id":"vpnhJ84vDvDDdTJSyuQUdF","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/au6GRDfpigXuPhSfP27tVB/permission-assignments/pdsha54vkHekqre7fxtu5z/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/","label":"Add - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/au6GRDfpigXuPhSfP27tVB/permission-assignments/pY4NXdkJVe9jb6Fh2SiBWS/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/","label":"Edit - form"},{"url":"https://kobo.correlaid.org/api/v2/assets/au6GRDfpigXuPhSfP27tVB/permission-assignments/pjujpekzDPJBwxuEbzZym5/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/","label":"Edit - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/au6GRDfpigXuPhSfP27tVB/permission-assignments/pwiJtZDEEC7MW7874j8Gut/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/","label":"Delete - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/au6GRDfpigXuPhSfP27tVB/permission-assignments/pzi2dyMo4kyqycZv8YEurj/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/","label":"Manage - project"},{"url":"https://kobo.correlaid.org/api/v2/assets/au6GRDfpigXuPhSfP27tVB/permission-assignments/pGKbVv9ujGfddy5f2Joeq8/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/","label":"Validate - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/au6GRDfpigXuPhSfP27tVB/permission-assignments/pcX3YjaFdxbKCYxTLdakMS/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/","label":"View - form"},{"url":"https://kobo.correlaid.org/api/v2/assets/au6GRDfpigXuPhSfP27tVB/permission-assignments/peeKWqEbtztQ7btSAMVRPu/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/","label":"View - submissions"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/au6GRDfpigXuPhSfP27tVB.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/au6GRDfpigXuPhSfP27tVB.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/au6GRDfpigXuPhSfP27tVB/data/"},{"url":"https://kobo.correlaid.org/api/v2/assets/a3MM3HBjDwt5HCV4S6mcLm/","date_modified":"2021-07-27T20:50:10.880601Z","date_created":"2021-07-27T20:50:10.880579Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/","summary":{},"owner__username":"api_user","parent":null,"uid":"a3MM3HBjDwt5HCV4S6mcLm","tag_string":"","settings":{"sector":{"label":"Environment","value":"Env"},"country":{"label":"Angola","value":"ANG"},"description":"This - is the description. It is empty.","share-metadata":false},"kind":"asset","name":"test - malte 2021-07-28","asset_type":"survey","version_id":"vhcFs6QLH3VqtSFVh9qZ2y","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/a3MM3HBjDwt5HCV4S6mcLm/permission-assignments/ppWnTCTW7bkVBvuDrQxYnD/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/","label":"Add - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/a3MM3HBjDwt5HCV4S6mcLm/permission-assignments/pRGF5aYL5AjyenWJgvvXcc/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/","label":"Edit - form"},{"url":"https://kobo.correlaid.org/api/v2/assets/a3MM3HBjDwt5HCV4S6mcLm/permission-assignments/pUzk63V8pjpBJSbRKB9DdL/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/","label":"Edit - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/a3MM3HBjDwt5HCV4S6mcLm/permission-assignments/pe3FS25xbzJyCDaB3TzqWw/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/","label":"Delete - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/a3MM3HBjDwt5HCV4S6mcLm/permission-assignments/pgM9SoEGhjViBV3tzitmok/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/","label":"Manage - project"},{"url":"https://kobo.correlaid.org/api/v2/assets/a3MM3HBjDwt5HCV4S6mcLm/permission-assignments/pfKebdYFMXacoqiMPfFtmz/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/","label":"Validate - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/a3MM3HBjDwt5HCV4S6mcLm/permission-assignments/puVyuAW2Bg5sDxQcBJE4hy/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/","label":"View - form"},{"url":"https://kobo.correlaid.org/api/v2/assets/a3MM3HBjDwt5HCV4S6mcLm/permission-assignments/pL7gweVNSKRb4ZKybCJqT6/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/","label":"View - submissions"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/a3MM3HBjDwt5HCV4S6mcLm.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/a3MM3HBjDwt5HCV4S6mcLm.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/a3MM3HBjDwt5HCV4S6mcLm/data/"},{"url":"https://kobo.correlaid.org/api/v2/assets/aUSuJppKGV2Eu3RLSh9JyS/","date_modified":"2021-07-26T23:52:31.417056Z","date_created":"2021-07-26T23:52:31.417033Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/","summary":{},"owner__username":"api_user","parent":null,"uid":"aUSuJppKGV2Eu3RLSh9JyS","tag_string":"","settings":{"sector":"Angola","country":{"label":"Angola","value":"ANG"},"description":"This - is the description. It is empty.","share-metadata":false},"kind":"asset","name":"test - malte 2021-07-27","asset_type":"survey","version_id":"vjYyWGHRY8QgBEbahmdzav","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/aUSuJppKGV2Eu3RLSh9JyS/permission-assignments/pzPwK8zCmXfWrgNxhSHFwf/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/","label":"Add - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aUSuJppKGV2Eu3RLSh9JyS/permission-assignments/pnBFjkGuWUJsLsXZM5w8op/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/","label":"Edit - form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aUSuJppKGV2Eu3RLSh9JyS/permission-assignments/pAWkWJVJpw7gdAzH4NdqnS/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/","label":"Edit - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aUSuJppKGV2Eu3RLSh9JyS/permission-assignments/ptFJrnpCq9naZN4K5dm8sm/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/","label":"Delete - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aUSuJppKGV2Eu3RLSh9JyS/permission-assignments/pNkuUdUCg4BuJ7QkhiCZvb/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/","label":"Manage - project"},{"url":"https://kobo.correlaid.org/api/v2/assets/aUSuJppKGV2Eu3RLSh9JyS/permission-assignments/pQ8PVAek9qf9mu5odQWvUq/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/","label":"Validate - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aUSuJppKGV2Eu3RLSh9JyS/permission-assignments/pX45SGuGrDuotPFrSkpCLL/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/","label":"View - form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aUSuJppKGV2Eu3RLSh9JyS/permission-assignments/p8RBC4WVaHpRPff42cptQG/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/","label":"View - submissions"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/aUSuJppKGV2Eu3RLSh9JyS.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/aUSuJppKGV2Eu3RLSh9JyS.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/aUSuJppKGV2Eu3RLSh9JyS/data/"},{"url":"https://kobo.correlaid.org/api/v2/assets/aCZdBwzfyoX2AMDB5a9ADE/","date_modified":"2021-07-26T23:52:24.806614Z","date_created":"2021-07-26T23:52:24.806590Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/","summary":{},"owner__username":"api_user","parent":null,"uid":"aCZdBwzfyoX2AMDB5a9ADE","tag_string":"","settings":{"sector":"Angola","country":{"label":"Angola","value":"ANG"},"description":"This - is the description. It is empty.","share-metadata":false},"kind":"asset","name":"test - malte 2021-07-27","asset_type":"survey","version_id":"vJNWfsg3kJ7Fks3RctDwvU","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/aCZdBwzfyoX2AMDB5a9ADE/permission-assignments/pHPkCoA8p8sE5Qw4ZVA7c5/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/","label":"Add - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aCZdBwzfyoX2AMDB5a9ADE/permission-assignments/pw7wSM8HYKwq6H3LCNHqQu/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/","label":"Edit - form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aCZdBwzfyoX2AMDB5a9ADE/permission-assignments/pKWHkwHfXfCxtVVDHMsqmB/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/","label":"Edit - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aCZdBwzfyoX2AMDB5a9ADE/permission-assignments/pkYirwM4kBBf2B3APRQ5mj/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/","label":"Delete - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aCZdBwzfyoX2AMDB5a9ADE/permission-assignments/pY2AJuZvPE88RDVegdW7US/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/","label":"Manage - project"},{"url":"https://kobo.correlaid.org/api/v2/assets/aCZdBwzfyoX2AMDB5a9ADE/permission-assignments/p83gvRqxoVDLZ3HXZqDRNh/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/","label":"Validate - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aCZdBwzfyoX2AMDB5a9ADE/permission-assignments/pwoRcRpFNxesR9isg8pMBw/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/","label":"View - form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aCZdBwzfyoX2AMDB5a9ADE/permission-assignments/prm3pgxJVQSRL86KSCpj2Y/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/","label":"View - submissions"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/aCZdBwzfyoX2AMDB5a9ADE.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/aCZdBwzfyoX2AMDB5a9ADE.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/aCZdBwzfyoX2AMDB5a9ADE/data/"},{"url":"https://kobo.correlaid.org/api/v2/assets/aT45DAwesB5Cs23nQPpgfz/","date_modified":"2021-07-26T23:52:04.851988Z","date_created":"2021-07-26T23:52:04.851961Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/","summary":{},"owner__username":"api_user","parent":null,"uid":"aT45DAwesB5Cs23nQPpgfz","tag_string":"","settings":{"sector":"Angola","country":{"label":"Angola","value":"ANG"},"description":"This - is the description. It is empty.","share-metadata":false},"kind":"asset","name":"test - malte 2021-07-27","asset_type":"survey","version_id":"vAg3CmFogP4csdJ84MGDPn","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/aT45DAwesB5Cs23nQPpgfz/permission-assignments/pkFmSJ2RoNVKSRoZQTSvER/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/","label":"Add - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aT45DAwesB5Cs23nQPpgfz/permission-assignments/pRFtCiSXJTNfLL4LUfQJBF/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/","label":"Edit - form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aT45DAwesB5Cs23nQPpgfz/permission-assignments/pj26hkbdysWgFLDye8qrkS/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/","label":"Edit - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aT45DAwesB5Cs23nQPpgfz/permission-assignments/pcxdKyhdtpBoZshrFcxBuh/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/","label":"Delete - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aT45DAwesB5Cs23nQPpgfz/permission-assignments/pQ5c7tWBMU4VVBkM4WobyL/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/","label":"Manage - project"},{"url":"https://kobo.correlaid.org/api/v2/assets/aT45DAwesB5Cs23nQPpgfz/permission-assignments/pGw7V3nJA8Q5LxX6AYkwZv/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/","label":"Validate - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aT45DAwesB5Cs23nQPpgfz/permission-assignments/p4crgi7iMshnAPD45naoCa/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/","label":"View - form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aT45DAwesB5Cs23nQPpgfz/permission-assignments/pQA2pKNkRbfNWxSktkD9k7/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/","label":"View - submissions"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/aT45DAwesB5Cs23nQPpgfz.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/aT45DAwesB5Cs23nQPpgfz.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/aT45DAwesB5Cs23nQPpgfz/data/"},{"url":"https://kobo.correlaid.org/api/v2/assets/aQXHg5sgvpjG9GrJkVjz4Q/","date_modified":"2021-07-26T23:33:16.264227Z","date_created":"2021-07-26T23:33:16.264202Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/","summary":{},"owner__username":"api_user","parent":null,"uid":"aQXHg5sgvpjG9GrJkVjz4Q","tag_string":"","settings":{"sector":{"label":"Environment","value":"Env"},"country":{"label":"Angola","value":"ANG"},"description":"This - is the description. It is empty.","share-metadata":false},"kind":"asset","name":"test - malte 2021-07-27","asset_type":"survey","version_id":"v89uFmcsKf2TEXMi44biF9","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/aQXHg5sgvpjG9GrJkVjz4Q/permission-assignments/pzWxHs7g69py8bTaa62rqA/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/","label":"Add - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aQXHg5sgvpjG9GrJkVjz4Q/permission-assignments/pqnhX9fSnYTWcwKCeHtXgD/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/","label":"Edit - form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aQXHg5sgvpjG9GrJkVjz4Q/permission-assignments/piQpaAuQG9EhtbV4AVSWD4/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/","label":"Edit - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aQXHg5sgvpjG9GrJkVjz4Q/permission-assignments/p3hXpypAGjmSY7M6TAE9ov/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/","label":"Delete - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aQXHg5sgvpjG9GrJkVjz4Q/permission-assignments/prc45RYDVn27fsUpzQSDsw/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/","label":"Manage - project"},{"url":"https://kobo.correlaid.org/api/v2/assets/aQXHg5sgvpjG9GrJkVjz4Q/permission-assignments/pmZBJQVpAx2gStJMyJcS22/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/","label":"Validate - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aQXHg5sgvpjG9GrJkVjz4Q/permission-assignments/pigqacMYEmwynKyvQVqAyJ/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/","label":"View - form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aQXHg5sgvpjG9GrJkVjz4Q/permission-assignments/pBxFvVNqQamduN9FBBkTjG/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/","label":"View - submissions"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/aQXHg5sgvpjG9GrJkVjz4Q.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/aQXHg5sgvpjG9GrJkVjz4Q.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/aQXHg5sgvpjG9GrJkVjz4Q/data/"},{"url":"https://kobo.correlaid.org/api/v2/assets/aSoX2fGyQ7GMFhYvfTyFJB/","date_modified":"2021-07-26T23:14:11.412827Z","date_created":"2021-07-26T23:14:11.412803Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/","summary":{},"owner__username":"api_user","parent":null,"uid":"aSoX2fGyQ7GMFhYvfTyFJB","tag_string":"","settings":{"sector":"Environment","country":"Angola","description":"This - is the description. It is empty.","share-metadata":false},"kind":"asset","name":"test - malte 2021-07-27","asset_type":"survey","version_id":"vJ4iF9nvBFvDPBowXxCgxr","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/aSoX2fGyQ7GMFhYvfTyFJB/permission-assignments/p7S7CyHV7CRWTxheve2g3y/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/","label":"Add - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aSoX2fGyQ7GMFhYvfTyFJB/permission-assignments/pF4ntU7N2JX6teS5pBAZxu/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/","label":"Edit - form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aSoX2fGyQ7GMFhYvfTyFJB/permission-assignments/pExXVwmSFRJzLw8HdcMgSm/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/","label":"Edit - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aSoX2fGyQ7GMFhYvfTyFJB/permission-assignments/p4KjEHzxLFKrmARJd2ffDJ/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/","label":"Delete - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aSoX2fGyQ7GMFhYvfTyFJB/permission-assignments/pmneLPgkwcnMt3VGjwbtB9/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/","label":"Manage - project"},{"url":"https://kobo.correlaid.org/api/v2/assets/aSoX2fGyQ7GMFhYvfTyFJB/permission-assignments/pxzvzZEdQnumSAVQDh2knJ/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/","label":"Validate - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aSoX2fGyQ7GMFhYvfTyFJB/permission-assignments/pRRh8s9VUPedozPfbc5yWV/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/","label":"View - form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aSoX2fGyQ7GMFhYvfTyFJB/permission-assignments/p8Z9TBmQD6EVFQNg5NxoH6/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/","label":"View - submissions"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/aSoX2fGyQ7GMFhYvfTyFJB.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/aSoX2fGyQ7GMFhYvfTyFJB.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/aSoX2fGyQ7GMFhYvfTyFJB/data/"},{"url":"https://kobo.correlaid.org/api/v2/assets/apxYrm7i4mGc3Wxqu2eZ2r/","date_modified":"2021-07-12T20:11:25.852606Z","date_created":"2021-07-12T20:11:25.852585Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/","summary":{},"owner__username":"api_user","parent":null,"uid":"apxYrm7i4mGc3Wxqu2eZ2r","tag_string":"","settings":{"sector":"Environment","country":"Angola","description":"description","share-metadata":"false"},"kind":"asset","name":"test - create block, with settings provided as parameters","asset_type":"block","version_id":"vfSHxcWLJfhG4JknBJHzCj","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/apxYrm7i4mGc3Wxqu2eZ2r/permission-assignments/psvGSqLLw4KivCL6RTaU4J/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/","label":"Edit - block"},{"url":"https://kobo.correlaid.org/api/v2/assets/apxYrm7i4mGc3Wxqu2eZ2r/permission-assignments/pLVrYUPVn4z9cNSHUUXtvs/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/","label":"Manage - block"},{"url":"https://kobo.correlaid.org/api/v2/assets/apxYrm7i4mGc3Wxqu2eZ2r/permission-assignments/pEmvTvUK9Xqj4U9vm7H8yy/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/","label":"View - block"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/apxYrm7i4mGc3Wxqu2eZ2r.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/apxYrm7i4mGc3Wxqu2eZ2r.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/apxYrm7i4mGc3Wxqu2eZ2r/data/"},{"url":"https://kobo.correlaid.org/api/v2/assets/adSrSMHEgmMGPmkvBEsF4v/","date_modified":"2021-07-12T20:11:02.359988Z","date_created":"2021-07-12T20:11:02.359966Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/","summary":{},"owner__username":"api_user","parent":null,"uid":"adSrSMHEgmMGPmkvBEsF4v","tag_string":"","settings":{"sector":"Environment","country":"Angola","description":"description","share-metadata":"false"},"kind":"asset","name":"test - create template, with settings provided as parameters","asset_type":"template","version_id":"vRaB3oiXrgYFSS2dkAJf9T","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/adSrSMHEgmMGPmkvBEsF4v/permission-assignments/p8rWb6vG5fKRVQ5rWdWBz5/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/","label":"Edit - template"},{"url":"https://kobo.correlaid.org/api/v2/assets/adSrSMHEgmMGPmkvBEsF4v/permission-assignments/pTmt86PhPczLszeP258nK2/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/","label":"Manage - template"},{"url":"https://kobo.correlaid.org/api/v2/assets/adSrSMHEgmMGPmkvBEsF4v/permission-assignments/pReeCKTCr4TRLQTfpr5Q4o/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/","label":"View - template"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/adSrSMHEgmMGPmkvBEsF4v.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/adSrSMHEgmMGPmkvBEsF4v.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/adSrSMHEgmMGPmkvBEsF4v/data/"},{"url":"https://kobo.correlaid.org/api/v2/assets/aAhwQitVwHSrgfDjTwum8F/","date_modified":"2021-07-12T20:09:50.930976Z","date_created":"2021-07-12T20:09:50.930952Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/","summary":{},"owner__username":"api_user","parent":null,"uid":"aAhwQitVwHSrgfDjTwum8F","tag_string":"","settings":{"sector":"","country":"","description":"","share-metadata":"false"},"kind":"asset","name":"test - create question, no settings","asset_type":"question","version_id":"v45TfPq9bQiYDpTNoNaurj","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/aAhwQitVwHSrgfDjTwum8F/permission-assignments/pgTxpiCBGQXX39o99RLhpb/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/","label":"Edit - question"},{"url":"https://kobo.correlaid.org/api/v2/assets/aAhwQitVwHSrgfDjTwum8F/permission-assignments/pCcNDNpjCivTJr6MJnhih4/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/","label":"Manage - question"},{"url":"https://kobo.correlaid.org/api/v2/assets/aAhwQitVwHSrgfDjTwum8F/permission-assignments/p5NBQ97SL7NFQiX3mx47mg/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/","label":"View - question"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/aAhwQitVwHSrgfDjTwum8F.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/aAhwQitVwHSrgfDjTwum8F.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/aAhwQitVwHSrgfDjTwum8F/data/"},{"url":"https://kobo.correlaid.org/api/v2/assets/a32dXjFvRR33Xii6Z5BXkA/","date_modified":"2021-07-12T20:09:45.089580Z","date_created":"2021-07-12T20:09:45.089561Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/","summary":{},"owner__username":"api_user","parent":null,"uid":"a32dXjFvRR33Xii6Z5BXkA","tag_string":"","settings":{"sector":"","country":"","description":"","share-metadata":"false"},"kind":"asset","name":"test - create template, no settings","asset_type":"template","version_id":"vpPMmDUEYcG29RurTrrSoZ","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/a32dXjFvRR33Xii6Z5BXkA/permission-assignments/pWAFps2kcUGk8cFgGCEvwC/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/","label":"Edit - template"},{"url":"https://kobo.correlaid.org/api/v2/assets/a32dXjFvRR33Xii6Z5BXkA/permission-assignments/p5hsgwtdQGfKt6gCnR6LwS/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/","label":"Manage - template"},{"url":"https://kobo.correlaid.org/api/v2/assets/a32dXjFvRR33Xii6Z5BXkA/permission-assignments/pWwsUZbh4pZDZDSSESXYyA/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/","label":"View - template"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/a32dXjFvRR33Xii6Z5BXkA.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/a32dXjFvRR33Xii6Z5BXkA.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/a32dXjFvRR33Xii6Z5BXkA/data/"},{"url":"https://kobo.correlaid.org/api/v2/assets/azXhPczgcenp9rVcgzfVcM/","date_modified":"2021-07-12T20:09:35.194826Z","date_created":"2021-07-12T20:09:35.194801Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/","summary":{},"owner__username":"api_user","parent":null,"uid":"azXhPczgcenp9rVcgzfVcM","tag_string":"","settings":{"sector":"","country":"","description":"","share-metadata":"false"},"kind":"asset","name":"test - create block, no settings","asset_type":"block","version_id":"vYisDkcTg6w3wyBr9tP82h","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/azXhPczgcenp9rVcgzfVcM/permission-assignments/pkYwFeVoeNxTkRioQGeCH3/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/","label":"Edit - block"},{"url":"https://kobo.correlaid.org/api/v2/assets/azXhPczgcenp9rVcgzfVcM/permission-assignments/pP8PWUhTQKbiTMMGdrKP7g/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/","label":"Manage - block"},{"url":"https://kobo.correlaid.org/api/v2/assets/azXhPczgcenp9rVcgzfVcM/permission-assignments/piXPtpzmZM7QaW2GYqrMB9/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/","label":"View - block"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/azXhPczgcenp9rVcgzfVcM.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/azXhPczgcenp9rVcgzfVcM.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/azXhPczgcenp9rVcgzfVcM/data/"},{"url":"https://kobo.correlaid.org/api/v2/assets/aQUfpaSGHJpu7eqcUKf87U/","date_modified":"2021-07-12T20:02:00.378380Z","date_created":"2021-07-12T20:02:00.378350Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/","summary":{},"owner__username":"api_user","parent":null,"uid":"aQUfpaSGHJpu7eqcUKf87U","tag_string":"","settings":{"sector":"Environment","country":"Angola","description":"description","share-metadata":"true"},"kind":"asset","name":"test - create survey, with settings provided as parameters","asset_type":"survey","version_id":"vcjfKYUfz2iH5YJ8AhjdT3","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/aQUfpaSGHJpu7eqcUKf87U/permission-assignments/pBKFRho5xK5d8GSrQ5Rqtt/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/","label":"Add - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aQUfpaSGHJpu7eqcUKf87U/permission-assignments/pDeuGwVWdAbcasBbWZ58QZ/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/","label":"Edit - form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aQUfpaSGHJpu7eqcUKf87U/permission-assignments/pFC524ac9YgFPnHXLvn4cH/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/","label":"Edit - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aQUfpaSGHJpu7eqcUKf87U/permission-assignments/pwhwh6zcqsjvUpuL3wJZAa/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/","label":"Delete - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aQUfpaSGHJpu7eqcUKf87U/permission-assignments/pTu2uVbKN5wjcHSEdyC4hh/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/","label":"Manage - project"},{"url":"https://kobo.correlaid.org/api/v2/assets/aQUfpaSGHJpu7eqcUKf87U/permission-assignments/pYKvh97ybuYBLjbBzzbnCE/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/","label":"Validate - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aQUfpaSGHJpu7eqcUKf87U/permission-assignments/pX85zxkWiSHk43iZgZEAuy/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/","label":"View - form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aQUfpaSGHJpu7eqcUKf87U/permission-assignments/pZgGnejThdtoobEdfuie2n/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/","label":"View - submissions"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/aQUfpaSGHJpu7eqcUKf87U.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/aQUfpaSGHJpu7eqcUKf87U.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/aQUfpaSGHJpu7eqcUKf87U/data/"},{"url":"https://kobo.correlaid.org/api/v2/assets/aGYDjmTk39HHCmFhLduGGQ/","date_modified":"2021-07-12T19:38:15.967467Z","date_created":"2021-07-12T19:38:15.967445Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/","summary":{},"owner__username":"api_user","parent":null,"uid":"aGYDjmTk39HHCmFhLduGGQ","tag_string":"","settings":{},"kind":"asset","name":"test - create question, no settings","asset_type":"question","version_id":"vbNhkosv8fH9vebx9aBPiQ","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/aGYDjmTk39HHCmFhLduGGQ/permission-assignments/pTXzmBBCFioiCvTmqWZMqr/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/","label":"Edit - question"},{"url":"https://kobo.correlaid.org/api/v2/assets/aGYDjmTk39HHCmFhLduGGQ/permission-assignments/pqncbKp8BguEh28txG8DJX/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/","label":"Manage - question"},{"url":"https://kobo.correlaid.org/api/v2/assets/aGYDjmTk39HHCmFhLduGGQ/permission-assignments/pP53HSGZvgrFtieUhS2TVx/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/","label":"View - question"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/aGYDjmTk39HHCmFhLduGGQ.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/aGYDjmTk39HHCmFhLduGGQ.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/aGYDjmTk39HHCmFhLduGGQ/data/"},{"url":"https://kobo.correlaid.org/api/v2/assets/a4MPenUthsYVNGxWE6GxNH/","date_modified":"2021-07-12T19:36:36.364317Z","date_created":"2021-07-12T19:36:36.364294Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/","summary":{},"owner__username":"api_user","parent":null,"uid":"a4MPenUthsYVNGxWE6GxNH","tag_string":"","settings":{},"kind":"asset","name":"test - create survey, no settings","asset_type":"survey","version_id":"v2fW5Nx4YB9G2PLHvBiksZ","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/a4MPenUthsYVNGxWE6GxNH/permission-assignments/pUHHc8W2jRph9AnJWbBjC7/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/","label":"Add - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/a4MPenUthsYVNGxWE6GxNH/permission-assignments/pCdB2u4CEjgGNgQGNmuWVL/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/","label":"Edit - form"},{"url":"https://kobo.correlaid.org/api/v2/assets/a4MPenUthsYVNGxWE6GxNH/permission-assignments/pKMdyqmomA2EGLzstB3KrH/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/","label":"Edit - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/a4MPenUthsYVNGxWE6GxNH/permission-assignments/pxAJRBong9n9eszvjokCWG/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/","label":"Delete - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/a4MPenUthsYVNGxWE6GxNH/permission-assignments/pnJME2Ts9uBS327u8yeR4T/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/","label":"Manage - project"},{"url":"https://kobo.correlaid.org/api/v2/assets/a4MPenUthsYVNGxWE6GxNH/permission-assignments/pdtzbLZcfikuaCUKmKVh6n/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/","label":"Validate - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/a4MPenUthsYVNGxWE6GxNH/permission-assignments/pcyAQanSM6ksJQzWugvHir/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/","label":"View - form"},{"url":"https://kobo.correlaid.org/api/v2/assets/a4MPenUthsYVNGxWE6GxNH/permission-assignments/pWuMi6mbDh4NGddazWX4dQ/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/","label":"View - submissions"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/a4MPenUthsYVNGxWE6GxNH.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/a4MPenUthsYVNGxWE6GxNH.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/a4MPenUthsYVNGxWE6GxNH/data/"},{"url":"https://kobo.correlaid.org/api/v2/assets/a6pUSXYgQh2dde8atN88pA/","date_modified":"2021-07-06T20:12:48.277597Z","date_created":"2021-07-06T20:12:48.277573Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/","summary":{"geo":true,"labels":["Please - say, for each of the following, how important it is in your life.","Work","Family","Friends - and acquaintances","Leisure time"],"columns":["name","type","appearance","label","select_from_list_name","required","hint","parameters","calculation"],"languages":[null],"row_count":24,"default_translation":null},"owner__username":"api_user","parent":null,"uid":"a6pUSXYgQh2dde8atN88pA","tag_string":"","settings":{},"kind":"asset","name":"vcr_test_name","asset_type":"survey","version_id":"vroBzYagYxWzxtLtmaCxiN","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/a6pUSXYgQh2dde8atN88pA/permission-assignments/pAnzX4VU9yxFeLEqTdagJX/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/","label":"Add - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/a6pUSXYgQh2dde8atN88pA/permission-assignments/p7HUzDYfNM3tL7k6PUFLUm/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/","label":"Edit - form"},{"url":"https://kobo.correlaid.org/api/v2/assets/a6pUSXYgQh2dde8atN88pA/permission-assignments/p8HN9mpgsdE68xyN2DovZ7/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/","label":"Edit - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/a6pUSXYgQh2dde8atN88pA/permission-assignments/ppjvFdok8ZN4GEYLDDhUFY/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/","label":"Delete - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/a6pUSXYgQh2dde8atN88pA/permission-assignments/pCDEvuzZLv3ePafjcsbbEQ/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/","label":"Manage - project"},{"url":"https://kobo.correlaid.org/api/v2/assets/a6pUSXYgQh2dde8atN88pA/permission-assignments/p96QLm3otvv5vmzUxCa6Vj/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/","label":"Validate - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/a6pUSXYgQh2dde8atN88pA/permission-assignments/pMyYGaJxDQ9WoiHenH3JGD/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/","label":"View - form"},{"url":"https://kobo.correlaid.org/api/v2/assets/a6pUSXYgQh2dde8atN88pA/permission-assignments/pJuhpnuiNUixmXqnmJQM3c/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/","label":"View - submissions"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/a6pUSXYgQh2dde8atN88pA.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/a6pUSXYgQh2dde8atN88pA.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/a6pUSXYgQh2dde8atN88pA/data/"},{"url":"https://kobo.correlaid.org/api/v2/assets/awA4Keq8WHBqU6yaihMmUB/","date_modified":"2021-07-06T19:55:15.055137Z","date_created":"2021-07-06T19:55:15.055115Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/","summary":{"geo":true,"labels":["Please - say, for each of the following, how important it is in your life.","Work","Family","Friends - and acquaintances","Leisure time"],"columns":["name","type","appearance","label","select_from_list_name","required","hint","parameters","calculation"],"languages":[null],"row_count":24,"default_translation":null},"owner__username":"api_user","parent":null,"uid":"awA4Keq8WHBqU6yaihMmUB","tag_string":"","settings":{},"kind":"asset","name":"test - clone survey to survey","asset_type":"survey","version_id":"vtiMb27PnXzd8NBtYDbtUW","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/awA4Keq8WHBqU6yaihMmUB/permission-assignments/pwx6Btyx8KvZQNzdYjKTiz/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/","label":"Add - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/awA4Keq8WHBqU6yaihMmUB/permission-assignments/pP8Eoq4pGzCbhs3XibQSKY/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/","label":"Edit - form"},{"url":"https://kobo.correlaid.org/api/v2/assets/awA4Keq8WHBqU6yaihMmUB/permission-assignments/pATSUy6tSaESMo6yyoVMkv/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/","label":"Edit - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/awA4Keq8WHBqU6yaihMmUB/permission-assignments/ppd8P9QfsEw6NawYfeafYV/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/","label":"Delete - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/awA4Keq8WHBqU6yaihMmUB/permission-assignments/puYnKuPrFzzPtuC6XvqXZQ/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/","label":"Manage - project"},{"url":"https://kobo.correlaid.org/api/v2/assets/awA4Keq8WHBqU6yaihMmUB/permission-assignments/pk4H3RCJRsx9yLPh4Z87zX/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/","label":"Validate - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/awA4Keq8WHBqU6yaihMmUB/permission-assignments/pJwaXnv73TUpzgVbkAmkNw/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/","label":"View - form"},{"url":"https://kobo.correlaid.org/api/v2/assets/awA4Keq8WHBqU6yaihMmUB/permission-assignments/pStzbApKSHxbskmQyDr8Fc/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/","label":"View - submissions"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/awA4Keq8WHBqU6yaihMmUB.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/awA4Keq8WHBqU6yaihMmUB.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/awA4Keq8WHBqU6yaihMmUB/data/"},{"url":"https://kobo.correlaid.org/api/v2/assets/aLRy4TPnB4W4a45NyZUaio/","date_modified":"2021-07-06T19:31:22.114628Z","date_created":"2021-07-06T19:31:22.114606Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/","summary":{"geo":true,"labels":["Please - say, for each of the following, how important it is in your life.","Work","Family","Friends - and acquaintances","Leisure time"],"columns":["name","type","appearance","label","select_from_list_name","required","hint","parameters","calculation"],"languages":[null],"row_count":24,"default_translation":null},"owner__username":"api_user","parent":null,"uid":"aLRy4TPnB4W4a45NyZUaio","tag_string":"","settings":{},"kind":"asset","name":"clone - template to template","asset_type":"template","version_id":"vUuMeaxA5j7b67XayN5Hq2","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/aLRy4TPnB4W4a45NyZUaio/permission-assignments/pwJ6o799ArxgJFZSsADQsi/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/","label":"Edit - template"},{"url":"https://kobo.correlaid.org/api/v2/assets/aLRy4TPnB4W4a45NyZUaio/permission-assignments/p39nPVQoj5fYMXQHifEvef/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/","label":"Manage - template"},{"url":"https://kobo.correlaid.org/api/v2/assets/aLRy4TPnB4W4a45NyZUaio/permission-assignments/pQbz3A5F5Kg8LaCK9Q7nTB/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/","label":"View - template"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/aLRy4TPnB4W4a45NyZUaio.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/aLRy4TPnB4W4a45NyZUaio.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/aLRy4TPnB4W4a45NyZUaio/data/"},{"url":"https://kobo.correlaid.org/api/v2/assets/afxiQ8KYXe5tGrqyFgrFQP/","date_modified":"2021-07-06T19:31:11.438968Z","date_created":"2021-07-06T19:31:11.438942Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/","summary":{"geo":true,"labels":["Please - say, for each of the following, how important it is in your life.","Work","Family","Friends - and acquaintances","Leisure time"],"columns":["name","type","appearance","label","select_from_list_name","required","hint","parameters","calculation"],"languages":[null],"row_count":24,"default_translation":null},"owner__username":"api_user","parent":null,"uid":"afxiQ8KYXe5tGrqyFgrFQP","tag_string":"","settings":{},"kind":"asset","name":"clone - template to survey","asset_type":"survey","version_id":"vtM6v4ugDiu8whJzX3f7tG","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/afxiQ8KYXe5tGrqyFgrFQP/permission-assignments/pMSAZXrxCLrq29CfCj9YvX/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/","label":"Add - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/afxiQ8KYXe5tGrqyFgrFQP/permission-assignments/pxJpwBh3KNe6Y85QrETA9q/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/","label":"Edit - form"},{"url":"https://kobo.correlaid.org/api/v2/assets/afxiQ8KYXe5tGrqyFgrFQP/permission-assignments/peEeQByKxpPQkmPjYWUG4d/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/","label":"Edit - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/afxiQ8KYXe5tGrqyFgrFQP/permission-assignments/pEpiqqLZmZqhEVv9RWRKAU/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/","label":"Delete - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/afxiQ8KYXe5tGrqyFgrFQP/permission-assignments/pzofojQreLm6mftec2UGTu/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/","label":"Manage - project"},{"url":"https://kobo.correlaid.org/api/v2/assets/afxiQ8KYXe5tGrqyFgrFQP/permission-assignments/pExPEDkvvkVSbaCHvJnrvu/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/","label":"Validate - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/afxiQ8KYXe5tGrqyFgrFQP/permission-assignments/pL4Tj8tqk5xnsTKv7dcJzJ/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/","label":"View - form"},{"url":"https://kobo.correlaid.org/api/v2/assets/afxiQ8KYXe5tGrqyFgrFQP/permission-assignments/px2m3J7Yo7EQG3iNQJvRT9/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/","label":"View - submissions"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/afxiQ8KYXe5tGrqyFgrFQP.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/afxiQ8KYXe5tGrqyFgrFQP.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/afxiQ8KYXe5tGrqyFgrFQP/data/"},{"url":"https://kobo.correlaid.org/api/v2/assets/aEemw2UYBCre5kntYokigx/","date_modified":"2021-07-06T19:29:41.743383Z","date_created":"2021-07-06T19:29:41.743359Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/","summary":{"geo":false,"labels":["what - is your age?"],"columns":["hint","name","type","label","required","constraint"],"languages":[null],"row_count":1,"default_translation":null},"owner__username":"api_user","parent":null,"uid":"aEemw2UYBCre5kntYokigx","tag_string":"","settings":{},"kind":"asset","name":"clone - question to template","asset_type":"template","version_id":"vwNL9ovQicg3Ab5j26ncCJ","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/aEemw2UYBCre5kntYokigx/permission-assignments/pFfGisfeRoYJpL9oj8qU3m/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/","label":"Edit - template"},{"url":"https://kobo.correlaid.org/api/v2/assets/aEemw2UYBCre5kntYokigx/permission-assignments/pvfaoBDRFHaY4R8HxxZaqT/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/","label":"Manage - template"},{"url":"https://kobo.correlaid.org/api/v2/assets/aEemw2UYBCre5kntYokigx/permission-assignments/pTJHgsphDTb37T2vymSAjt/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/","label":"View - template"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/aEemw2UYBCre5kntYokigx.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/aEemw2UYBCre5kntYokigx.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/aEemw2UYBCre5kntYokigx/data/"},{"url":"https://kobo.correlaid.org/api/v2/assets/aQn6StozWHdzt8WAUwTq7j/","date_modified":"2021-07-06T19:29:14.301252Z","date_created":"2021-07-06T19:29:14.301229Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/","summary":{"geo":false,"labels":["what - is your age?"],"columns":["hint","name","type","label","required","constraint"],"languages":[null],"row_count":1,"default_translation":null},"owner__username":"api_user","parent":null,"uid":"aQn6StozWHdzt8WAUwTq7j","tag_string":"","settings":{},"kind":"asset","name":"clone - question to survey","asset_type":"survey","version_id":"vgESBhxnAdfKrwwn8HntGX","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/aQn6StozWHdzt8WAUwTq7j/permission-assignments/pzQoyYS6QLaVdqLcD28Tdi/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/","label":"Add - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aQn6StozWHdzt8WAUwTq7j/permission-assignments/pRFmuSv5ofDrJibFR8iowJ/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/","label":"Edit - form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aQn6StozWHdzt8WAUwTq7j/permission-assignments/poSDTo6bZZTXWj9ZZ3Rbgh/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/","label":"Edit - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aQn6StozWHdzt8WAUwTq7j/permission-assignments/pgirKGyyxNySa5e3TBEkRx/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/","label":"Delete - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aQn6StozWHdzt8WAUwTq7j/permission-assignments/pP7ND6iW6kjahXtwBijmuz/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/","label":"Manage - project"},{"url":"https://kobo.correlaid.org/api/v2/assets/aQn6StozWHdzt8WAUwTq7j/permission-assignments/pMyYXrMHRaW4wFePpAF6d4/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/","label":"Validate - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aQn6StozWHdzt8WAUwTq7j/permission-assignments/pdNv59hbWdDah3arX88TYb/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/","label":"View - form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aQn6StozWHdzt8WAUwTq7j/permission-assignments/pBTkn8kUPyv2ZSzhFBCPUs/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/","label":"View - submissions"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/aQn6StozWHdzt8WAUwTq7j.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/aQn6StozWHdzt8WAUwTq7j.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/aQn6StozWHdzt8WAUwTq7j/data/"},{"url":"https://kobo.correlaid.org/api/v2/assets/akugPPogXsuXhXeWo3L3Nm/","date_modified":"2021-07-06T19:28:54.302821Z","date_created":"2021-07-06T19:28:54.302800Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/","summary":{"geo":false,"labels":["what - is your age?"],"columns":["hint","name","type","label","required","constraint"],"languages":[null],"row_count":1,"default_translation":null},"owner__username":"api_user","parent":null,"uid":"akugPPogXsuXhXeWo3L3Nm","tag_string":"","settings":{},"kind":"asset","name":"clone - question to question","asset_type":"question","version_id":"vU7xeeDd4LdJTDs8dtjuUU","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/akugPPogXsuXhXeWo3L3Nm/permission-assignments/pjAFMpjaHkSmHbJfoDdeMt/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/","label":"Edit - question"},{"url":"https://kobo.correlaid.org/api/v2/assets/akugPPogXsuXhXeWo3L3Nm/permission-assignments/pvtNviLsmj2uWQRjTW4BkJ/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/","label":"Manage - question"},{"url":"https://kobo.correlaid.org/api/v2/assets/akugPPogXsuXhXeWo3L3Nm/permission-assignments/pEY2Ko5tB9wt7juCjrcar6/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/","label":"View - question"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/akugPPogXsuXhXeWo3L3Nm.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/akugPPogXsuXhXeWo3L3Nm.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/akugPPogXsuXhXeWo3L3Nm/data/"},{"url":"https://kobo.correlaid.org/api/v2/assets/aCDL9G8bXN3j8ZseayUVsq/","date_modified":"2021-07-06T19:26:43.844788Z","date_created":"2021-07-06T19:26:43.844766Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/","summary":{"geo":true,"labels":["Please - say, for each of the following, how important it is in your life.","Work","Family","Friends - and acquaintances","Leisure time"],"columns":["name","type","appearance","label","select_from_list_name","required","hint","parameters","calculation"],"languages":[null],"row_count":24,"default_translation":null},"owner__username":"api_user","parent":null,"uid":"aCDL9G8bXN3j8ZseayUVsq","tag_string":"","settings":{},"kind":"asset","name":"clone - block to template","asset_type":"template","version_id":"vEDiLr6eWa8asmEsnLptSb","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/aCDL9G8bXN3j8ZseayUVsq/permission-assignments/p9rcFRQ5qKMTQf6ay32bew/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/","label":"Edit - template"},{"url":"https://kobo.correlaid.org/api/v2/assets/aCDL9G8bXN3j8ZseayUVsq/permission-assignments/pxfVmH3tNfdUkiRJQgbjci/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/","label":"Manage - template"},{"url":"https://kobo.correlaid.org/api/v2/assets/aCDL9G8bXN3j8ZseayUVsq/permission-assignments/p5PUrrf2cNpeEd9WhuGgnL/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/","label":"View - template"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/aCDL9G8bXN3j8ZseayUVsq.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/aCDL9G8bXN3j8ZseayUVsq.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/aCDL9G8bXN3j8ZseayUVsq/data/"},{"url":"https://kobo.correlaid.org/api/v2/assets/avHH9SsT9Fen33zcPywbBH/","date_modified":"2021-07-06T19:26:15.361424Z","date_created":"2021-07-06T19:26:15.361400Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/","summary":{"geo":true,"labels":["Please - say, for each of the following, how important it is in your life.","Work","Family","Friends - and acquaintances","Leisure time"],"columns":["name","type","appearance","label","select_from_list_name","required","hint","parameters","calculation"],"languages":[null],"row_count":24,"default_translation":null},"owner__username":"api_user","parent":null,"uid":"avHH9SsT9Fen33zcPywbBH","tag_string":"","settings":{},"kind":"asset","name":"clone - block to survey","asset_type":"survey","version_id":"vg9acyGjRqGH5hzj4PA5zq","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/avHH9SsT9Fen33zcPywbBH/permission-assignments/pbmAdpDsJetqQBQdVmA35B/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/","label":"Add - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/avHH9SsT9Fen33zcPywbBH/permission-assignments/prFm63mHiCbnArzxB4cxyE/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/","label":"Edit - form"},{"url":"https://kobo.correlaid.org/api/v2/assets/avHH9SsT9Fen33zcPywbBH/permission-assignments/pYRPJSEF3REj9iYGQghQAg/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/","label":"Edit - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/avHH9SsT9Fen33zcPywbBH/permission-assignments/pvHe8BpeZk22TjpXWGypr2/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/","label":"Delete - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/avHH9SsT9Fen33zcPywbBH/permission-assignments/p9W5V9oyUWG6PR44sxKpw7/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/","label":"Manage - project"},{"url":"https://kobo.correlaid.org/api/v2/assets/avHH9SsT9Fen33zcPywbBH/permission-assignments/pxq8VHNbenbeUcEnjmUbkn/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/","label":"Validate - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/avHH9SsT9Fen33zcPywbBH/permission-assignments/pr9cueinxwu6uMW3VhCUZU/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/","label":"View - form"},{"url":"https://kobo.correlaid.org/api/v2/assets/avHH9SsT9Fen33zcPywbBH/permission-assignments/pz5DgaPzLGdFxh4P8B2X5f/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/","label":"View - submissions"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/avHH9SsT9Fen33zcPywbBH.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/avHH9SsT9Fen33zcPywbBH.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/avHH9SsT9Fen33zcPywbBH/data/"},{"url":"https://kobo.correlaid.org/api/v2/assets/aLZFgjiwbcKNVWZn7KsQAt/","date_modified":"2021-07-06T19:25:25.146001Z","date_created":"2021-07-06T19:25:25.145977Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/","summary":{"geo":true,"labels":["Please - say, for each of the following, how important it is in your life.","Work","Family","Friends - and acquaintances","Leisure time"],"columns":["name","type","appearance","label","select_from_list_name","required","hint","parameters","calculation"],"languages":[null],"row_count":24,"default_translation":null},"owner__username":"api_user","parent":null,"uid":"aLZFgjiwbcKNVWZn7KsQAt","tag_string":"","settings":{},"kind":"asset","name":"clone - block to question","asset_type":"block","version_id":"vFFQxoApnw3q2rq3Mz53xo","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/aLZFgjiwbcKNVWZn7KsQAt/permission-assignments/pmqu5RMm2VzH2t3NHKDUEp/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/","label":"Edit - block"},{"url":"https://kobo.correlaid.org/api/v2/assets/aLZFgjiwbcKNVWZn7KsQAt/permission-assignments/pE8p4XLn9HyxZ2xtwcMGvj/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/","label":"Manage - block"},{"url":"https://kobo.correlaid.org/api/v2/assets/aLZFgjiwbcKNVWZn7KsQAt/permission-assignments/pH35ctU2s52FeCHfLdfSD8/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/","label":"View - block"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/aLZFgjiwbcKNVWZn7KsQAt.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/aLZFgjiwbcKNVWZn7KsQAt.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/aLZFgjiwbcKNVWZn7KsQAt/data/"},{"url":"https://kobo.correlaid.org/api/v2/assets/aAssHeQyjKUF5GxmocAPNf/","date_modified":"2021-07-06T19:25:08.956989Z","date_created":"2021-07-06T19:25:08.956965Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/","summary":{"geo":true,"labels":["Please - say, for each of the following, how important it is in your life.","Work","Family","Friends - and acquaintances","Leisure time"],"columns":["name","type","appearance","label","select_from_list_name","required","hint","parameters","calculation"],"languages":[null],"row_count":24,"default_translation":null},"owner__username":"api_user","parent":null,"uid":"aAssHeQyjKUF5GxmocAPNf","tag_string":"","settings":{},"kind":"asset","name":"clone - block to block","asset_type":"block","version_id":"vBtLG9vnhb2mYWVVSkDwke","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/aAssHeQyjKUF5GxmocAPNf/permission-assignments/pxrVszCDFEuUCEVYNunxZv/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/","label":"Edit - block"},{"url":"https://kobo.correlaid.org/api/v2/assets/aAssHeQyjKUF5GxmocAPNf/permission-assignments/pCCno2QzoH5qT9nnFxsGAr/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/","label":"Manage - block"},{"url":"https://kobo.correlaid.org/api/v2/assets/aAssHeQyjKUF5GxmocAPNf/permission-assignments/pGDj9KC9cFZeT2Ejzwkksb/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/","label":"View - block"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/aAssHeQyjKUF5GxmocAPNf.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/aAssHeQyjKUF5GxmocAPNf.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/aAssHeQyjKUF5GxmocAPNf/data/"},{"url":"https://kobo.correlaid.org/api/v2/assets/anxTvsL3xZd7CSvpt63qAd/","date_modified":"2021-07-06T19:15:35.670050Z","date_created":"2021-07-06T19:15:35.670026Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/","summary":{"geo":true,"labels":["Please - say, for each of the following, how important it is in your life.","Work","Family","Friends - and acquaintances","Leisure time"],"columns":["name","type","appearance","label","select_from_list_name","required","hint","parameters","calculation"],"languages":[null],"row_count":24,"default_translation":null},"owner__username":"api_user","parent":null,"uid":"anxTvsL3xZd7CSvpt63qAd","tag_string":"","settings":{},"kind":"asset","name":"clone - survey to template","asset_type":"template","version_id":"vGabu9yzsWfe4YNKqVSnP2","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/anxTvsL3xZd7CSvpt63qAd/permission-assignments/pnjjJ6VkMf2D5rB9yEzkFF/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/","label":"Edit - template"},{"url":"https://kobo.correlaid.org/api/v2/assets/anxTvsL3xZd7CSvpt63qAd/permission-assignments/pEB4iLaZEw5hQSqsnaRbaT/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/","label":"Manage - template"},{"url":"https://kobo.correlaid.org/api/v2/assets/anxTvsL3xZd7CSvpt63qAd/permission-assignments/pHNMQ9ShMiRbUegCmLyGZ7/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/","label":"View - template"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/anxTvsL3xZd7CSvpt63qAd.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/anxTvsL3xZd7CSvpt63qAd.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/anxTvsL3xZd7CSvpt63qAd/data/"},{"url":"https://kobo.correlaid.org/api/v2/assets/aDMQ2rG8oJ5jmYxMeiHLob/","date_modified":"2021-07-06T19:14:57.419254Z","date_created":"2021-07-06T19:14:57.419233Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/","summary":{"geo":true,"labels":["Please - say, for each of the following, how important it is in your life.","Work","Family","Friends - and acquaintances","Leisure time"],"columns":["name","type","appearance","label","select_from_list_name","required","hint","parameters","calculation"],"languages":[null],"row_count":24,"default_translation":null},"owner__username":"api_user","parent":null,"uid":"aDMQ2rG8oJ5jmYxMeiHLob","tag_string":"","settings":{},"kind":"asset","name":"clone - survey to question","asset_type":"block","version_id":"vLQ7u3iRWDmnmbrowH6W2W","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/aDMQ2rG8oJ5jmYxMeiHLob/permission-assignments/pTaV2PbbFsXUkC3R6kECGR/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/","label":"Edit - block"},{"url":"https://kobo.correlaid.org/api/v2/assets/aDMQ2rG8oJ5jmYxMeiHLob/permission-assignments/pZh8WPGpc3mpukLpy8R4Yv/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/","label":"Manage - block"},{"url":"https://kobo.correlaid.org/api/v2/assets/aDMQ2rG8oJ5jmYxMeiHLob/permission-assignments/pGsfWUncBzsCZsB6Fq5HyE/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/","label":"View - block"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/aDMQ2rG8oJ5jmYxMeiHLob.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/aDMQ2rG8oJ5jmYxMeiHLob.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/aDMQ2rG8oJ5jmYxMeiHLob/data/"},{"url":"https://kobo.correlaid.org/api/v2/assets/aYKJ5czzHiustZFpBBiWHk/","date_modified":"2021-07-06T19:14:39.238475Z","date_created":"2021-07-06T19:14:39.238451Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/","summary":{"geo":true,"labels":["Please - say, for each of the following, how important it is in your life.","Work","Family","Friends - and acquaintances","Leisure time"],"columns":["name","type","appearance","label","select_from_list_name","required","hint","parameters","calculation"],"languages":[null],"row_count":24,"default_translation":null},"owner__username":"api_user","parent":null,"uid":"aYKJ5czzHiustZFpBBiWHk","tag_string":"","settings":{},"kind":"asset","name":"clone - survey to block","asset_type":"block","version_id":"vXNPcWM6aNauzMycK97PnG","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/aYKJ5czzHiustZFpBBiWHk/permission-assignments/puaZinDDbPALXHqjfVovAB/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/","label":"Edit - block"},{"url":"https://kobo.correlaid.org/api/v2/assets/aYKJ5czzHiustZFpBBiWHk/permission-assignments/pqqaM4JPBmpkuiVhJZXYQw/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/","label":"Manage - block"},{"url":"https://kobo.correlaid.org/api/v2/assets/aYKJ5czzHiustZFpBBiWHk/permission-assignments/pxkw6wXvmd9r34vdkSi6wq/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/","label":"View - block"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/aYKJ5czzHiustZFpBBiWHk.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/aYKJ5czzHiustZFpBBiWHk.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/aYKJ5czzHiustZFpBBiWHk/data/"},{"url":"https://kobo.correlaid.org/api/v2/assets/az2JpPivNFEdCNWR4mQNcV/","date_modified":"2021-07-06T19:13:48.214168Z","date_created":"2021-07-06T19:13:48.214146Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/","summary":{"geo":true,"labels":["Please - say, for each of the following, how important it is in your life.","Work","Family","Friends - and acquaintances","Leisure time"],"columns":["name","type","appearance","label","select_from_list_name","required","hint","parameters","calculation"],"languages":[null],"row_count":24,"default_translation":null},"owner__username":"api_user","parent":null,"uid":"az2JpPivNFEdCNWR4mQNcV","tag_string":"","settings":{},"kind":"asset","name":"clone - survey to survey","asset_type":"survey","version_id":"vhMVqgtCbE3CyswvmZpCZg","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/az2JpPivNFEdCNWR4mQNcV/permission-assignments/pMfV4zJgMKC8Z5DLhPbSk8/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/","label":"Add - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/az2JpPivNFEdCNWR4mQNcV/permission-assignments/py3JddqHj3GwC2LCxA3zCo/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/","label":"Edit - form"},{"url":"https://kobo.correlaid.org/api/v2/assets/az2JpPivNFEdCNWR4mQNcV/permission-assignments/phqkLnm2gdQRSAD7Gqpn4C/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/","label":"Edit - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/az2JpPivNFEdCNWR4mQNcV/permission-assignments/pJx8535pD9F3nkmj4Wd9Jo/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/","label":"Delete - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/az2JpPivNFEdCNWR4mQNcV/permission-assignments/pn9JX7T8YbdzS4yBAiWTWS/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/","label":"Manage - project"},{"url":"https://kobo.correlaid.org/api/v2/assets/az2JpPivNFEdCNWR4mQNcV/permission-assignments/pV9yqSKiq6yQzkimdLFn8D/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/","label":"Validate - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/az2JpPivNFEdCNWR4mQNcV/permission-assignments/p4hEiJqYe6H442FjbBYHXd/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/","label":"View - form"},{"url":"https://kobo.correlaid.org/api/v2/assets/az2JpPivNFEdCNWR4mQNcV/permission-assignments/p89jr5JCdZyhvAaQ7o2uCw/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/","label":"View - submissions"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/az2JpPivNFEdCNWR4mQNcV.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/az2JpPivNFEdCNWR4mQNcV.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/az2JpPivNFEdCNWR4mQNcV/data/"},{"url":"https://kobo.correlaid.org/api/v2/assets/a5jjyWLUEmi49EHML6t9Nr/","date_modified":"2021-07-06T18:57:56.170304Z","date_created":"2021-06-12T14:32:20.811531Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/","summary":{"geo":true,"labels":["Please - say, for each of the following, how important it is in your life.","Work","Family","Friends - and acquaintances","Leisure time"],"columns":["name","type","appearance","label","select_from_list_name","required","hint","parameters","calculation"],"languages":[null],"row_count":24,"default_translation":null},"owner__username":"api_user","parent":null,"uid":"a5jjyWLUEmi49EHML6t9Nr","tag_string":"","settings":{},"kind":"asset","name":"1206 - uploaded xls form","asset_type":"survey","version_id":"vH8kmSS552rACZCFjtPcHp","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/a5jjyWLUEmi49EHML6t9Nr/permission-assignments/pgDoNFTtYX3oPvPpWrYdgy/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/","label":"Add - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/a5jjyWLUEmi49EHML6t9Nr/permission-assignments/pkdDRZqpUbWBfQSDKPtFLd/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/","label":"Edit - form"},{"url":"https://kobo.correlaid.org/api/v2/assets/a5jjyWLUEmi49EHML6t9Nr/permission-assignments/pEqitR3jCWJ9gZkt5NQWaP/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/","label":"Edit - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/a5jjyWLUEmi49EHML6t9Nr/permission-assignments/pmoX7HwKSQUJX8LheRQBvQ/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/","label":"Delete - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/a5jjyWLUEmi49EHML6t9Nr/permission-assignments/pNzQjx94aECX2rir2URzrQ/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/","label":"Manage - project"},{"url":"https://kobo.correlaid.org/api/v2/assets/a5jjyWLUEmi49EHML6t9Nr/permission-assignments/p5B6DNDYBewGrvoFBaT6DA/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/","label":"Validate - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/a5jjyWLUEmi49EHML6t9Nr/permission-assignments/pbqkSBVUd2vasUvVZzLyq2/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/","label":"View - form"},{"url":"https://kobo.correlaid.org/api/v2/assets/a5jjyWLUEmi49EHML6t9Nr/permission-assignments/p7zGv4WgPSwW76KcSD6t3R/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/","label":"View - submissions"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/a5jjyWLUEmi49EHML6t9Nr.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/a5jjyWLUEmi49EHML6t9Nr.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/a5jjyWLUEmi49EHML6t9Nr/data/"},{"url":"https://kobo.correlaid.org/api/v2/assets/asq8bkKEk7qdst87UctMLb/","date_modified":"2021-07-05T22:05:36.188044Z","date_created":"2021-07-05T22:05:36.188020Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/","summary":{},"owner__username":"api_user","parent":null,"uid":"asq8bkKEk7qdst87UctMLb","tag_string":"","settings":{},"kind":"asset","name":"new - 0507 This is a cloned survey (via API/R)","asset_type":"survey","version_id":"vmRrMK7Vdo9BMPGLGdAKBy","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/asq8bkKEk7qdst87UctMLb/permission-assignments/pNFd2EDvXRcCTG3UkeH5iW/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/","label":"Add - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/asq8bkKEk7qdst87UctMLb/permission-assignments/pM4qnhBKUU9zckYP8YTS44/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/","label":"Edit - form"},{"url":"https://kobo.correlaid.org/api/v2/assets/asq8bkKEk7qdst87UctMLb/permission-assignments/pR5QjkeUajkeGdjzmnWVXr/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/","label":"Edit - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/asq8bkKEk7qdst87UctMLb/permission-assignments/pS8ptaTbRsUmZ4uBPtJRzM/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/","label":"Delete - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/asq8bkKEk7qdst87UctMLb/permission-assignments/pSLDeqZXgEqednH9nz2H6y/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/","label":"Manage - project"},{"url":"https://kobo.correlaid.org/api/v2/assets/asq8bkKEk7qdst87UctMLb/permission-assignments/prGE9ioA6RVgFf4DDJ82MF/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/","label":"Validate - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/asq8bkKEk7qdst87UctMLb/permission-assignments/pkYpWKtmbgBQZoZphupJDq/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/","label":"View - form"},{"url":"https://kobo.correlaid.org/api/v2/assets/asq8bkKEk7qdst87UctMLb/permission-assignments/pUZt2gwRUuuMsFvUK6b99g/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/","label":"View - submissions"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/asq8bkKEk7qdst87UctMLb.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/asq8bkKEk7qdst87UctMLb.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/asq8bkKEk7qdst87UctMLb/data/"},{"url":"https://kobo.correlaid.org/api/v2/assets/aoEbMPTnXXhSzKKiPSCajJ/","date_modified":"2021-06-22T20:45:36.316977Z","date_created":"2021-06-22T20:45:36.316953Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/","summary":{},"owner__username":"api_user","parent":null,"uid":"aoEbMPTnXXhSzKKiPSCajJ","tag_string":"","settings":{},"kind":"asset","name":"malte_mm","asset_type":"survey","version_id":"vZD4wzjQye2GgWDPUYzd87","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/aoEbMPTnXXhSzKKiPSCajJ/permission-assignments/pBR54xoZ3HhQcoCSJJGd7Z/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/","label":"Add - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aoEbMPTnXXhSzKKiPSCajJ/permission-assignments/p73EsvLcVRuvLjeFe8F26b/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/","label":"Edit - form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aoEbMPTnXXhSzKKiPSCajJ/permission-assignments/pRxkVW2utyhaNJ7PiUCBA6/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/","label":"Edit - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aoEbMPTnXXhSzKKiPSCajJ/permission-assignments/pJAquhmUf54rU9gn2wuj9C/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/","label":"Delete - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aoEbMPTnXXhSzKKiPSCajJ/permission-assignments/poL6cv8i5WVuayuSRgeTQ3/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/","label":"Manage - project"},{"url":"https://kobo.correlaid.org/api/v2/assets/aoEbMPTnXXhSzKKiPSCajJ/permission-assignments/pBzpLNzYdB8TufGFiFj7iz/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/","label":"Validate - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aoEbMPTnXXhSzKKiPSCajJ/permission-assignments/pM2SzZPQPdZJLw8Sze74NA/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/","label":"View - form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aoEbMPTnXXhSzKKiPSCajJ/permission-assignments/pnhjaFmEgmTK3mDgXRAHPq/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/","label":"View - submissions"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/aoEbMPTnXXhSzKKiPSCajJ.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/aoEbMPTnXXhSzKKiPSCajJ.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/aoEbMPTnXXhSzKKiPSCajJ/data/"},{"url":"https://kobo.correlaid.org/api/v2/assets/awVHD2euGQBNzRBN7FcaUL/","date_modified":"2021-06-12T14:34:31.102677Z","date_created":"2021-06-12T14:34:31.102659Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/","summary":{"geo":true,"labels":["Please - say, for each of the following, how important it is in your life.","Work","Family","Friends - and acquaintances","Leisure time"],"columns":["type","name","appearance","label","select_from_list_name","required","hint","parameters","calculation"],"languages":[null],"row_count":24,"default_translation":null},"owner__username":"api_user","parent":null,"uid":"awVHD2euGQBNzRBN7FcaUL","tag_string":"","settings":{},"kind":"asset","name":"vcr_test_name","asset_type":"survey","version_id":"vJHfrTxnZzb2XMxKi2e8r4","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/awVHD2euGQBNzRBN7FcaUL/permission-assignments/ppnryQDXpV2TSwcFLjLJys/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/","label":"Add - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/awVHD2euGQBNzRBN7FcaUL/permission-assignments/p5D622FYsydLUX6BSH9ahT/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/","label":"Edit - form"},{"url":"https://kobo.correlaid.org/api/v2/assets/awVHD2euGQBNzRBN7FcaUL/permission-assignments/pL5kPC3X4wUTvftRVcSjuQ/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/","label":"Edit - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/awVHD2euGQBNzRBN7FcaUL/permission-assignments/pS94FXLJyv2mQzLcWbsPxT/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/","label":"Delete - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/awVHD2euGQBNzRBN7FcaUL/permission-assignments/pbxYmt8Jh6zs7a2oBCjnjz/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/","label":"Manage - project"},{"url":"https://kobo.correlaid.org/api/v2/assets/awVHD2euGQBNzRBN7FcaUL/permission-assignments/pkXz4m29wyBMyrpqZkafYv/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/","label":"Validate - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/awVHD2euGQBNzRBN7FcaUL/permission-assignments/pWnW5RctbxUPYbmWGkLVtN/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/","label":"View - form"},{"url":"https://kobo.correlaid.org/api/v2/assets/awVHD2euGQBNzRBN7FcaUL/permission-assignments/p9LKmAjfSmHrm247oAjaEf/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/","label":"View - submissions"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/awVHD2euGQBNzRBN7FcaUL.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/awVHD2euGQBNzRBN7FcaUL.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/awVHD2euGQBNzRBN7FcaUL/data/"},{"url":"https://kobo.correlaid.org/api/v2/assets/aNz6G8AXqvW2fejymw2eBo/","date_modified":"2021-06-12T14:07:07.280823Z","date_created":"2021-06-12T14:07:07.280800Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/","summary":{},"owner__username":"api_user","parent":null,"uid":"aNz6G8AXqvW2fejymw2eBo","tag_string":"","settings":{},"kind":"asset","name":"vcr_test_name","asset_type":"survey","version_id":"vDeK4YC8HiwGZHbiyGPWuR","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/aNz6G8AXqvW2fejymw2eBo/permission-assignments/pBMsomczaLzvA6sBigxJy3/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/","label":"Add - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aNz6G8AXqvW2fejymw2eBo/permission-assignments/pEtyCneas8hpEBH8VJ868q/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/","label":"Edit - form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aNz6G8AXqvW2fejymw2eBo/permission-assignments/p7noF45vPTu4iYFdqn64Qg/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/","label":"Edit - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aNz6G8AXqvW2fejymw2eBo/permission-assignments/pgbHhJHrMZZ95pGDmP3CcN/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/","label":"Delete - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aNz6G8AXqvW2fejymw2eBo/permission-assignments/p7CmVz5uNY7M36MLy2tpKm/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/","label":"Manage - project"},{"url":"https://kobo.correlaid.org/api/v2/assets/aNz6G8AXqvW2fejymw2eBo/permission-assignments/pUmmy4uJJpTrfc5NdPQk6K/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/","label":"Validate - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aNz6G8AXqvW2fejymw2eBo/permission-assignments/pZ8bJbmZYV9zUnSfN5X6as/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/","label":"View - form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aNz6G8AXqvW2fejymw2eBo/permission-assignments/psn66HHNBsPKVhvcWDVuXG/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/","label":"View - submissions"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/aNz6G8AXqvW2fejymw2eBo.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/aNz6G8AXqvW2fejymw2eBo.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/aNz6G8AXqvW2fejymw2eBo/data/"},{"url":"https://kobo.correlaid.org/api/v2/assets/aQVGH8G68EP737tDBABRwC/","date_modified":"2021-06-12T13:37:10.361276Z","date_created":"2021-06-12T13:08:44.929148Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/","summary":{},"owner__username":"api_user","parent":null,"uid":"aQVGH8G68EP737tDBABRwC","tag_string":"","settings":{},"kind":"asset","name":"vcr_test_name","asset_type":"survey","version_id":"vCrdJjJCz5uLQrGsGDQhDF","has_deployment":true,"deployed_version_id":"vCrdJjJCz5uLQrGsGDQhDF","deployment__identifier":"https://kc.correlaid.org/api_user/forms/aQVGH8G68EP737tDBABRwC","deployment__active":true,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/aQVGH8G68EP737tDBABRwC/permission-assignments/pWteuYWurvhpnmj9bFwznK/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/","label":"Add - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aQVGH8G68EP737tDBABRwC/permission-assignments/pQzTbPjHh23VmJYjbrABBm/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/","label":"Edit - form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aQVGH8G68EP737tDBABRwC/permission-assignments/peXsNZbPygV4eQcc4e66YM/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/","label":"Edit - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aQVGH8G68EP737tDBABRwC/permission-assignments/pptCWLHPCoqFPhDdoRXvNS/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/","label":"Delete - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aQVGH8G68EP737tDBABRwC/permission-assignments/pP7zEB4zyAEYbGt3mnNh3e/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/","label":"Manage - project"},{"url":"https://kobo.correlaid.org/api/v2/assets/aQVGH8G68EP737tDBABRwC/permission-assignments/pTiL3oi4Sjny2NN7WfiM9u/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/","label":"Validate - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aQVGH8G68EP737tDBABRwC/permission-assignments/pcxJLozwrjLHW3QGckQz4J/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/","label":"View - form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aQVGH8G68EP737tDBABRwC/permission-assignments/pX7eiGzAXxR7HxQPPDn26T/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/","label":"View - submissions"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/aQVGH8G68EP737tDBABRwC.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/aQVGH8G68EP737tDBABRwC.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/aQVGH8G68EP737tDBABRwC/data/"},{"url":"https://kobo.correlaid.org/api/v2/assets/amvEQmDhKf4zUDV8y8fmSa/","date_modified":"2021-06-12T13:23:02.871032Z","date_created":"2021-06-12T12:45:18.542410Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/","summary":{},"owner__username":"api_user","parent":null,"uid":"amvEQmDhKf4zUDV8y8fmSa","tag_string":"","settings":{},"kind":"asset","name":"vcr_test_name","asset_type":"survey","version_id":"vxmaun2oB23QWSUiGByUft","has_deployment":true,"deployed_version_id":"vxmaun2oB23QWSUiGByUft","deployment__identifier":"https://kc.correlaid.org/api_user/forms/amvEQmDhKf4zUDV8y8fmSa","deployment__active":true,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/amvEQmDhKf4zUDV8y8fmSa/permission-assignments/pC5cZMZcv8zWwd9tpyskQN/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/","label":"Add - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/amvEQmDhKf4zUDV8y8fmSa/permission-assignments/pDqgdJBJFGeecse7K3vwmc/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/","label":"Edit - form"},{"url":"https://kobo.correlaid.org/api/v2/assets/amvEQmDhKf4zUDV8y8fmSa/permission-assignments/pHHLMJypN72AmSAyFc4XCX/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/","label":"Edit - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/amvEQmDhKf4zUDV8y8fmSa/permission-assignments/pMF5CLfLbyhTm2Lg23jgzw/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/","label":"Delete - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/amvEQmDhKf4zUDV8y8fmSa/permission-assignments/pCu2Xgzpb5hAjEpL3XoU3W/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/","label":"Manage - project"},{"url":"https://kobo.correlaid.org/api/v2/assets/amvEQmDhKf4zUDV8y8fmSa/permission-assignments/pni6DQNwb4JjDvYiGL767h/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/","label":"Validate - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/amvEQmDhKf4zUDV8y8fmSa/permission-assignments/p6xYYAGjp86mScYphMMnYH/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/","label":"View - form"},{"url":"https://kobo.correlaid.org/api/v2/assets/amvEQmDhKf4zUDV8y8fmSa/permission-assignments/p9ufCcNDYWmXYQ99t8Sm8Z/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/","label":"View - submissions"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/amvEQmDhKf4zUDV8y8fmSa.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/amvEQmDhKf4zUDV8y8fmSa.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/amvEQmDhKf4zUDV8y8fmSa/data/"},{"url":"https://kobo.correlaid.org/api/v2/assets/a84jmwwdPEsZMhK7s2i4SL/","date_modified":"2021-06-08T21:08:36.193053Z","date_created":"2021-05-15T18:50:36.054394Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/","summary":{},"owner__username":"api_user","parent":null,"uid":"a84jmwwdPEsZMhK7s2i4SL","tag_string":"","settings":{},"kind":"asset","name":"A - survey object created via API/R","asset_type":"survey","version_id":"vrFx4VXXPVf6nThHWShbT4","has_deployment":true,"deployed_version_id":"vrFx4VXXPVf6nThHWShbT4","deployment__identifier":"https://kc.correlaid.org/api_user/forms/a84jmwwdPEsZMhK7s2i4SL","deployment__active":true,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/a84jmwwdPEsZMhK7s2i4SL/permission-assignments/pP2WmnNULKmpHuCen7uADN/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/","label":"Add - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/a84jmwwdPEsZMhK7s2i4SL/permission-assignments/pFHqEz8MLBfQR4KgEHa4sQ/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/","label":"Edit - form"},{"url":"https://kobo.correlaid.org/api/v2/assets/a84jmwwdPEsZMhK7s2i4SL/permission-assignments/pqzz2xF7mWb6CmELvuEnQ7/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/","label":"Edit - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/a84jmwwdPEsZMhK7s2i4SL/permission-assignments/pZLpGn4QEV7PjwNvQznnbU/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/","label":"Delete - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/a84jmwwdPEsZMhK7s2i4SL/permission-assignments/peMU4HmNMmynoWQVHGzdCn/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/","label":"Manage - project"},{"url":"https://kobo.correlaid.org/api/v2/assets/a84jmwwdPEsZMhK7s2i4SL/permission-assignments/pUJn6uhe3cZ4CQghu5aAUT/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/","label":"Validate - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/a84jmwwdPEsZMhK7s2i4SL/permission-assignments/pH37tYqYySZz9ff7SujeDL/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/","label":"View - form"},{"url":"https://kobo.correlaid.org/api/v2/assets/a84jmwwdPEsZMhK7s2i4SL/permission-assignments/pWCyCDL6qpXutV2xfkcPQo/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/","label":"View - submissions"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/a84jmwwdPEsZMhK7s2i4SL.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/a84jmwwdPEsZMhK7s2i4SL.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/a84jmwwdPEsZMhK7s2i4SL/data/"},{"url":"https://kobo.correlaid.org/api/v2/assets/aqhMVBiEQkpshvZwqGwHp4/","date_modified":"2021-06-08T06:27:03.919193Z","date_created":"2021-06-08T06:25:58.456587Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/","summary":{"geo":false,"labels":["New - Question"],"columns":["type","label","required","select_from_list_name"],"languages":[null],"row_count":1,"default_translation":null},"owner__username":"api_user","parent":null,"uid":"aqhMVBiEQkpshvZwqGwHp4","tag_string":"","settings":{"sector":null,"country":null,"description":"","share-metadata":false},"kind":"asset","name":"test2","asset_type":"survey","version_id":"vvuFEhkumaKBYuiAJzQxEo","has_deployment":true,"deployed_version_id":"vvuFEhkumaKBYuiAJzQxEo","deployment__identifier":"https://kc.correlaid.org/api_user/forms/aqhMVBiEQkpshvZwqGwHp4","deployment__active":true,"deployment__submission_count":2,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/aqhMVBiEQkpshvZwqGwHp4/permission-assignments/puXFGRst3d53QVfFKni7yX/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/","label":"Add - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aqhMVBiEQkpshvZwqGwHp4/permission-assignments/pc64H4ixqehQWSgKLLUpSY/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/","label":"Edit - form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aqhMVBiEQkpshvZwqGwHp4/permission-assignments/p5dLUeaaDgSHFuPEftyzYV/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/","label":"Edit - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aqhMVBiEQkpshvZwqGwHp4/permission-assignments/pbC2uk6NAHieFRa52ZSdqu/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/","label":"Delete - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aqhMVBiEQkpshvZwqGwHp4/permission-assignments/pQL3Qp6g8YEi8cLN9R6JKd/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/","label":"Manage - project"},{"url":"https://kobo.correlaid.org/api/v2/assets/aqhMVBiEQkpshvZwqGwHp4/permission-assignments/pHLf2EFst63XwYX9wTfodK/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/","label":"Validate - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aqhMVBiEQkpshvZwqGwHp4/permission-assignments/p9iJ7aeFK7dyvFW2PEuPco/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/","label":"View - form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aqhMVBiEQkpshvZwqGwHp4/permission-assignments/p2kMFufESbVzVKN3Y7aZ93/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/","label":"View - submissions"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/aqhMVBiEQkpshvZwqGwHp4.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/aqhMVBiEQkpshvZwqGwHp4.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/aqhMVBiEQkpshvZwqGwHp4/data/"},{"url":"https://kobo.correlaid.org/api/v2/assets/aDsfwoHCXhHX3i84ZM8UKs/","date_modified":"2021-06-01T18:34:17.120631Z","date_created":"2021-06-01T18:34:17.120607Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/","summary":{},"owner__username":"api_user","parent":null,"uid":"aDsfwoHCXhHX3i84ZM8UKs","tag_string":"","settings":{},"kind":"asset","name":"vignette - code - This is a cloned survey (via API/R)","asset_type":"survey","version_id":"vmdbdsMg4AYtUVkZBnm6J9","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/aDsfwoHCXhHX3i84ZM8UKs/permission-assignments/pWkbfznLbCh9FhdL6eMcP7/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/","label":"Add - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aDsfwoHCXhHX3i84ZM8UKs/permission-assignments/pYeeHHwZYSvB38b5ACZsYu/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/","label":"Edit - form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aDsfwoHCXhHX3i84ZM8UKs/permission-assignments/pueAicEBzgPUB8DRvcoQwe/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/","label":"Edit - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aDsfwoHCXhHX3i84ZM8UKs/permission-assignments/p563nxwADHRAgVG78Gv8d4/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/","label":"Delete - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aDsfwoHCXhHX3i84ZM8UKs/permission-assignments/pFdcJAZhKmRzpjGM9LVicC/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/","label":"Manage - project"},{"url":"https://kobo.correlaid.org/api/v2/assets/aDsfwoHCXhHX3i84ZM8UKs/permission-assignments/pQd73RQYUBJrczQYZXWE5Y/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/","label":"Validate - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aDsfwoHCXhHX3i84ZM8UKs/permission-assignments/ptZWm2pV3cYhxEhH4SPrQb/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/","label":"View - form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aDsfwoHCXhHX3i84ZM8UKs/permission-assignments/pbrhERpnsHdMDuDTcnoLQs/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/","label":"View - submissions"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/aDsfwoHCXhHX3i84ZM8UKs.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/aDsfwoHCXhHX3i84ZM8UKs.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/aDsfwoHCXhHX3i84ZM8UKs/data/"},{"url":"https://kobo.correlaid.org/api/v2/assets/awC7sYUkvs9s3ZekcTnbTX/","date_modified":"2021-05-27T20:26:36.197584Z","date_created":"2021-05-27T20:26:36.197562Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/","summary":{},"owner__username":"api_user","parent":null,"uid":"awC7sYUkvs9s3ZekcTnbTX","tag_string":"","settings":{},"kind":"asset","name":"string","asset_type":"survey","version_id":"vfNsbsMXBPcpocvsqhMhZu","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/awC7sYUkvs9s3ZekcTnbTX/permission-assignments/ps3fPWdSD5trPykr6F28is/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/","label":"Add - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/awC7sYUkvs9s3ZekcTnbTX/permission-assignments/piaXijd4VpajRx6k9dpdDP/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/","label":"Edit - form"},{"url":"https://kobo.correlaid.org/api/v2/assets/awC7sYUkvs9s3ZekcTnbTX/permission-assignments/pavA4BNXF7KjKyBPtt9KKL/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/","label":"Edit - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/awC7sYUkvs9s3ZekcTnbTX/permission-assignments/pvPmBb4pYXWuVctuyU4uwr/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/","label":"Delete - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/awC7sYUkvs9s3ZekcTnbTX/permission-assignments/pV4eK5EBu5BpMGAyjf4N4w/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/","label":"Manage - project"},{"url":"https://kobo.correlaid.org/api/v2/assets/awC7sYUkvs9s3ZekcTnbTX/permission-assignments/pGeniMjkNu7b53Kmd2db8V/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/","label":"Validate - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/awC7sYUkvs9s3ZekcTnbTX/permission-assignments/pjNHZYkMZmXLcMEkfUeRrQ/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/","label":"View - form"},{"url":"https://kobo.correlaid.org/api/v2/assets/awC7sYUkvs9s3ZekcTnbTX/permission-assignments/p7LvhHdr9bdAZwFRCMoLGe/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/","label":"View - submissions"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/awC7sYUkvs9s3ZekcTnbTX.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/awC7sYUkvs9s3ZekcTnbTX.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/awC7sYUkvs9s3ZekcTnbTX/data/"},{"url":"https://kobo.correlaid.org/api/v2/assets/aMPwk5HB3C6nt3e7yH2Ppo/","date_modified":"2021-05-15T19:06:24.927986Z","date_created":"2021-05-15T19:05:17.311721Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/","summary":{"geo":false,"labels":["Your - name","Your age","Your favourite dog","Your favourite cat"],"columns":["type","label","required","select_from_list_name"],"languages":[null],"row_count":4,"default_translation":null},"owner__username":"api_user","parent":null,"uid":"aMPwk5HB3C6nt3e7yH2Ppo","tag_string":"","settings":{"sector":{"label":"Other","value":"Other"},"country":{"label":"Germany","value":"DEU"},"description":""},"kind":"asset","name":"This - is a cloned survey (via API/R)","asset_type":"survey","version_id":"vN7gDMN3Td8BEw8T56jkdz","has_deployment":true,"deployed_version_id":"vN7gDMN3Td8BEw8T56jkdz","deployment__identifier":"https://kc.correlaid.org/api_user/forms/aMPwk5HB3C6nt3e7yH2Ppo","deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/aMPwk5HB3C6nt3e7yH2Ppo/permission-assignments/pafJxbJ393kwMa6h2azqes/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/","label":"Add - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aMPwk5HB3C6nt3e7yH2Ppo/permission-assignments/prbeRno37N6BrVxYecE6bE/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/","label":"Edit - form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aMPwk5HB3C6nt3e7yH2Ppo/permission-assignments/pFQLp9k7E5gdNpVfQ7kgHn/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/","label":"Edit - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aMPwk5HB3C6nt3e7yH2Ppo/permission-assignments/pnTHhhhVh9QjSfrWxyFNmN/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/","label":"Delete - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aMPwk5HB3C6nt3e7yH2Ppo/permission-assignments/pAa7oZv5CeZNA539knsaT4/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/","label":"Manage - project"},{"url":"https://kobo.correlaid.org/api/v2/assets/aMPwk5HB3C6nt3e7yH2Ppo/permission-assignments/pwndvZuiuuWsKjbg5BCcsw/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/","label":"Validate - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aMPwk5HB3C6nt3e7yH2Ppo/permission-assignments/pfnzZ3uPryi86d7yoDh5Wg/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/","label":"View - form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aMPwk5HB3C6nt3e7yH2Ppo/permission-assignments/pf6PTwyAqeghSdVotG2PQW/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/","label":"View - submissions"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/aMPwk5HB3C6nt3e7yH2Ppo.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/aMPwk5HB3C6nt3e7yH2Ppo.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/aMPwk5HB3C6nt3e7yH2Ppo/data/"},{"url":"https://kobo.correlaid.org/api/v2/assets/ajzghKK6NELaixPQqsm49e/","date_modified":"2021-05-13T16:59:25.147719Z","date_created":"2021-04-28T19:52:13.144873Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/","summary":{"geo":false,"labels":["Your - name","Your age","Your favourite dog","Your favourite cat"],"columns":["type","label","required","select_from_list_name"],"languages":[null],"row_count":4,"default_translation":null},"owner__username":"api_user","parent":null,"uid":"ajzghKK6NELaixPQqsm49e","tag_string":"","settings":{"sector":{"label":"Other","value":"Other"},"country":{"label":"Germany","value":"DEU"},"description":"","share-metadata":false},"kind":"asset","name":"test_built_from_scratch","asset_type":"survey","version_id":"v39addKozAjjUTpsr8eYRm","has_deployment":true,"deployed_version_id":"v39addKozAjjUTpsr8eYRm","deployment__identifier":"https://kc.correlaid.org/api_user/forms/ajzghKK6NELaixPQqsm49e","deployment__active":true,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/ajzghKK6NELaixPQqsm49e/permission-assignments/pNh4FweRqmRpTGz5r49QsY/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/","label":"Add - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/ajzghKK6NELaixPQqsm49e/permission-assignments/pHFo8upcnYmy9rnhFEQ3gf/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/","label":"Edit - form"},{"url":"https://kobo.correlaid.org/api/v2/assets/ajzghKK6NELaixPQqsm49e/permission-assignments/pZgG8gtvSRUJFD9PCx8KVu/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/","label":"Edit - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/ajzghKK6NELaixPQqsm49e/permission-assignments/ph6z7ox7XG79Mv6ApCpHjW/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/","label":"Delete - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/ajzghKK6NELaixPQqsm49e/permission-assignments/pFefHXsa5tMSx5HdufFUyj/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/","label":"Manage - project"},{"url":"https://kobo.correlaid.org/api/v2/assets/ajzghKK6NELaixPQqsm49e/permission-assignments/pdG8GpXaRpHqPpZrcoNfLJ/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/","label":"Validate - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/ajzghKK6NELaixPQqsm49e/permission-assignments/p8MCoXV4zWS9Ww7AjTnrNW/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/","label":"View - form"},{"url":"https://kobo.correlaid.org/api/v2/assets/ajzghKK6NELaixPQqsm49e/permission-assignments/p8piyLxXaq94EeQX3FjNTD/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/","label":"View - submissions"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/ajzghKK6NELaixPQqsm49e.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/ajzghKK6NELaixPQqsm49e.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/ajzghKK6NELaixPQqsm49e/data/"},{"url":"https://kobo.correlaid.org/api/v2/assets/aZX4ysiPdP3JHnTMbnu2n2/","date_modified":"2021-05-03T15:01:49.807891Z","date_created":"2021-02-25T15:29:57.813770Z","owner":"https://kobo.correlaid.org/api/v2/users/super_admin/","summary":{"geo":false,"labels":["Hello!","Disclaimer","What - is your first name?","What is your last name?","Which email address can we - use to contact you?"],"columns":["type","name","required","label","hint","constraint","constraint_message","select_from_list_name","relevant","kobo--score-choices","guidance_hint"],"languages":["English - (en)","Deutsch (de)"],"row_count":47,"default_translation":"English (en)"},"owner__username":"super_admin","parent":"https://kobo.correlaid.org/api/v2/collections/cjpaoCes6BZiCbzn9Tv6bA/","uid":"aZX4ysiPdP3JHnTMbnu2n2","tag_string":"","settings":{},"kind":"asset","name":"Template - survey applications","asset_type":"template","version_id":"vMD7uBPhuWpRMCmJuKVrHp","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/aZX4ysiPdP3JHnTMbnu2n2/permission-assignments/pp36NL4VjBftHBtRCZk57E/","user":"https://kobo.correlaid.org/api/v2/users/AnonymousUser/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/","label":"View - template"},{"url":"https://kobo.correlaid.org/api/v2/assets/aZX4ysiPdP3JHnTMbnu2n2/permission-assignments/pHSuoJARdj6whAguP4bR95/","user":"https://kobo.correlaid.org/api/v2/users/super_admin/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/","label":"Edit - template"},{"url":"https://kobo.correlaid.org/api/v2/assets/aZX4ysiPdP3JHnTMbnu2n2/permission-assignments/pxvuW7j3gv9EgqSZFuC2bp/","user":"https://kobo.correlaid.org/api/v2/users/super_admin/","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/","label":"Manage - template"},{"url":"https://kobo.correlaid.org/api/v2/assets/aZX4ysiPdP3JHnTMbnu2n2/permission-assignments/pLQwWRnuW7VQ3wS6ANT6ow/","user":"https://kobo.correlaid.org/api/v2/users/super_admin/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/","label":"View - template"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/aZX4ysiPdP3JHnTMbnu2n2.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/aZX4ysiPdP3JHnTMbnu2n2.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/aZX4ysiPdP3JHnTMbnu2n2/data/"},{"url":"https://kobo.correlaid.org/api/v2/assets/aSmGHTKbLZWu2uc4HzEbtn/","date_modified":"2021-03-20T20:58:54.630077Z","date_created":"2021-03-20T20:54:26.707919Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/","summary":{"geo":true,"labels":["What - is your favorite ice cream flavor?","What marvel movies have you seen?","what - is your age?","email_address","Where do you live?"],"columns":["type","label","required","select_from_list_name","hint","name","constraint","constraint_message"],"languages":[null,"Deutsch - (de)","English (en)"],"row_count":6,"default_translation":null},"owner__username":"api_user","parent":null,"uid":"aSmGHTKbLZWu2uc4HzEbtn","tag_string":"","settings":{"sector":null,"country":null,"description":"a - survey containing at least one question for each question type","share-metadata":false},"kind":"asset","name":"kbtbr - test survey misc questions","asset_type":"survey","version_id":"vJEfSwVjJE2z4vfWoAcrKr","has_deployment":true,"deployed_version_id":"vJEfSwVjJE2z4vfWoAcrKr","deployment__identifier":"https://kc.correlaid.org/api_user/forms/aSmGHTKbLZWu2uc4HzEbtn","deployment__active":true,"deployment__submission_count":3,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/aSmGHTKbLZWu2uc4HzEbtn/permission-assignments/p6PS8kdkgHWsiUstTTEwwW/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/","label":"Add - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aSmGHTKbLZWu2uc4HzEbtn/permission-assignments/puy3NyiYiJ8hHdWUMUhChJ/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/","label":"Edit - form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aSmGHTKbLZWu2uc4HzEbtn/permission-assignments/peigSbkHJF6bibPvJvHz56/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/","label":"Edit - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aSmGHTKbLZWu2uc4HzEbtn/permission-assignments/pYNHgfx49MSXmNYPF2Uhmo/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/","label":"Delete - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aSmGHTKbLZWu2uc4HzEbtn/permission-assignments/pMVBtkCh8bEX2MFi6yvyjN/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/","label":"Manage - project"},{"url":"https://kobo.correlaid.org/api/v2/assets/aSmGHTKbLZWu2uc4HzEbtn/permission-assignments/pJu2BGRjXQGqkJ9cXTLcsK/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/","label":"Validate - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aSmGHTKbLZWu2uc4HzEbtn/permission-assignments/p8uaVBFvCa8KzJRxWeoT3w/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/","label":"View - form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aSmGHTKbLZWu2uc4HzEbtn/permission-assignments/pNj9tfxWu2PdGM3szsTk6H/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/","label":"View - submissions"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/aSmGHTKbLZWu2uc4HzEbtn.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/aSmGHTKbLZWu2uc4HzEbtn.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/aSmGHTKbLZWu2uc4HzEbtn/data/"},{"url":"https://kobo.correlaid.org/api/v2/assets/akx2SZbwn65hGBAWgBYwiQ/","date_modified":"2021-03-20T20:51:48.113048Z","date_created":"2021-03-20T20:49:29.213835Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/","summary":{"geo":false,"labels":["What - is your first name?","What is your last name?","Which email address can we - use to contact you?","What is your gender?","My gender is:"],"columns":["name","type","label","required","constraint","constraint_message","hint","select_from_list_name","relevant","kobo--score-choices","guidance_hint"],"languages":["English - (en)","Deutsch (de)"],"row_count":43,"default_translation":"English (en)"},"owner__username":"api_user","parent":null,"uid":"akx2SZbwn65hGBAWgBYwiQ","tag_string":"","settings":{"description":"test - survey for development of kbtbr R package","share-metadata":false},"kind":"asset","name":"kbtbr - test survey applications","asset_type":"survey","version_id":"vCHJLzRcCKrSLDzPKbKcFB","has_deployment":true,"deployed_version_id":"vCHJLzRcCKrSLDzPKbKcFB","deployment__identifier":"https://kc.correlaid.org/api_user/forms/akx2SZbwn65hGBAWgBYwiQ","deployment__active":true,"deployment__submission_count":4,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/akx2SZbwn65hGBAWgBYwiQ/permission-assignments/pnyZLEHpnKcCVtFkeqBdbe/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/","label":"Add - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/akx2SZbwn65hGBAWgBYwiQ/permission-assignments/pWDzU3sJuuyAxwPXvToAyj/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/","label":"Edit - form"},{"url":"https://kobo.correlaid.org/api/v2/assets/akx2SZbwn65hGBAWgBYwiQ/permission-assignments/p22BSFCxU9uKb7FJFKmjhY/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/","label":"Edit - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/akx2SZbwn65hGBAWgBYwiQ/permission-assignments/p2hrbBFFgw7XeRuzyXm3Zs/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/","label":"Delete - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/akx2SZbwn65hGBAWgBYwiQ/permission-assignments/pJgmjhfJbEkFgZT3pGSxDA/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/","label":"Manage - project"},{"url":"https://kobo.correlaid.org/api/v2/assets/akx2SZbwn65hGBAWgBYwiQ/permission-assignments/pWBYiU98vEBHyVvYfMQwzn/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/","label":"Validate - submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/akx2SZbwn65hGBAWgBYwiQ/permission-assignments/pEPkXKgVTJ2ziGmCDLPvrC/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/","label":"View - form"},{"url":"https://kobo.correlaid.org/api/v2/assets/akx2SZbwn65hGBAWgBYwiQ/permission-assignments/pcwCQpqmwgryL5agX9Apx7/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/","label":"View - submissions"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/akx2SZbwn65hGBAWgBYwiQ.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/akx2SZbwn65hGBAWgBYwiQ.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/akx2SZbwn65hGBAWgBYwiQ/data/"},{"url":"https://kobo.correlaid.org/api/v2/assets/a7AV5JhRHKf8EWGBJLswwC/","date_modified":"2021-03-20T20:51:13.674659Z","date_created":"2021-03-20T20:50:19.480897Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/","summary":{"geo":false,"labels":["what - is your age?"],"columns":["type","name","label","hint","required","constraint"],"languages":[null],"row_count":1,"default_translation":null},"owner__username":"api_user","parent":null,"uid":"a7AV5JhRHKf8EWGBJLswwC","tag_string":"","settings":{},"kind":"asset","name":"Age","asset_type":"question","version_id":"ve66TcLYqgsfpeQRyA9YZn","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/a7AV5JhRHKf8EWGBJLswwC/permission-assignments/pKxDdHLsvodLsanDMYK4k6/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/","label":"Edit - question"},{"url":"https://kobo.correlaid.org/api/v2/assets/a7AV5JhRHKf8EWGBJLswwC/permission-assignments/p4ZPwsutnufKJceaKte7Ab/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/","label":"Manage - question"},{"url":"https://kobo.correlaid.org/api/v2/assets/a7AV5JhRHKf8EWGBJLswwC/permission-assignments/pU7m8s8y7S9LYnUKWya4Me/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/","label":"View - question"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/a7AV5JhRHKf8EWGBJLswwC.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/a7AV5JhRHKf8EWGBJLswwC.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/a7AV5JhRHKf8EWGBJLswwC/data/"},{"url":"https://kobo.correlaid.org/api/v2/assets/a45JAGjSNac4tQGREXR79e/","date_modified":"2021-02-25T15:15:00.494023Z","date_created":"2021-02-25T07:45:34.578117Z","owner":"https://kobo.correlaid.org/api/v2/users/super_admin/","summary":{"geo":false,"labels":["What - is your gender?","My gender is:"],"columns":["hint","name","type","label","required","select_from_list_name","relevant"],"languages":["English - (en)","Deutsch (de)"],"row_count":2,"default_translation":"English (en)"},"owner__username":"super_admin","parent":"https://kobo.correlaid.org/api/v2/collections/cjpaoCes6BZiCbzn9Tv6bA/","uid":"a45JAGjSNac4tQGREXR79e","tag_string":"","settings":{},"kind":"asset","name":"gender","asset_type":"block","version_id":"vvvbx6kAbsWDsqahxFxfmx","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/a45JAGjSNac4tQGREXR79e/permission-assignments/pp3zL2eF8nHCCJQjyiftYP/","user":"https://kobo.correlaid.org/api/v2/users/AnonymousUser/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/","label":"View - block"},{"url":"https://kobo.correlaid.org/api/v2/assets/a45JAGjSNac4tQGREXR79e/permission-assignments/peNGxpyTBD8nueLwFJgGUT/","user":"https://kobo.correlaid.org/api/v2/users/super_admin/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/","label":"Edit - block"},{"url":"https://kobo.correlaid.org/api/v2/assets/a45JAGjSNac4tQGREXR79e/permission-assignments/p2vS7GToSNmuS2TWAqX9YK/","user":"https://kobo.correlaid.org/api/v2/users/super_admin/","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/","label":"Manage - block"},{"url":"https://kobo.correlaid.org/api/v2/assets/a45JAGjSNac4tQGREXR79e/permission-assignments/pQW49WA8zj7LNnMv54Dv2L/","user":"https://kobo.correlaid.org/api/v2/users/super_admin/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/","label":"View - block"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/a45JAGjSNac4tQGREXR79e.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/a45JAGjSNac4tQGREXR79e.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/a45JAGjSNac4tQGREXR79e/data/"},{"url":"https://kobo.correlaid.org/api/v2/assets/a9BzPvnNLub346sr8M7R33/","date_modified":"2021-02-25T14:46:55.138284Z","date_created":"2021-02-25T07:45:19.198776Z","owner":"https://kobo.correlaid.org/api/v2/users/super_admin/","summary":{"geo":false,"labels":["What - is your first name?","What is your last name?","Which email address can we - use to contact you?"],"columns":["type","name","required","label","constraint","constraint_message"],"languages":["English - (en)","Deutsch (de)"],"row_count":3,"default_translation":"English (en)"},"owner__username":"super_admin","parent":"https://kobo.correlaid.org/api/v2/collections/cjpaoCes6BZiCbzn9Tv6bA/","uid":"a9BzPvnNLub346sr8M7R33","tag_string":"","settings":{},"kind":"asset","name":"name - and email","asset_type":"block","version_id":"vSEHjmUidgBcfC56tGsDuJ","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/a9BzPvnNLub346sr8M7R33/permission-assignments/pKFAAdjpFdYcwHNhMGWg4s/","user":"https://kobo.correlaid.org/api/v2/users/AnonymousUser/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/","label":"View - block"},{"url":"https://kobo.correlaid.org/api/v2/assets/a9BzPvnNLub346sr8M7R33/permission-assignments/pyhWc7z6D4EaQVeXoo38Pa/","user":"https://kobo.correlaid.org/api/v2/users/super_admin/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/","label":"Edit - block"},{"url":"https://kobo.correlaid.org/api/v2/assets/a9BzPvnNLub346sr8M7R33/permission-assignments/p2ow2DBYsTuyBD3SXueFjv/","user":"https://kobo.correlaid.org/api/v2/users/super_admin/","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/","label":"Manage - block"},{"url":"https://kobo.correlaid.org/api/v2/assets/a9BzPvnNLub346sr8M7R33/permission-assignments/pUaxf7JWWrefyH5XFN59yT/","user":"https://kobo.correlaid.org/api/v2/users/super_admin/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/","label":"View - block"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/a9BzPvnNLub346sr8M7R33.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/a9BzPvnNLub346sr8M7R33.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/a9BzPvnNLub346sr8M7R33/data/"}]}' - recorded_at: 2021-10-03 17:12:53 GMT - recorded_with: vcr/0.6.0, webmockr/0.8.0 diff --git a/vignettes/assets/clone-asset.yml b/vignettes/assets/clone-asset.yml new file mode 100644 index 0000000..78bb5f7 --- /dev/null +++ b/vignettes/assets/clone-asset.yml @@ -0,0 +1,106 @@ +http_interactions: +- request: + method: post + uri: https://kobo.correlaid.org/api/v2/assets/ + body: + encoding: '' + string: clone_from=aRo4wg5utWT7dwdnQQEAE7,name=Test survey copy,asset_type=survey + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3 crul/1.1.0 + Accept-Encoding: gzip, deflate + Authorization: fakebearertoken + Accept: application/json + response: + status: + status_code: '201' + message: Created + explanation: Document created, URL follows + headers: + status: HTTP/1.1 201 Created + server: nginx + date: Mon, 24 Jan 2022 13:04:49 GMT + content-type: application/json + content-length: '13383' + connection: keep-alive + location: https://kobo.correlaid.org/api/v2/assets/ackE4RGzXMjWBei3bRHPbb/ + vary: Accept, Accept-Language, Cookie, Origin + allow: GET, POST, HEAD, OPTIONS + x-kobonaut: api_user + x-frame-options: SAMEORIGIN + content-language: en + body: + encoding: UTF-8 + file: no + string: '{"url":"https://kobo.correlaid.org/api/v2/assets/ackE4RGzXMjWBei3bRHPbb/","owner":"https://kobo.correlaid.org/api/v2/users/api_user/","owner__username":"api_user","parent":null,"ancestors":null,"settings":{"sector":{"label":"Other","value":"Other"},"country":{"label":"Germany","value":"DEU"},"description":"Yet + another testing form for package development"},"asset_type":"survey","date_created":"2022-01-24T13:04:49.219153Z","summary":{"row_count":21,"languages":[null],"default_translation":null,"geo":true,"labels":["Please + say, for each of the following, how important it is in your life.","Work","Family","Friends + and acquaintances","Leisure time"],"columns":["name","type","label","required","kobo--score-choices","select_from_list_name","hint","parameters"]},"date_modified":"2022-01-24T13:04:49.219192Z","version_id":"vfAaB99KXQeGf2gMxWA57z","version__content_hash":"f3e28cf31d58b03c955935dedec741d31d4537b8","version_count":1,"has_deployment":false,"deployed_version_id":null,"deployed_versions":{"count":0,"next":null,"previous":null,"results":[]},"deployment__identifier":null,"deployment__links":{},"deployment__active":false,"deployment__data_download_links":{},"deployment__submission_count":0,"report_styles":{"default":{},"specified":{"start":{},"end":{},"importance_in_life":{},"kr9ur31":{},"tf9rd50":{},"mk6mc53":{},"lr5sh35":{},"ob3me97":{},"ai6cp87":{},"/dr9fq65":{},"or5gr65":{},"health_self_assessment":{},"voluntary_activity":{},"trust_in_others":{},"trust_in_groups":{},"xg6fl64":{},"yj6dy23":{},"ke1im15":{},"wh7ei00":{},"qy1kf43":{},"ip2pc55":{},"/tb2px63":{},"control_over_life":{},"locate_hamburg":{},"file_upload":{}},"kuid_names":{"start":"Bbu6GtD1G","end":"QdTRTdETf","importance_in_life":"dr9fq65","kr9ur31":"kr9ur31","tf9rd50":"tf9rd50","mk6mc53":"mk6mc53","lr5sh35":"lr5sh35","ob3me97":"ob3me97","ai6cp87":"ai6cp87","/dr9fq65":"/dr9fq65","or5gr65":"or5gr65","health_self_assessment":"uf68v87","voluntary_activity":"ks56k46","trust_in_others":"va0xx85","trust_in_groups":"tb2px63","xg6fl64":"xg6fl64","yj6dy23":"yj6dy23","ke1im15":"ke1im15","wh7ei00":"wh7ei00","qy1kf43":"qy1kf43","ip2pc55":"ip2pc55","/tb2px63":"/tb2px63","control_over_life":"gt1yj76","locate_hamburg":"fd0cf28","file_upload":"dq0sb99"}},"report_custom":{},"map_styles":{},"map_custom":{},"content":{"schema":"1","survey":[{"name":"start","type":"start","$kuid":"Bbu6GtD1G","$autoname":"start"},{"name":"end","type":"end","$kuid":"QdTRTdETf","$autoname":"end"},{"name":"importance_in_life","type":"begin_score","$kuid":"dr9fq65","label":["Please + say, for each of the following, how important it is in your life."],"required":false,"$autoname":"importance_in_life","kobo--score-choices":"ys4jh05"},{"type":"score__row","$kuid":"kr9ur31","label":["Work"],"required":false,"$autoname":"Work"},{"type":"score__row","$kuid":"tf9rd50","label":["Family"],"required":false,"$autoname":"Family"},{"type":"score__row","$kuid":"mk6mc53","label":["Friends + and acquaintances"],"required":false,"$autoname":"Friends_and_acquaintances"},{"type":"score__row","$kuid":"lr5sh35","label":["Leisure + time"],"required":false,"$autoname":"Leisure_time"},{"type":"score__row","$kuid":"ob3me97","label":["Politics"],"required":false,"$autoname":"Politics"},{"type":"score__row","$kuid":"ai6cp87","label":["Religion"],"required":false,"$autoname":"Religion"},{"type":"end_score","$kuid":"/dr9fq65"},{"type":"select_one","$kuid":"or5gr65","label":["Taking + all things together, would you say you are:"],"required":true,"$autoname":"Taking_all_things_to_ould_you_say_you_are","select_from_list_name":"rz4sr22"},{"name":"health_self_assessment","type":"select_one","$kuid":"uf68v87","label":["All + in all, how would you describe your state of health these days? would you + say it is"],"required":false,"$autoname":"health_self_assessment","select_from_list_name":"ve2ix92"},{"name":"voluntary_activity","type":"select_one","$kuid":"ks56k46","label":["Did + you do voluntary work in the last 6 months?"],"required":false,"$autoname":"voluntary_activity","select_from_list_name":"am8gn27"},{"name":"trust_in_others","type":"select_one","$kuid":"va0xx85","label":["Generally + speaking, would you say that most people can be trusted or that you can''t + be too careful in dealing with people?"],"required":false,"$autoname":"trust_in_others","select_from_list_name":"zl1iq13"},{"name":"trust_in_groups","type":"begin_score","$kuid":"tb2px63","label":["I + would like to ask you how much you trust people from various groups. Could + you tell me for each whether you trust people from this group completely, + somewhat, not very much or not at all?"],"required":false,"$autoname":"trust_in_groups","kobo--score-choices":"uy4om18"},{"type":"score__row","$kuid":"xg6fl64","label":["Your + family"],"required":false,"$autoname":"Your_family"},{"type":"score__row","$kuid":"yj6dy23","label":["People + in your neighborhood"],"required":false,"$autoname":"People_in_your_neighborhood"},{"type":"score__row","$kuid":"ke1im15","label":["People + you know personally"],"required":false,"$autoname":"People_you_know_personally"},{"type":"score__row","$kuid":"wh7ei00","label":["People + you meet for the first time"],"required":false,"$autoname":"People_you_meet_for_the_first_time"},{"type":"score__row","$kuid":"qy1kf43","label":["People + of another religion"],"required":false,"$autoname":"People_of_another_religion"},{"type":"score__row","$kuid":"ip2pc55","label":["People + of another nationality"],"required":false,"$autoname":"People_of_another_nationality"},{"type":"end_score","$kuid":"/tb2px63"},{"hint":["1 + = \"None at all\", 10 = \"a great deal\""],"name":"control_over_life","type":"range","$kuid":"gt1yj76","label":["Some + people feel they have completely free choice and control over their lives, + and other people feel that what they do has no real effect on what happens + to them. Please use the scale to indicate how much freedom of choice and control + you feel you have over the way your life turns out?"],"required":false,"$autoname":"control_over_life","parameters":"start=1;end=10;step=1"},{"name":"locate_hamburg","type":"geopoint","$kuid":"fd0cf28","label":["Please + indicate where on the map is \"Hamburg\""],"required":false,"$autoname":"locate_hamburg"},{"name":"file_upload","type":"file","$kuid":"dq0sb99","label":["Upload + an arbitrary file..."],"required":false,"$autoname":"file_upload"}],"choices":[{"name":"1","$kuid":"NPp8OR3md","label":["Very + important"],"list_name":"ys4jh05","$autovalue":"1"},{"name":"2","$kuid":"LnI83gRXp","label":["quite + important"],"list_name":"ys4jh05","$autovalue":"2"},{"name":"3","$kuid":"u6ot3527d","label":["not + important"],"list_name":"ys4jh05","$autovalue":"3"},{"name":"4","$kuid":"gRoco4Pev","label":["not + at all important"],"list_name":"ys4jh05","$autovalue":"4"},{"name":"1","$kuid":"4oLFnV3ws","label":["Very + happy"],"list_name":"rz4sr22","$autovalue":"1"},{"name":"2","$kuid":"PAmAPsyFM","label":["Quite + happy"],"list_name":"rz4sr22","$autovalue":"2"},{"name":"3","$kuid":"G8ZTNvrsz","label":["Not + very happy"],"list_name":"rz4sr22","$autovalue":"3"},{"name":"4","$kuid":"p2PSwo7yN","label":["Not + at all happy"],"list_name":"rz4sr22","$autovalue":"4"},{"name":"8","$kuid":"ZUOsXVxA0","label":["Don''t + know"],"list_name":"rz4sr22","$autovalue":"8"},{"name":"9","$kuid":"gTT51LFcs","label":["No + answer"],"list_name":"rz4sr22","$autovalue":"9"},{"name":"1","$kuid":"FSr5OYH5Z","label":["Very + good"],"list_name":"ve2ix92","$autovalue":"1"},{"name":"2","$kuid":"ePIcIfywO","label":["Good"],"list_name":"ve2ix92","$autovalue":"2"},{"name":"3","$kuid":"97eDDuzaO","label":["Fair"],"list_name":"ve2ix92","$autovalue":"3"},{"name":"4","$kuid":"BIcgTk7PF","label":["Poor"],"list_name":"ve2ix92","$autovalue":"4"},{"name":"5","$kuid":"TI1TEmjKI","label":["Very + poor"],"list_name":"ve2ix92","$autovalue":"5"},{"name":"8","$kuid":"UPQRPVpZN","label":["Don''t + know"],"list_name":"ve2ix92","$autovalue":"8"},{"name":"9","$kuid":"696pTgkEM","label":["No + answer"],"list_name":"ve2ix92","$autovalue":"9"},{"name":"1","$kuid":"rhWu34seb","label":["Yes"],"list_name":"am8gn27","$autovalue":"1"},{"name":"2","$kuid":"eNbB8K507","label":["No"],"list_name":"am8gn27","$autovalue":"2"},{"name":"8","$kuid":"kg9naDqjC","label":["Don''t + know"],"list_name":"am8gn27","$autovalue":"8"},{"name":"9","$kuid":"7AFKIlHDu","label":["No + answer"],"list_name":"am8gn27","$autovalue":"9"},{"name":"1","$kuid":"IKCXDYXCk","label":["Most + people can be trusted"],"list_name":"zl1iq13","$autovalue":"1"},{"name":"2","$kuid":"Jvg4jninb","label":["Can''t + be too careful"],"list_name":"zl1iq13","$autovalue":"2"},{"name":"8","$kuid":"VSWHtAmIg","label":["Don''t + know"],"list_name":"zl1iq13","$autovalue":"8"},{"name":"9","$kuid":"Utj6uO20z","label":["No + answer"],"list_name":"zl1iq13","$autovalue":"9"},{"name":"1","$kuid":"UrdKQbo8g","label":["Trust + completely"],"list_name":"uy4om18","$autovalue":"1"},{"name":"2","$kuid":"mCJO9kEu8","label":["Trust + somewhat"],"list_name":"uy4om18","$autovalue":"2"},{"name":"3","$kuid":"UlmwVnpew","label":["Do + not trust very much"],"list_name":"uy4om18","$autovalue":"3"},{"name":"4","$kuid":"cMmSDIUwH","label":["Do  + not trust at all"],"list_name":"uy4om18","$autovalue":"4"}],"settings":{},"translated":["hint","label"],"translations":[null]},"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/ackE4RGzXMjWBei3bRHPbb.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/ackE4RGzXMjWBei3bRHPbb.xml"}],"embeds":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/ackE4RGzXMjWBei3bRHPbb/xls/"},{"format":"xform","url":"https://kobo.correlaid.org/api/v2/assets/ackE4RGzXMjWBei3bRHPbb/xform/"}],"koboform_link":"https://kobo.correlaid.org/api/v2/assets/ackE4RGzXMjWBei3bRHPbb/koboform/","xform_link":"https://kobo.correlaid.org/api/v2/assets/ackE4RGzXMjWBei3bRHPbb/xform/","hooks_link":"https://kobo.correlaid.org/api/v2/assets/ackE4RGzXMjWBei3bRHPbb/hooks/","tag_string":"","uid":"ackE4RGzXMjWBei3bRHPbb","kind":"asset","xls_link":"https://kobo.correlaid.org/api/v2/assets/ackE4RGzXMjWBei3bRHPbb/xls/","name":"Test + survey copy","assignable_permissions":[{"url":"https://kobo.correlaid.org/api/v2/permissions/view_asset/","label":"View + form"},{"url":"https://kobo.correlaid.org/api/v2/permissions/change_asset/","label":"Edit + form"},{"url":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/","label":"Manage + project"},{"url":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/","label":"Add + submissions"},{"url":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/","label":"View + submissions"},{"url":"https://kobo.correlaid.org/api/v2/permissions/partial_submissions/","label":"View + submissions only from specific users"},{"url":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/","label":"Edit + submissions"},{"url":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/","label":"Delete + submissions"},{"url":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/","label":"Validate + submissions"}],"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/ackE4RGzXMjWBei3bRHPbb/permission-assignments/pMcxmguvncdjeoYEew9L7P/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/","label":"Add + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/ackE4RGzXMjWBei3bRHPbb/permission-assignments/pr8SFUYEzmh87gWrsQdEg3/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/","label":"Edit + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/ackE4RGzXMjWBei3bRHPbb/permission-assignments/pXTLkaPTwmgfD4cEEmK2BV/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/","label":"Edit + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/ackE4RGzXMjWBei3bRHPbb/permission-assignments/pcdQKBDYZQ9o58vrEdKneM/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/","label":"Delete + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/ackE4RGzXMjWBei3bRHPbb/permission-assignments/pXbhpDrXrc2w4gV7M4HjgQ/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/","label":"Manage + project"},{"url":"https://kobo.correlaid.org/api/v2/assets/ackE4RGzXMjWBei3bRHPbb/permission-assignments/pJVyL3j5Kpf6Hc2jkp3Jcz/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/","label":"Validate + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/ackE4RGzXMjWBei3bRHPbb/permission-assignments/psJJCkXcwKg9277sWUYVBh/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/","label":"View + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/ackE4RGzXMjWBei3bRHPbb/permission-assignments/pL3S45LrCwqJKK4adUPAdp/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/","label":"View + submissions"}],"data":"https://kobo.correlaid.org/api/v2/assets/ackE4RGzXMjWBei3bRHPbb/data/"}' + recorded_at: 2022-01-24 13:04:47 GMT + recorded_with: vcr/0.6.0, webmockr/0.8.0 diff --git a/vignettes/assets/create-asset.yml b/vignettes/assets/create-asset.yml new file mode 100644 index 0000000..417ad9a --- /dev/null +++ b/vignettes/assets/create-asset.yml @@ -0,0 +1,56 @@ +http_interactions: +- request: + method: post + uri: https://kobo.correlaid.org/api/v2/assets/ + body: + encoding: '' + string: |- + name=Question block,asset_type=block,settings={ + "description": "this question block was created with the API.", + "sector": { + "label": "", + "value": "" + }, + "country": { + "label": "", + "value": "" + }, + "share-metadata": false + } + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3 crul/1.1.0 + Accept-Encoding: gzip, deflate + Authorization: fakebearertoken + Accept: application/json + response: + status: + status_code: '201' + message: Created + explanation: Document created, URL follows + headers: + status: HTTP/1.1 201 Created + server: nginx + date: Mon, 24 Jan 2022 13:24:29 GMT + content-type: application/json + content-length: '3102' + connection: keep-alive + location: https://kobo.correlaid.org/api/v2/assets/avJyi8RUCjQ4RSFA7qdWPG/ + vary: Accept, Accept-Language, Cookie, Origin + allow: GET, POST, HEAD, OPTIONS + x-kobonaut: api_user + x-frame-options: SAMEORIGIN + content-language: en + body: + encoding: UTF-8 + file: no + string: '{"url":"https://kobo.correlaid.org/api/v2/assets/avJyi8RUCjQ4RSFA7qdWPG/","owner":"https://kobo.correlaid.org/api/v2/users/api_user/","owner__username":"api_user","parent":null,"ancestors":null,"settings":{"description":"this + question block was created with the API.","sector":{"label":"","value":""},"country":{"label":"","value":""},"share-metadata":false},"asset_type":"block","date_created":"2022-01-24T13:24:29.331033Z","summary":{},"date_modified":"2022-01-24T13:24:29.331054Z","version_id":"vZpxcU8qvJ9N6wHSiPsSpv","version__content_hash":"4724ddb07034559d7fb5a3d18288dfb683a2d082","version_count":1,"has_deployment":false,"deployed_version_id":null,"deployed_versions":{"count":0,"next":null,"previous":null,"results":[]},"deployment__identifier":null,"deployment__links":{},"deployment__active":false,"deployment__data_download_links":{},"deployment__submission_count":0,"report_styles":{"default":{},"specified":{},"kuid_names":{}},"report_custom":{},"map_styles":{},"map_custom":{},"content":{"settings":{},"survey":[],"schema":"1"},"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/avJyi8RUCjQ4RSFA7qdWPG.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/avJyi8RUCjQ4RSFA7qdWPG.xml"}],"embeds":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/avJyi8RUCjQ4RSFA7qdWPG/xls/"},{"format":"xform","url":"https://kobo.correlaid.org/api/v2/assets/avJyi8RUCjQ4RSFA7qdWPG/xform/"}],"koboform_link":"https://kobo.correlaid.org/api/v2/assets/avJyi8RUCjQ4RSFA7qdWPG/koboform/","xform_link":"https://kobo.correlaid.org/api/v2/assets/avJyi8RUCjQ4RSFA7qdWPG/xform/","hooks_link":"https://kobo.correlaid.org/api/v2/assets/avJyi8RUCjQ4RSFA7qdWPG/hooks/","tag_string":"","uid":"avJyi8RUCjQ4RSFA7qdWPG","kind":"asset","xls_link":"https://kobo.correlaid.org/api/v2/assets/avJyi8RUCjQ4RSFA7qdWPG/xls/","name":"Question + block","assignable_permissions":[{"url":"https://kobo.correlaid.org/api/v2/permissions/view_asset/","label":"View + block"},{"url":"https://kobo.correlaid.org/api/v2/permissions/change_asset/","label":"Edit + block"},{"url":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/","label":"Manage + block"}],"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/avJyi8RUCjQ4RSFA7qdWPG/permission-assignments/pxv6JbKjKeSxxdxFsu5BZT/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/","label":"Edit + block"},{"url":"https://kobo.correlaid.org/api/v2/assets/avJyi8RUCjQ4RSFA7qdWPG/permission-assignments/pVXnE7LgHG2pX8BaRfrZ5V/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/","label":"Manage + block"},{"url":"https://kobo.correlaid.org/api/v2/assets/avJyi8RUCjQ4RSFA7qdWPG/permission-assignments/pCcEqGEQhXUSytLNB7aST8/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/","label":"View + block"}],"data":"https://kobo.correlaid.org/api/v2/assets/avJyi8RUCjQ4RSFA7qdWPG/data/"}' + recorded_at: 2022-01-24 13:24:27 GMT + recorded_with: vcr/0.6.0, webmockr/0.8.0 diff --git a/vignettes/assets/deploy-asset.yml b/vignettes/assets/deploy-asset.yml new file mode 100644 index 0000000..2a30524 --- /dev/null +++ b/vignettes/assets/deploy-asset.yml @@ -0,0 +1,89 @@ +http_interactions: +- request: + method: post + uri: https://kobo.correlaid.org/api/v2/assets/ackE4RGzXMjWBei3bRHPbb/deployment/ + body: + encoding: '' + string: active=true + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3 crul/1.1.0 + Accept-Encoding: gzip, deflate + Authorization: fakebearertoken + Accept: application/json + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + server: nginx + date: Mon, 24 Jan 2022 13:04:50 GMT + content-type: application/json + content-length: '13629' + connection: keep-alive + vary: Accept, Accept-Language, Cookie, Origin + allow: GET, POST, PATCH, HEAD, OPTIONS + x-kobonaut: api_user + x-frame-options: SAMEORIGIN + content-language: en + body: + encoding: UTF-8 + file: no + string: '{"backend":"kobocat","identifier":"https://kc.correlaid.org/api_user/forms/ackE4RGzXMjWBei3bRHPbb","active":true,"version_id":"vfAaB99KXQeGf2gMxWA57z","asset":{"url":"https://kobo.correlaid.org/api/v2/assets/ackE4RGzXMjWBei3bRHPbb/","owner":"https://kobo.correlaid.org/api/v2/users/api_user/","owner__username":"api_user","parent":null,"ancestors":null,"settings":{"sector":{"label":"Other","value":"Other"},"country":{"label":"Germany","value":"DEU"},"description":"Yet + another testing form for package development"},"asset_type":"survey","date_created":"2022-01-24T13:04:49.219153Z","summary":{"row_count":21,"languages":[null],"default_translation":null,"geo":true,"labels":["Please + say, for each of the following, how important it is in your life.","Work","Family","Friends + and acquaintances","Leisure time"],"columns":["name","type","label","required","kobo--score-choices","select_from_list_name","hint","parameters"]},"date_modified":"2022-01-24T13:04:50.010435Z","version_id":"vfAaB99KXQeGf2gMxWA57z","version__content_hash":"f3e28cf31d58b03c955935dedec741d31d4537b8","version_count":1,"has_deployment":true,"deployed_version_id":"vfAaB99KXQeGf2gMxWA57z","deployed_versions":{"count":1,"next":null,"previous":null,"results":[{"uid":"vfAaB99KXQeGf2gMxWA57z","url":"https://kobo.correlaid.org/api/v2/assets/ackE4RGzXMjWBei3bRHPbb/versions/vfAaB99KXQeGf2gMxWA57z/","content_hash":"f3e28cf31d58b03c955935dedec741d31d4537b8","date_deployed":"2022-01-24T13:04:49.240765Z","date_modified":"2022-01-24 + 13:04:49.240765+00:00"}]},"deployment__identifier":"https://kc.correlaid.org/api_user/forms/ackE4RGzXMjWBei3bRHPbb","deployment__links":{"url":"https://ee.correlaid.org/Ta4PiaKt","single_url":"https://ee.correlaid.org/single/Ta4PiaKt","single_once_url":"https://ee.correlaid.org/single/04e9d231ca0e82bb2dc05d9498cae70b","offline_url":"https://ee.correlaid.org/x/Ta4PiaKt","preview_url":"https://ee.correlaid.org/preview/Ta4PiaKt","iframe_url":"https://ee.correlaid.org/i/Ta4PiaKt","single_iframe_url":"https://ee.correlaid.org/single/i/Ta4PiaKt","single_once_iframe_url":"https://ee.correlaid.org/single/i/04e9d231ca0e82bb2dc05d9498cae70b"},"deployment__active":true,"deployment__data_download_links":{"xls_legacy":"https://kc.correlaid.org/api_user/exports/ackE4RGzXMjWBei3bRHPbb/xls/","csv_legacy":"https://kc.correlaid.org/api_user/exports/ackE4RGzXMjWBei3bRHPbb/csv/","zip_legacy":"https://kc.correlaid.org/api_user/exports/ackE4RGzXMjWBei3bRHPbb/zip/","kml_legacy":"https://kc.correlaid.org/api_user/exports/ackE4RGzXMjWBei3bRHPbb/kml/","xls":"https://kc.correlaid.org/api_user/reports/ackE4RGzXMjWBei3bRHPbb/export.xlsx","csv":"https://kc.correlaid.org/api_user/reports/ackE4RGzXMjWBei3bRHPbb/export.csv"},"deployment__submission_count":0,"report_styles":{"default":{},"specified":{"end":{},"start":{},"ai6cp87":{},"ip2pc55":{},"ke1im15":{},"kr9ur31":{},"lr5sh35":{},"mk6mc53":{},"ob3me97":{},"or5gr65":{},"qy1kf43":{},"tf9rd50":{},"wh7ei00":{},"xg6fl64":{},"yj6dy23":{},"/dr9fq65":{},"/tb2px63":{},"file_upload":{},"locate_hamburg":{},"trust_in_groups":{},"trust_in_others":{},"control_over_life":{},"importance_in_life":{},"voluntary_activity":{},"health_self_assessment":{}},"kuid_names":{"end":"QdTRTdETf","start":"Bbu6GtD1G","ai6cp87":"ai6cp87","ip2pc55":"ip2pc55","ke1im15":"ke1im15","kr9ur31":"kr9ur31","lr5sh35":"lr5sh35","mk6mc53":"mk6mc53","ob3me97":"ob3me97","or5gr65":"or5gr65","qy1kf43":"qy1kf43","tf9rd50":"tf9rd50","wh7ei00":"wh7ei00","xg6fl64":"xg6fl64","yj6dy23":"yj6dy23","/dr9fq65":"/dr9fq65","/tb2px63":"/tb2px63","file_upload":"dq0sb99","locate_hamburg":"fd0cf28","trust_in_groups":"tb2px63","trust_in_others":"va0xx85","control_over_life":"gt1yj76","importance_in_life":"dr9fq65","voluntary_activity":"ks56k46","health_self_assessment":"uf68v87"}},"report_custom":{},"map_styles":{},"map_custom":{},"content":{"schema":"1","survey":[{"name":"start","type":"start","$kuid":"Bbu6GtD1G","$autoname":"start"},{"name":"end","type":"end","$kuid":"QdTRTdETf","$autoname":"end"},{"name":"importance_in_life","type":"begin_score","$kuid":"dr9fq65","label":["Please + say, for each of the following, how important it is in your life."],"required":false,"$autoname":"importance_in_life","kobo--score-choices":"ys4jh05"},{"type":"score__row","$kuid":"kr9ur31","label":["Work"],"required":false,"$autoname":"Work"},{"type":"score__row","$kuid":"tf9rd50","label":["Family"],"required":false,"$autoname":"Family"},{"type":"score__row","$kuid":"mk6mc53","label":["Friends + and acquaintances"],"required":false,"$autoname":"Friends_and_acquaintances"},{"type":"score__row","$kuid":"lr5sh35","label":["Leisure + time"],"required":false,"$autoname":"Leisure_time"},{"type":"score__row","$kuid":"ob3me97","label":["Politics"],"required":false,"$autoname":"Politics"},{"type":"score__row","$kuid":"ai6cp87","label":["Religion"],"required":false,"$autoname":"Religion"},{"type":"end_score","$kuid":"/dr9fq65"},{"type":"select_one","$kuid":"or5gr65","label":["Taking + all things together, would you say you are:"],"required":true,"$autoname":"Taking_all_things_to_ould_you_say_you_are","select_from_list_name":"rz4sr22"},{"name":"health_self_assessment","type":"select_one","$kuid":"uf68v87","label":["All + in all, how would you describe your state of health these days? would you + say it is"],"required":false,"$autoname":"health_self_assessment","select_from_list_name":"ve2ix92"},{"name":"voluntary_activity","type":"select_one","$kuid":"ks56k46","label":["Did + you do voluntary work in the last 6 months?"],"required":false,"$autoname":"voluntary_activity","select_from_list_name":"am8gn27"},{"name":"trust_in_others","type":"select_one","$kuid":"va0xx85","label":["Generally + speaking, would you say that most people can be trusted or that you can''t + be too careful in dealing with people?"],"required":false,"$autoname":"trust_in_others","select_from_list_name":"zl1iq13"},{"name":"trust_in_groups","type":"begin_score","$kuid":"tb2px63","label":["I + would like to ask you how much you trust people from various groups. Could + you tell me for each whether you trust people from this group completely, + somewhat, not very much or not at all?"],"required":false,"$autoname":"trust_in_groups","kobo--score-choices":"uy4om18"},{"type":"score__row","$kuid":"xg6fl64","label":["Your + family"],"required":false,"$autoname":"Your_family"},{"type":"score__row","$kuid":"yj6dy23","label":["People + in your neighborhood"],"required":false,"$autoname":"People_in_your_neighborhood"},{"type":"score__row","$kuid":"ke1im15","label":["People + you know personally"],"required":false,"$autoname":"People_you_know_personally"},{"type":"score__row","$kuid":"wh7ei00","label":["People + you meet for the first time"],"required":false,"$autoname":"People_you_meet_for_the_first_time"},{"type":"score__row","$kuid":"qy1kf43","label":["People + of another religion"],"required":false,"$autoname":"People_of_another_religion"},{"type":"score__row","$kuid":"ip2pc55","label":["People + of another nationality"],"required":false,"$autoname":"People_of_another_nationality"},{"type":"end_score","$kuid":"/tb2px63"},{"hint":["1 + = \"None at all\", 10 = \"a great deal\""],"name":"control_over_life","type":"range","$kuid":"gt1yj76","label":["Some + people feel they have completely free choice and control over their lives, + and other people feel that what they do has no real effect on what happens + to them. Please use the scale to indicate how much freedom of choice and control + you feel you have over the way your life turns out?"],"required":false,"$autoname":"control_over_life","parameters":"start=1;end=10;step=1"},{"name":"locate_hamburg","type":"geopoint","$kuid":"fd0cf28","label":["Please + indicate where on the map is \"Hamburg\""],"required":false,"$autoname":"locate_hamburg"},{"name":"file_upload","type":"file","$kuid":"dq0sb99","label":["Upload + an arbitrary file..."],"required":false,"$autoname":"file_upload"}],"choices":[{"name":"1","$kuid":"NPp8OR3md","label":["Very + important"],"list_name":"ys4jh05","$autovalue":"1"},{"name":"2","$kuid":"LnI83gRXp","label":["quite + important"],"list_name":"ys4jh05","$autovalue":"2"},{"name":"3","$kuid":"u6ot3527d","label":["not + important"],"list_name":"ys4jh05","$autovalue":"3"},{"name":"4","$kuid":"gRoco4Pev","label":["not + at all important"],"list_name":"ys4jh05","$autovalue":"4"},{"name":"1","$kuid":"4oLFnV3ws","label":["Very + happy"],"list_name":"rz4sr22","$autovalue":"1"},{"name":"2","$kuid":"PAmAPsyFM","label":["Quite + happy"],"list_name":"rz4sr22","$autovalue":"2"},{"name":"3","$kuid":"G8ZTNvrsz","label":["Not + very happy"],"list_name":"rz4sr22","$autovalue":"3"},{"name":"4","$kuid":"p2PSwo7yN","label":["Not + at all happy"],"list_name":"rz4sr22","$autovalue":"4"},{"name":"8","$kuid":"ZUOsXVxA0","label":["Don''t + know"],"list_name":"rz4sr22","$autovalue":"8"},{"name":"9","$kuid":"gTT51LFcs","label":["No + answer"],"list_name":"rz4sr22","$autovalue":"9"},{"name":"1","$kuid":"FSr5OYH5Z","label":["Very + good"],"list_name":"ve2ix92","$autovalue":"1"},{"name":"2","$kuid":"ePIcIfywO","label":["Good"],"list_name":"ve2ix92","$autovalue":"2"},{"name":"3","$kuid":"97eDDuzaO","label":["Fair"],"list_name":"ve2ix92","$autovalue":"3"},{"name":"4","$kuid":"BIcgTk7PF","label":["Poor"],"list_name":"ve2ix92","$autovalue":"4"},{"name":"5","$kuid":"TI1TEmjKI","label":["Very + poor"],"list_name":"ve2ix92","$autovalue":"5"},{"name":"8","$kuid":"UPQRPVpZN","label":["Don''t + know"],"list_name":"ve2ix92","$autovalue":"8"},{"name":"9","$kuid":"696pTgkEM","label":["No + answer"],"list_name":"ve2ix92","$autovalue":"9"},{"name":"1","$kuid":"rhWu34seb","label":["Yes"],"list_name":"am8gn27","$autovalue":"1"},{"name":"2","$kuid":"eNbB8K507","label":["No"],"list_name":"am8gn27","$autovalue":"2"},{"name":"8","$kuid":"kg9naDqjC","label":["Don''t + know"],"list_name":"am8gn27","$autovalue":"8"},{"name":"9","$kuid":"7AFKIlHDu","label":["No + answer"],"list_name":"am8gn27","$autovalue":"9"},{"name":"1","$kuid":"IKCXDYXCk","label":["Most + people can be trusted"],"list_name":"zl1iq13","$autovalue":"1"},{"name":"2","$kuid":"Jvg4jninb","label":["Can''t + be too careful"],"list_name":"zl1iq13","$autovalue":"2"},{"name":"8","$kuid":"VSWHtAmIg","label":["Don''t + know"],"list_name":"zl1iq13","$autovalue":"8"},{"name":"9","$kuid":"Utj6uO20z","label":["No + answer"],"list_name":"zl1iq13","$autovalue":"9"},{"name":"1","$kuid":"UrdKQbo8g","label":["Trust + completely"],"list_name":"uy4om18","$autovalue":"1"},{"name":"2","$kuid":"mCJO9kEu8","label":["Trust + somewhat"],"list_name":"uy4om18","$autovalue":"2"},{"name":"3","$kuid":"UlmwVnpew","label":["Do + not trust very much"],"list_name":"uy4om18","$autovalue":"3"},{"name":"4","$kuid":"cMmSDIUwH","label":["Do  + not trust at all"],"list_name":"uy4om18","$autovalue":"4"}],"settings":{},"translated":["hint","label"],"translations":[null]},"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/ackE4RGzXMjWBei3bRHPbb.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/ackE4RGzXMjWBei3bRHPbb.xml"}],"embeds":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/ackE4RGzXMjWBei3bRHPbb/xls/"},{"format":"xform","url":"https://kobo.correlaid.org/api/v2/assets/ackE4RGzXMjWBei3bRHPbb/xform/"}],"koboform_link":"https://kobo.correlaid.org/api/v2/assets/ackE4RGzXMjWBei3bRHPbb/koboform/","xform_link":"https://kobo.correlaid.org/api/v2/assets/ackE4RGzXMjWBei3bRHPbb/xform/","hooks_link":"https://kobo.correlaid.org/api/v2/assets/ackE4RGzXMjWBei3bRHPbb/hooks/","tag_string":"","uid":"ackE4RGzXMjWBei3bRHPbb","kind":"asset","xls_link":"https://kobo.correlaid.org/api/v2/assets/ackE4RGzXMjWBei3bRHPbb/xls/","name":"Test + survey copy","permissions":[{"uid":"peVKTUv8pqYeGbpX44sQJP","kind":"objectpermission","url":"https://kobo.correlaid.org/permissions/peVKTUv8pqYeGbpX44sQJP/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"add_submissions","deny":false,"inherited":true},{"uid":"pj4mgpo6MJjW3SUhz4Mf4B","kind":"objectpermission","url":"https://kobo.correlaid.org/permissions/pj4mgpo6MJjW3SUhz4Mf4B/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"change_asset","deny":false,"inherited":true},{"uid":"pyZPpcVRMCBAt7EYGCarjW","kind":"objectpermission","url":"https://kobo.correlaid.org/permissions/pyZPpcVRMCBAt7EYGCarjW/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"change_submissions","deny":false,"inherited":true},{"uid":"pQDkVBcYbWmqkVmXDJfK33","kind":"objectpermission","url":"https://kobo.correlaid.org/permissions/pQDkVBcYbWmqkVmXDJfK33/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"delete_submissions","deny":false,"inherited":true},{"uid":"p85HRzWZGHRRSeeTXLbAvg","kind":"objectpermission","url":"https://kobo.correlaid.org/permissions/p85HRzWZGHRRSeeTXLbAvg/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"manage_asset","deny":false,"inherited":true},{"uid":"pqNrCPfkZsejLdXHzCn8yn","kind":"objectpermission","url":"https://kobo.correlaid.org/permissions/pqNrCPfkZsejLdXHzCn8yn/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"validate_submissions","deny":false,"inherited":true},{"uid":"pWuKjqFRKXZ9wufeiP9HvW","kind":"objectpermission","url":"https://kobo.correlaid.org/permissions/pWuKjqFRKXZ9wufeiP9HvW/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"view_asset","deny":false,"inherited":true},{"uid":"pNuuAcH3rTz5ki2GvUv7s5","kind":"objectpermission","url":"https://kobo.correlaid.org/permissions/pNuuAcH3rTz5ki2GvUv7s5/","user":"https://kobo.correlaid.org/api/v2/users/api_user/","permission":"view_submissions","deny":false,"inherited":true}]}}' + recorded_at: 2022-01-24 13:04:48 GMT + recorded_with: vcr/0.6.0, webmockr/0.8.0 diff --git a/vignettes/articles/export_downloaded.xls b/vignettes/assets/export_downloaded.xls similarity index 100% rename from vignettes/articles/export_downloaded.xls rename to vignettes/assets/export_downloaded.xls diff --git a/vignettes/articles/kobo-assets2.yml b/vignettes/assets/get-assets.yml similarity index 90% rename from vignettes/articles/kobo-assets2.yml rename to vignettes/assets/get-assets.yml index ec6fb62..a200b20 100644 --- a/vignettes/articles/kobo-assets2.yml +++ b/vignettes/assets/get-assets.yml @@ -18,9 +18,9 @@ http_interactions: headers: status: HTTP/1.1 200 OK server: nginx - date: Sun, 03 Oct 2021 17:14:58 GMT + date: Mon, 24 Jan 2022 13:04:47 GMT content-type: application/json - content-length: '192705' + content-length: '212744' connection: keep-alive vary: Accept, Accept-Language, Cookie, Origin allow: GET, POST, HEAD, OPTIONS @@ -30,7 +30,67 @@ http_interactions: body: encoding: UTF-8 file: no - string: '{"count":60,"next":null,"previous":null,"results":[{"url":"https://kobo.correlaid.org/api/v2/assets/aRo4wg5utWT7dwdnQQEAE7/?format=json","date_modified":"2021-09-24T11:42:42.761924Z","date_created":"2021-05-02T12:12:11.859577Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","summary":{"geo":true,"labels":["Please + string: '{"count":65,"next":null,"previous":null,"results":[{"url":"https://kobo.correlaid.org/api/v2/assets/a27VRgrwgk9TPnH5wQRVTi/?format=json","date_modified":"2022-01-24T13:01:05.390530Z","date_created":"2022-01-24T13:01:04.585505Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","summary":{"geo":true,"labels":["Please + say, for each of the following, how important it is in your life.","Work","Family","Friends + and acquaintances","Leisure time"],"columns":["name","type","label","required","kobo--score-choices","select_from_list_name","hint","parameters"],"languages":[null],"row_count":21,"default_translation":null},"owner__username":"api_user","parent":null,"uid":"a27VRgrwgk9TPnH5wQRVTi","tag_string":"","settings":{"sector":{"label":"Other","value":"Other"},"country":{"label":"Germany","value":"DEU"},"description":"Yet + another testing form for package development"},"kind":"asset","name":"Test + survey copy","asset_type":"survey","version_id":"vefEaQRzybAM2NCicGAybk","has_deployment":true,"deployed_version_id":"vefEaQRzybAM2NCicGAybk","deployment__identifier":"https://kc.correlaid.org/api_user/forms/a27VRgrwgk9TPnH5wQRVTi","deployment__active":true,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/a27VRgrwgk9TPnH5wQRVTi/permission-assignments/pWhfNaNVSbQCE82X6dVkHn/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/?format=json","label":"Add + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/a27VRgrwgk9TPnH5wQRVTi/permission-assignments/pXfqAGaZxPvTKAMsJMdQa8/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/?format=json","label":"Edit + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/a27VRgrwgk9TPnH5wQRVTi/permission-assignments/p735UBtzDtEhBWBuW8DAas/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/?format=json","label":"Edit + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/a27VRgrwgk9TPnH5wQRVTi/permission-assignments/pEsTivxY6SViqu4GYuaBNw/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/?format=json","label":"Delete + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/a27VRgrwgk9TPnH5wQRVTi/permission-assignments/pp32PiEKhDG4bgTUjzivnv/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/?format=json","label":"Manage + project"},{"url":"https://kobo.correlaid.org/api/v2/assets/a27VRgrwgk9TPnH5wQRVTi/permission-assignments/pCyWPw6nzyKeVDSWVqwGnW/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/?format=json","label":"Validate + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/a27VRgrwgk9TPnH5wQRVTi/permission-assignments/p5wykZ4jrtStmQEeWyNm9T/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/?format=json","label":"View + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/a27VRgrwgk9TPnH5wQRVTi/permission-assignments/pnpndHRXNQEXa4fTiWPbhe/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/?format=json","label":"View + submissions"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/a27VRgrwgk9TPnH5wQRVTi/?format=json.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/a27VRgrwgk9TPnH5wQRVTi/?format=json.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/a27VRgrwgk9TPnH5wQRVTi/data/?format=json"},{"url":"https://kobo.correlaid.org/api/v2/assets/aCZ7EbjtocFTDQb4zuy8p6/?format=json","date_modified":"2022-01-24T10:46:26.918342Z","date_created":"2022-01-24T10:36:57.888446Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","summary":{"geo":true,"labels":["Please + say, for each of the following, how important it is in your life.","Work","Family","Friends + and acquaintances","Leisure time"],"columns":["name","type","label","required","kobo--score-choices","select_from_list_name","hint","parameters"],"languages":[null],"row_count":21,"default_translation":null},"owner__username":"api_user","parent":null,"uid":"aCZ7EbjtocFTDQb4zuy8p6","tag_string":"","settings":{"sector":{"label":"Other","value":"Other"},"country":{"label":"Germany","value":"DEU"},"description":"Yet + another testing form for package development"},"kind":"asset","name":"Test + survey copy","asset_type":"survey","version_id":"vfNYuwH4M2cDuwpHVa8d95","has_deployment":true,"deployed_version_id":"vfNYuwH4M2cDuwpHVa8d95","deployment__identifier":"https://kc.correlaid.org/api_user/forms/aCZ7EbjtocFTDQb4zuy8p6","deployment__active":true,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/aCZ7EbjtocFTDQb4zuy8p6/permission-assignments/pgYj2WAamn9k7fpWRkoPUv/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/?format=json","label":"Add + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aCZ7EbjtocFTDQb4zuy8p6/permission-assignments/p3GfYpH3PeiTYkkuwz6HqL/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/?format=json","label":"Edit + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aCZ7EbjtocFTDQb4zuy8p6/permission-assignments/pSopQXRJx5QrEiCTEBVLeR/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/?format=json","label":"Edit + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aCZ7EbjtocFTDQb4zuy8p6/permission-assignments/pzqujT6UWUpVsLEN8te3n3/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/?format=json","label":"Delete + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aCZ7EbjtocFTDQb4zuy8p6/permission-assignments/pahUyUnUQkQ8fQYdzvzsKr/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/?format=json","label":"Manage + project"},{"url":"https://kobo.correlaid.org/api/v2/assets/aCZ7EbjtocFTDQb4zuy8p6/permission-assignments/pMuuKuTe2nLemni7E9Dn6h/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/?format=json","label":"Validate + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aCZ7EbjtocFTDQb4zuy8p6/permission-assignments/pnPRe5xDf5qHiKizeLxydG/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/?format=json","label":"View + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aCZ7EbjtocFTDQb4zuy8p6/permission-assignments/p95eU4TgQwA6TTFuPMa3yW/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/?format=json","label":"View + submissions"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/aCZ7EbjtocFTDQb4zuy8p6/?format=json.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/aCZ7EbjtocFTDQb4zuy8p6/?format=json.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/aCZ7EbjtocFTDQb4zuy8p6/data/?format=json"},{"url":"https://kobo.correlaid.org/api/v2/assets/aXDfXdiLsKTUTCMU9ARkJR/?format=json","date_modified":"2022-01-24T10:44:03.423230Z","date_created":"2022-01-24T10:44:03.423206Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","summary":{"geo":true,"labels":["Please + say, for each of the following, how important it is in your life.","Work","Family","Friends + and acquaintances","Leisure time"],"columns":["name","type","label","required","kobo--score-choices","select_from_list_name","hint","parameters"],"languages":[null],"row_count":21,"default_translation":null},"owner__username":"api_user","parent":null,"uid":"aXDfXdiLsKTUTCMU9ARkJR","tag_string":"","settings":{"sector":{"label":"Other","value":"Other"},"country":{"label":"Germany","value":"DEU"},"description":"Yet + another testing form for package development"},"kind":"asset","name":"Test + survey copy","asset_type":"survey","version_id":"vZ7To7HKRCq69PbMnebaYm","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/aXDfXdiLsKTUTCMU9ARkJR/permission-assignments/p5acbtnzgQXTdN9oXkd7gC/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/?format=json","label":"Add + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aXDfXdiLsKTUTCMU9ARkJR/permission-assignments/pQ9ujqXKiSzkqA6VH9kTNK/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/?format=json","label":"Edit + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aXDfXdiLsKTUTCMU9ARkJR/permission-assignments/pBaShBTouwiXz4RYVS42ne/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/?format=json","label":"Edit + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aXDfXdiLsKTUTCMU9ARkJR/permission-assignments/pUo6yULPBPe2gTz5UDTCMa/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/?format=json","label":"Delete + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aXDfXdiLsKTUTCMU9ARkJR/permission-assignments/pibeiLJtjiMXrqiZ33YskP/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/?format=json","label":"Manage + project"},{"url":"https://kobo.correlaid.org/api/v2/assets/aXDfXdiLsKTUTCMU9ARkJR/permission-assignments/pEtroVvBYmX74it4g3vwvQ/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/?format=json","label":"Validate + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aXDfXdiLsKTUTCMU9ARkJR/permission-assignments/pHfy2NeuLPNmWhWfdxcvNG/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/?format=json","label":"View + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aXDfXdiLsKTUTCMU9ARkJR/permission-assignments/prcYznXWofUgxw8PhUjTmd/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/?format=json","label":"View + submissions"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/aXDfXdiLsKTUTCMU9ARkJR/?format=json.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/aXDfXdiLsKTUTCMU9ARkJR/?format=json.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/aXDfXdiLsKTUTCMU9ARkJR/data/?format=json"},{"url":"https://kobo.correlaid.org/api/v2/assets/apwDxZE2zQoHVufauFHpcw/?format=json","date_modified":"2022-01-24T10:36:15.316711Z","date_created":"2022-01-24T10:36:15.316689Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","summary":{"geo":true,"labels":["Please + say, for each of the following, how important it is in your life.","Work","Family","Friends + and acquaintances","Leisure time"],"columns":["name","type","label","required","kobo--score-choices","select_from_list_name","hint","parameters"],"languages":[null],"row_count":21,"default_translation":null},"owner__username":"api_user","parent":null,"uid":"apwDxZE2zQoHVufauFHpcw","tag_string":"","settings":{"sector":{"label":"Other","value":"Other"},"country":{"label":"Germany","value":"DEU"},"description":"Yet + another testing form for package development"},"kind":"asset","name":"Test + survey copy","asset_type":"survey","version_id":"vZMD4EU2Aj9jUcQkrgxpA7","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/apwDxZE2zQoHVufauFHpcw/permission-assignments/paroLZVXchBGoGBPXKnHcC/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/?format=json","label":"Add + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/apwDxZE2zQoHVufauFHpcw/permission-assignments/pk7zHkx8VZog8LAPJrLeaV/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/?format=json","label":"Edit + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/apwDxZE2zQoHVufauFHpcw/permission-assignments/pC3jxBpeg78ST8EsFeuzm6/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/?format=json","label":"Edit + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/apwDxZE2zQoHVufauFHpcw/permission-assignments/pZXWUCT3UYqfPASbPyJtsC/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/?format=json","label":"Delete + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/apwDxZE2zQoHVufauFHpcw/permission-assignments/p8G899tTNNcXpKv6zgubGq/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/?format=json","label":"Manage + project"},{"url":"https://kobo.correlaid.org/api/v2/assets/apwDxZE2zQoHVufauFHpcw/permission-assignments/pajXAZHUi7HNPSNWpPejCZ/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/?format=json","label":"Validate + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/apwDxZE2zQoHVufauFHpcw/permission-assignments/pHdXm5YJw5hqR3AKTD8XVa/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/?format=json","label":"View + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/apwDxZE2zQoHVufauFHpcw/permission-assignments/pudmP6pRdEzDnVE2NuV4uT/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/?format=json","label":"View + submissions"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/apwDxZE2zQoHVufauFHpcw/?format=json.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/apwDxZE2zQoHVufauFHpcw/?format=json.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/apwDxZE2zQoHVufauFHpcw/data/?format=json"},{"url":"https://kobo.correlaid.org/api/v2/assets/aXLRYTqmkVkLRMh3vPrPWH/?format=json","date_modified":"2022-01-24T10:07:53.501315Z","date_created":"2022-01-24T10:07:53.501291Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","summary":{"geo":true,"labels":["Please + say, for each of the following, how important it is in your life.","Work","Family","Friends + and acquaintances","Leisure time"],"columns":["name","type","label","required","kobo--score-choices","select_from_list_name","hint","parameters"],"languages":[null],"row_count":21,"default_translation":null},"owner__username":"api_user","parent":null,"uid":"aXLRYTqmkVkLRMh3vPrPWH","tag_string":"","settings":{"sector":{"label":"Other","value":"Other"},"country":{"label":"Germany","value":"DEU"},"description":"Yet + another testing form for package development"},"kind":"asset","name":"cloning + (Frie)","asset_type":"survey","version_id":"v2RUbTfjdUePq8YBSzgCou","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/aXLRYTqmkVkLRMh3vPrPWH/permission-assignments/pMqmpPJmMpgGQAbrMU7QGG/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/?format=json","label":"Add + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aXLRYTqmkVkLRMh3vPrPWH/permission-assignments/pNdwnGjZ8JSHHFRusV5EA9/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/?format=json","label":"Edit + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aXLRYTqmkVkLRMh3vPrPWH/permission-assignments/pQUwgon3BjroXqszpyhHf9/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/?format=json","label":"Edit + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aXLRYTqmkVkLRMh3vPrPWH/permission-assignments/p4vPeb7i23CrkTSpym9XmJ/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/?format=json","label":"Delete + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aXLRYTqmkVkLRMh3vPrPWH/permission-assignments/ptUKeqoVAH6FQZ6t5Veqwx/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/?format=json","label":"Manage + project"},{"url":"https://kobo.correlaid.org/api/v2/assets/aXLRYTqmkVkLRMh3vPrPWH/permission-assignments/pF6Ewsu4LqpyTvLqMbEbyz/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/?format=json","label":"Validate + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aXLRYTqmkVkLRMh3vPrPWH/permission-assignments/piZe5yzsY5sw5eJ7tQdjeG/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/?format=json","label":"View + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aXLRYTqmkVkLRMh3vPrPWH/permission-assignments/pw654tzRNFCP8SNfnjp7kP/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/?format=json","label":"View + submissions"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/aXLRYTqmkVkLRMh3vPrPWH/?format=json.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/aXLRYTqmkVkLRMh3vPrPWH/?format=json.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/aXLRYTqmkVkLRMh3vPrPWH/data/?format=json"},{"url":"https://kobo.correlaid.org/api/v2/assets/aRo4wg5utWT7dwdnQQEAE7/?format=json","date_modified":"2021-09-24T11:42:42.761924Z","date_created":"2021-05-02T12:12:11.859577Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","summary":{"geo":true,"labels":["Please say, for each of the following, how important it is in your life.","Work","Family","Friends and acquaintances","Leisure time"],"columns":["name","type","label","required","kobo--score-choices","select_from_list_name","hint","parameters"],"languages":[null],"row_count":21,"default_translation":null},"owner__username":"api_user","parent":null,"uid":"aRo4wg5utWT7dwdnQQEAE7","tag_string":"","settings":{"sector":{"label":"Other","value":"Other"},"country":{"label":"Germany","value":"DEU"},"description":"Yet another testing form for package development","share-metadata":false},"kind":"asset","name":"kbtbr @@ -526,5 +586,5 @@ http_interactions: block"},{"url":"https://kobo.correlaid.org/api/v2/assets/a9BzPvnNLub346sr8M7R33/permission-assignments/p2ow2DBYsTuyBD3SXueFjv/?format=json","user":"https://kobo.correlaid.org/api/v2/users/super_admin/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/?format=json","label":"Manage block"},{"url":"https://kobo.correlaid.org/api/v2/assets/a9BzPvnNLub346sr8M7R33/permission-assignments/pUaxf7JWWrefyH5XFN59yT/?format=json","user":"https://kobo.correlaid.org/api/v2/users/super_admin/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/?format=json","label":"View block"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/a9BzPvnNLub346sr8M7R33/?format=json.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/a9BzPvnNLub346sr8M7R33/?format=json.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/a9BzPvnNLub346sr8M7R33/data/?format=json"}]}' - recorded_at: 2021-10-03 17:14:48 GMT + recorded_at: 2022-01-24 13:04:46 GMT recorded_with: vcr/0.6.0, webmockr/0.8.0 diff --git a/vignettes/articles/kobo-asset-submissions-data.yml b/vignettes/assets/get-submissions.yml similarity index 99% rename from vignettes/articles/kobo-asset-submissions-data.yml rename to vignettes/assets/get-submissions.yml index 9f03944..e7030a7 100644 --- a/vignettes/articles/kobo-asset-submissions-data.yml +++ b/vignettes/assets/get-submissions.yml @@ -18,7 +18,7 @@ http_interactions: headers: status: HTTP/1.1 200 OK server: nginx - date: Sun, 03 Oct 2021 15:54:15 GMT + date: Mon, 24 Jan 2022 13:04:48 GMT content-type: application/json content-length: '17369' connection: keep-alive @@ -106,7 +106,7 @@ http_interactions: submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aRo4wg5utWT7dwdnQQEAE7/permission-assignments/pfWCMzdRisSwRiUzzdtLsR/?format=json","user":"https://kobo.correlaid.org/api/v2/users/frie_preu/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/?format=json","label":"Edit form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aRo4wg5utWT7dwdnQQEAE7/permission-assignments/pczJm4pANtqBCqyuMjJ2VM/?format=json","user":"https://kobo.correlaid.org/api/v2/users/frie_preu/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/?format=json","label":"View form"}],"data":"https://kobo.correlaid.org/api/v2/assets/aRo4wg5utWT7dwdnQQEAE7/data/?format=json"}' - recorded_at: 2021-10-03 15:54:05 GMT + recorded_at: 2022-01-24 13:04:47 GMT recorded_with: vcr/0.6.0, webmockr/0.8.0 - request: method: get @@ -127,7 +127,7 @@ http_interactions: headers: status: HTTP/1.1 200 OK server: nginx - date: Sun, 03 Oct 2021 15:54:15 GMT + date: Mon, 24 Jan 2022 13:04:49 GMT content-type: application/json content-length: '10550' connection: keep-alive @@ -150,5 +150,5 @@ http_interactions: 2021-09-05 at 11.39.31-12_16_32.png","instance":532,"download_medium_url":"https://kc.correlaid.org/media/medium?media_file=api_user%2Fattachments%2F1f37921296654b91b8cc11e152956764%2F40c70c77-7d3d-4824-8e0e-43094764a75d%2FScreenshot+2021-09-05+at+11.39.31-12_16_32.png","id":3,"xform":18}],"importance_in_life/Leisure_time":"2","start":"2021-09-05T11:46:45.940+02:00","trust_in_groups/People_of_another_religion":"3","_geolocation":[53.540416,10.037051],"importance_in_life/Work":"1","_status":"submitted_via_web","__version__":"vkhZEtuEwyhNgJropgVs7h","trust_in_others":"1"},{"_id":647,"control_over_life":"7","Taking_all_things_to_ould_you_say_you_are":"4","health_self_assessment":"8","_validation_status":{},"_uuid":"a6937122-45c0-4a26-9ebe-a754685a2f95","voluntary_activity":"9","importance_in_life/Friends_and_acquaintances":"1","_tags":[],"locate_hamburg":"-6.501624 84.995994 0 0","_submitted_by":null,"_xform_id_string":"aRo4wg5utWT7dwdnQQEAE7","meta/instanceID":"uuid:a6937122-45c0-4a26-9ebe-a754685a2f95","formhub/uuid":"1f37921296654b91b8cc11e152956764","trust_in_groups/People_in_your_neighborhood":"1","end":"2021-09-28T18:04:42.017+02:00","_submission_time":"2021-09-28T16:04:58","_notes":[],"_attachments":[],"start":"2021-09-28T18:04:24.268+02:00","_geolocation":[-6.501624,84.995994],"_status":"submitted_via_web","__version__":"vkhZEtuEwyhNgJropgVs7h"},{"_id":659,"control_over_life":"7","Taking_all_things_to_ould_you_say_you_are":"3","voluntary_activity":"1","trust_in_groups/Your_family":"1","formhub/uuid":"1f37921296654b91b8cc11e152956764","_validation_status":{},"importance_in_life/Politics":"1","_uuid":"02d6e405-9254-47f2-af9c-c425792a6d77","health_self_assessment":"2","importance_in_life/Friends_and_acquaintances":"2","_tags":[],"trust_in_groups/People_you_know_personally":"1","_submitted_by":null,"_xform_id_string":"aRo4wg5utWT7dwdnQQEAE7","importance_in_life/Family":"2","trust_in_groups/People_you_meet_for_the_first_time":"3","meta/instanceID":"uuid:02d6e405-9254-47f2-af9c-c425792a6d77","trust_in_groups/People_of_another_nationality":"2","trust_in_groups/People_in_your_neighborhood":"2","importance_in_life/Religion":"3","end":"2021-09-30T17:43:19.652+02:00","locate_hamburg":"53.078188 11.107801 0 0","_submission_time":"2021-09-30T15:43:24","_notes":[],"_attachments":[],"importance_in_life/Leisure_time":"3","start":"2021-09-30T17:42:39.149+02:00","trust_in_groups/People_of_another_religion":"2","_geolocation":[53.078188,11.107801],"importance_in_life/Work":"3","_status":"submitted_via_web","__version__":"vkhZEtuEwyhNgJropgVs7h"}]}' - recorded_at: 2021-10-03 15:54:05 GMT + recorded_at: 2022-01-24 13:04:47 GMT recorded_with: vcr/0.6.0, webmockr/0.8.0 diff --git a/vignettes/assets/get-surveys.yml b/vignettes/assets/get-surveys.yml new file mode 100644 index 0000000..b3c2d51 --- /dev/null +++ b/vignettes/assets/get-surveys.yml @@ -0,0 +1,590 @@ +http_interactions: +- request: + method: get + uri: https://kobo.correlaid.org/api/v2/assets/?format=json + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3 crul/1.1.0 + Accept-Encoding: gzip, deflate + Authorization: fakebearertoken + Accept: application/json + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + server: nginx + date: Mon, 24 Jan 2022 13:04:48 GMT + content-type: application/json + content-length: '212744' + connection: keep-alive + vary: Accept, Accept-Language, Cookie, Origin + allow: GET, POST, HEAD, OPTIONS + x-kobonaut: api_user + x-frame-options: SAMEORIGIN + content-language: en + body: + encoding: UTF-8 + file: no + string: '{"count":65,"next":null,"previous":null,"results":[{"url":"https://kobo.correlaid.org/api/v2/assets/a27VRgrwgk9TPnH5wQRVTi/?format=json","date_modified":"2022-01-24T13:01:05.390530Z","date_created":"2022-01-24T13:01:04.585505Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","summary":{"geo":true,"labels":["Please + say, for each of the following, how important it is in your life.","Work","Family","Friends + and acquaintances","Leisure time"],"columns":["name","type","label","required","kobo--score-choices","select_from_list_name","hint","parameters"],"languages":[null],"row_count":21,"default_translation":null},"owner__username":"api_user","parent":null,"uid":"a27VRgrwgk9TPnH5wQRVTi","tag_string":"","settings":{"sector":{"label":"Other","value":"Other"},"country":{"label":"Germany","value":"DEU"},"description":"Yet + another testing form for package development"},"kind":"asset","name":"Test + survey copy","asset_type":"survey","version_id":"vefEaQRzybAM2NCicGAybk","has_deployment":true,"deployed_version_id":"vefEaQRzybAM2NCicGAybk","deployment__identifier":"https://kc.correlaid.org/api_user/forms/a27VRgrwgk9TPnH5wQRVTi","deployment__active":true,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/a27VRgrwgk9TPnH5wQRVTi/permission-assignments/pWhfNaNVSbQCE82X6dVkHn/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/?format=json","label":"Add + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/a27VRgrwgk9TPnH5wQRVTi/permission-assignments/pXfqAGaZxPvTKAMsJMdQa8/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/?format=json","label":"Edit + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/a27VRgrwgk9TPnH5wQRVTi/permission-assignments/p735UBtzDtEhBWBuW8DAas/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/?format=json","label":"Edit + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/a27VRgrwgk9TPnH5wQRVTi/permission-assignments/pEsTivxY6SViqu4GYuaBNw/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/?format=json","label":"Delete + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/a27VRgrwgk9TPnH5wQRVTi/permission-assignments/pp32PiEKhDG4bgTUjzivnv/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/?format=json","label":"Manage + project"},{"url":"https://kobo.correlaid.org/api/v2/assets/a27VRgrwgk9TPnH5wQRVTi/permission-assignments/pCyWPw6nzyKeVDSWVqwGnW/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/?format=json","label":"Validate + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/a27VRgrwgk9TPnH5wQRVTi/permission-assignments/p5wykZ4jrtStmQEeWyNm9T/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/?format=json","label":"View + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/a27VRgrwgk9TPnH5wQRVTi/permission-assignments/pnpndHRXNQEXa4fTiWPbhe/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/?format=json","label":"View + submissions"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/a27VRgrwgk9TPnH5wQRVTi/?format=json.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/a27VRgrwgk9TPnH5wQRVTi/?format=json.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/a27VRgrwgk9TPnH5wQRVTi/data/?format=json"},{"url":"https://kobo.correlaid.org/api/v2/assets/aCZ7EbjtocFTDQb4zuy8p6/?format=json","date_modified":"2022-01-24T10:46:26.918342Z","date_created":"2022-01-24T10:36:57.888446Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","summary":{"geo":true,"labels":["Please + say, for each of the following, how important it is in your life.","Work","Family","Friends + and acquaintances","Leisure time"],"columns":["name","type","label","required","kobo--score-choices","select_from_list_name","hint","parameters"],"languages":[null],"row_count":21,"default_translation":null},"owner__username":"api_user","parent":null,"uid":"aCZ7EbjtocFTDQb4zuy8p6","tag_string":"","settings":{"sector":{"label":"Other","value":"Other"},"country":{"label":"Germany","value":"DEU"},"description":"Yet + another testing form for package development"},"kind":"asset","name":"Test + survey copy","asset_type":"survey","version_id":"vfNYuwH4M2cDuwpHVa8d95","has_deployment":true,"deployed_version_id":"vfNYuwH4M2cDuwpHVa8d95","deployment__identifier":"https://kc.correlaid.org/api_user/forms/aCZ7EbjtocFTDQb4zuy8p6","deployment__active":true,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/aCZ7EbjtocFTDQb4zuy8p6/permission-assignments/pgYj2WAamn9k7fpWRkoPUv/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/?format=json","label":"Add + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aCZ7EbjtocFTDQb4zuy8p6/permission-assignments/p3GfYpH3PeiTYkkuwz6HqL/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/?format=json","label":"Edit + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aCZ7EbjtocFTDQb4zuy8p6/permission-assignments/pSopQXRJx5QrEiCTEBVLeR/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/?format=json","label":"Edit + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aCZ7EbjtocFTDQb4zuy8p6/permission-assignments/pzqujT6UWUpVsLEN8te3n3/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/?format=json","label":"Delete + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aCZ7EbjtocFTDQb4zuy8p6/permission-assignments/pahUyUnUQkQ8fQYdzvzsKr/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/?format=json","label":"Manage + project"},{"url":"https://kobo.correlaid.org/api/v2/assets/aCZ7EbjtocFTDQb4zuy8p6/permission-assignments/pMuuKuTe2nLemni7E9Dn6h/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/?format=json","label":"Validate + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aCZ7EbjtocFTDQb4zuy8p6/permission-assignments/pnPRe5xDf5qHiKizeLxydG/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/?format=json","label":"View + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aCZ7EbjtocFTDQb4zuy8p6/permission-assignments/p95eU4TgQwA6TTFuPMa3yW/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/?format=json","label":"View + submissions"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/aCZ7EbjtocFTDQb4zuy8p6/?format=json.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/aCZ7EbjtocFTDQb4zuy8p6/?format=json.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/aCZ7EbjtocFTDQb4zuy8p6/data/?format=json"},{"url":"https://kobo.correlaid.org/api/v2/assets/aXDfXdiLsKTUTCMU9ARkJR/?format=json","date_modified":"2022-01-24T10:44:03.423230Z","date_created":"2022-01-24T10:44:03.423206Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","summary":{"geo":true,"labels":["Please + say, for each of the following, how important it is in your life.","Work","Family","Friends + and acquaintances","Leisure time"],"columns":["name","type","label","required","kobo--score-choices","select_from_list_name","hint","parameters"],"languages":[null],"row_count":21,"default_translation":null},"owner__username":"api_user","parent":null,"uid":"aXDfXdiLsKTUTCMU9ARkJR","tag_string":"","settings":{"sector":{"label":"Other","value":"Other"},"country":{"label":"Germany","value":"DEU"},"description":"Yet + another testing form for package development"},"kind":"asset","name":"Test + survey copy","asset_type":"survey","version_id":"vZ7To7HKRCq69PbMnebaYm","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/aXDfXdiLsKTUTCMU9ARkJR/permission-assignments/p5acbtnzgQXTdN9oXkd7gC/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/?format=json","label":"Add + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aXDfXdiLsKTUTCMU9ARkJR/permission-assignments/pQ9ujqXKiSzkqA6VH9kTNK/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/?format=json","label":"Edit + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aXDfXdiLsKTUTCMU9ARkJR/permission-assignments/pBaShBTouwiXz4RYVS42ne/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/?format=json","label":"Edit + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aXDfXdiLsKTUTCMU9ARkJR/permission-assignments/pUo6yULPBPe2gTz5UDTCMa/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/?format=json","label":"Delete + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aXDfXdiLsKTUTCMU9ARkJR/permission-assignments/pibeiLJtjiMXrqiZ33YskP/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/?format=json","label":"Manage + project"},{"url":"https://kobo.correlaid.org/api/v2/assets/aXDfXdiLsKTUTCMU9ARkJR/permission-assignments/pEtroVvBYmX74it4g3vwvQ/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/?format=json","label":"Validate + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aXDfXdiLsKTUTCMU9ARkJR/permission-assignments/pHfy2NeuLPNmWhWfdxcvNG/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/?format=json","label":"View + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aXDfXdiLsKTUTCMU9ARkJR/permission-assignments/prcYznXWofUgxw8PhUjTmd/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/?format=json","label":"View + submissions"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/aXDfXdiLsKTUTCMU9ARkJR/?format=json.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/aXDfXdiLsKTUTCMU9ARkJR/?format=json.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/aXDfXdiLsKTUTCMU9ARkJR/data/?format=json"},{"url":"https://kobo.correlaid.org/api/v2/assets/apwDxZE2zQoHVufauFHpcw/?format=json","date_modified":"2022-01-24T10:36:15.316711Z","date_created":"2022-01-24T10:36:15.316689Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","summary":{"geo":true,"labels":["Please + say, for each of the following, how important it is in your life.","Work","Family","Friends + and acquaintances","Leisure time"],"columns":["name","type","label","required","kobo--score-choices","select_from_list_name","hint","parameters"],"languages":[null],"row_count":21,"default_translation":null},"owner__username":"api_user","parent":null,"uid":"apwDxZE2zQoHVufauFHpcw","tag_string":"","settings":{"sector":{"label":"Other","value":"Other"},"country":{"label":"Germany","value":"DEU"},"description":"Yet + another testing form for package development"},"kind":"asset","name":"Test + survey copy","asset_type":"survey","version_id":"vZMD4EU2Aj9jUcQkrgxpA7","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/apwDxZE2zQoHVufauFHpcw/permission-assignments/paroLZVXchBGoGBPXKnHcC/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/?format=json","label":"Add + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/apwDxZE2zQoHVufauFHpcw/permission-assignments/pk7zHkx8VZog8LAPJrLeaV/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/?format=json","label":"Edit + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/apwDxZE2zQoHVufauFHpcw/permission-assignments/pC3jxBpeg78ST8EsFeuzm6/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/?format=json","label":"Edit + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/apwDxZE2zQoHVufauFHpcw/permission-assignments/pZXWUCT3UYqfPASbPyJtsC/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/?format=json","label":"Delete + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/apwDxZE2zQoHVufauFHpcw/permission-assignments/p8G899tTNNcXpKv6zgubGq/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/?format=json","label":"Manage + project"},{"url":"https://kobo.correlaid.org/api/v2/assets/apwDxZE2zQoHVufauFHpcw/permission-assignments/pajXAZHUi7HNPSNWpPejCZ/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/?format=json","label":"Validate + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/apwDxZE2zQoHVufauFHpcw/permission-assignments/pHdXm5YJw5hqR3AKTD8XVa/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/?format=json","label":"View + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/apwDxZE2zQoHVufauFHpcw/permission-assignments/pudmP6pRdEzDnVE2NuV4uT/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/?format=json","label":"View + submissions"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/apwDxZE2zQoHVufauFHpcw/?format=json.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/apwDxZE2zQoHVufauFHpcw/?format=json.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/apwDxZE2zQoHVufauFHpcw/data/?format=json"},{"url":"https://kobo.correlaid.org/api/v2/assets/aXLRYTqmkVkLRMh3vPrPWH/?format=json","date_modified":"2022-01-24T10:07:53.501315Z","date_created":"2022-01-24T10:07:53.501291Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","summary":{"geo":true,"labels":["Please + say, for each of the following, how important it is in your life.","Work","Family","Friends + and acquaintances","Leisure time"],"columns":["name","type","label","required","kobo--score-choices","select_from_list_name","hint","parameters"],"languages":[null],"row_count":21,"default_translation":null},"owner__username":"api_user","parent":null,"uid":"aXLRYTqmkVkLRMh3vPrPWH","tag_string":"","settings":{"sector":{"label":"Other","value":"Other"},"country":{"label":"Germany","value":"DEU"},"description":"Yet + another testing form for package development"},"kind":"asset","name":"cloning + (Frie)","asset_type":"survey","version_id":"v2RUbTfjdUePq8YBSzgCou","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/aXLRYTqmkVkLRMh3vPrPWH/permission-assignments/pMqmpPJmMpgGQAbrMU7QGG/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/?format=json","label":"Add + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aXLRYTqmkVkLRMh3vPrPWH/permission-assignments/pNdwnGjZ8JSHHFRusV5EA9/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/?format=json","label":"Edit + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aXLRYTqmkVkLRMh3vPrPWH/permission-assignments/pQUwgon3BjroXqszpyhHf9/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/?format=json","label":"Edit + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aXLRYTqmkVkLRMh3vPrPWH/permission-assignments/p4vPeb7i23CrkTSpym9XmJ/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/?format=json","label":"Delete + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aXLRYTqmkVkLRMh3vPrPWH/permission-assignments/ptUKeqoVAH6FQZ6t5Veqwx/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/?format=json","label":"Manage + project"},{"url":"https://kobo.correlaid.org/api/v2/assets/aXLRYTqmkVkLRMh3vPrPWH/permission-assignments/pF6Ewsu4LqpyTvLqMbEbyz/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/?format=json","label":"Validate + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aXLRYTqmkVkLRMh3vPrPWH/permission-assignments/piZe5yzsY5sw5eJ7tQdjeG/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/?format=json","label":"View + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aXLRYTqmkVkLRMh3vPrPWH/permission-assignments/pw654tzRNFCP8SNfnjp7kP/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/?format=json","label":"View + submissions"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/aXLRYTqmkVkLRMh3vPrPWH/?format=json.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/aXLRYTqmkVkLRMh3vPrPWH/?format=json.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/aXLRYTqmkVkLRMh3vPrPWH/data/?format=json"},{"url":"https://kobo.correlaid.org/api/v2/assets/aRo4wg5utWT7dwdnQQEAE7/?format=json","date_modified":"2021-09-24T11:42:42.761924Z","date_created":"2021-05-02T12:12:11.859577Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","summary":{"geo":true,"labels":["Please + say, for each of the following, how important it is in your life.","Work","Family","Friends + and acquaintances","Leisure time"],"columns":["name","type","label","required","kobo--score-choices","select_from_list_name","hint","parameters"],"languages":[null],"row_count":21,"default_translation":null},"owner__username":"api_user","parent":null,"uid":"aRo4wg5utWT7dwdnQQEAE7","tag_string":"","settings":{"sector":{"label":"Other","value":"Other"},"country":{"label":"Germany","value":"DEU"},"description":"Yet + another testing form for package development","share-metadata":false},"kind":"asset","name":"kbtbr + Testing Survey","asset_type":"survey","version_id":"vyzdxQoDi9hAcFngmtr7be","has_deployment":true,"deployed_version_id":"vkhZEtuEwyhNgJropgVs7h","deployment__identifier":"https://kc.correlaid.org/api_user/forms/aRo4wg5utWT7dwdnQQEAE7","deployment__active":true,"deployment__submission_count":8,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/aRo4wg5utWT7dwdnQQEAE7/permission-assignments/pTCqxaESxYx2SUYkWiALnC/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/?format=json","label":"Add + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aRo4wg5utWT7dwdnQQEAE7/permission-assignments/pyjSr8wPH8oBVMDrYi9FpE/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/?format=json","label":"Edit + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aRo4wg5utWT7dwdnQQEAE7/permission-assignments/pJACpAkTmtp8s5p6utU9YT/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/?format=json","label":"Edit + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aRo4wg5utWT7dwdnQQEAE7/permission-assignments/pVbeK2y8YgtihrRG6byMx2/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/?format=json","label":"Delete + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aRo4wg5utWT7dwdnQQEAE7/permission-assignments/phtqCFWEDWQzNuqnZxPpBM/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/?format=json","label":"Manage + project"},{"url":"https://kobo.correlaid.org/api/v2/assets/aRo4wg5utWT7dwdnQQEAE7/permission-assignments/pNayyKXD3QNNXGr5FZEizm/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/?format=json","label":"Validate + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aRo4wg5utWT7dwdnQQEAE7/permission-assignments/poJy52KAry8a5SPPRyPThh/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/?format=json","label":"View + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aRo4wg5utWT7dwdnQQEAE7/permission-assignments/pyDdK9tLBLkpRGakcShXPj/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/?format=json","label":"View + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aRo4wg5utWT7dwdnQQEAE7/permission-assignments/pfWCMzdRisSwRiUzzdtLsR/?format=json","user":"https://kobo.correlaid.org/api/v2/users/frie_preu/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/?format=json","label":"Edit + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aRo4wg5utWT7dwdnQQEAE7/permission-assignments/pczJm4pANtqBCqyuMjJ2VM/?format=json","user":"https://kobo.correlaid.org/api/v2/users/frie_preu/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/?format=json","label":"View + form"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/aRo4wg5utWT7dwdnQQEAE7/?format=json.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/aRo4wg5utWT7dwdnQQEAE7/?format=json.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/aRo4wg5utWT7dwdnQQEAE7/data/?format=json"},{"url":"https://kobo.correlaid.org/api/v2/assets/aRguvCamLrn987Mv96CiTS/?format=json","date_modified":"2021-08-23T09:24:14.152541Z","date_created":"2021-08-23T09:24:14.152515Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","summary":{},"owner__username":"api_user","parent":null,"uid":"aRguvCamLrn987Mv96CiTS","tag_string":"","settings":{"sector":null,"country":null,"description":"","share-metadata":false},"kind":"asset","name":"test","asset_type":"survey","version_id":"vncQSwKmSr9BoQHRy37KNT","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/aRguvCamLrn987Mv96CiTS/permission-assignments/pbSJYjG5btuXYK5ezG7KX3/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/?format=json","label":"Add + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aRguvCamLrn987Mv96CiTS/permission-assignments/pJSQdBhwfBdL7DHAStErDa/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/?format=json","label":"Edit + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aRguvCamLrn987Mv96CiTS/permission-assignments/pmH5TqphUWPt7bGNdtFDoW/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/?format=json","label":"Edit + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aRguvCamLrn987Mv96CiTS/permission-assignments/pLfz4sqWxMA2syRiwKy88x/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/?format=json","label":"Delete + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aRguvCamLrn987Mv96CiTS/permission-assignments/pUa984PDRZDYgiVxnkGjHU/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/?format=json","label":"Manage + project"},{"url":"https://kobo.correlaid.org/api/v2/assets/aRguvCamLrn987Mv96CiTS/permission-assignments/pZVFi7t2QnxDWJhjqt23K5/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/?format=json","label":"Validate + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aRguvCamLrn987Mv96CiTS/permission-assignments/pi2kzET9b6cJBnr9AzHJ9w/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/?format=json","label":"View + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aRguvCamLrn987Mv96CiTS/permission-assignments/pVvuvZTwxybvtD4huU7D7P/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/?format=json","label":"View + submissions"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/aRguvCamLrn987Mv96CiTS/?format=json.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/aRguvCamLrn987Mv96CiTS/?format=json.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/aRguvCamLrn987Mv96CiTS/data/?format=json"},{"url":"https://kobo.correlaid.org/api/v2/assets/aB7nncGhiyNcxoQ6uzPLy8/?format=json","date_modified":"2021-08-10T18:06:30.235047Z","date_created":"2021-08-10T18:06:30.235022Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","summary":{},"owner__username":"api_user","parent":null,"uid":"aB7nncGhiyNcxoQ6uzPLy8","tag_string":"","settings":{"sector":{"label":"Arts, + Entertainment, and Recreation","value":"Arts, Entertainment, and Recreation"},"country":{"label":"Åland + Islands","value":"ALA"},"description":"qwe","share-metadata":false},"kind":"asset","name":"q","asset_type":"survey","version_id":"vjFfR9bFMmPwnj9gJNPwkd","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/aB7nncGhiyNcxoQ6uzPLy8/permission-assignments/p5LQkhcNUF4aWbtsSmS35F/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/?format=json","label":"Add + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aB7nncGhiyNcxoQ6uzPLy8/permission-assignments/pQhhKEH6fQUsDpRfnJwKTv/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/?format=json","label":"Edit + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aB7nncGhiyNcxoQ6uzPLy8/permission-assignments/p2PwWkYJjUCZBp6nNZRtot/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/?format=json","label":"Edit + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aB7nncGhiyNcxoQ6uzPLy8/permission-assignments/p9CpSVKxa83HPDFGEjTBRi/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/?format=json","label":"Delete + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aB7nncGhiyNcxoQ6uzPLy8/permission-assignments/pwJrYzdZzLMNFzyo7Ya8ws/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/?format=json","label":"Manage + project"},{"url":"https://kobo.correlaid.org/api/v2/assets/aB7nncGhiyNcxoQ6uzPLy8/permission-assignments/p3vTyu3bgXynF5pRnVjyG8/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/?format=json","label":"Validate + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aB7nncGhiyNcxoQ6uzPLy8/permission-assignments/pe2vPNwCCs3NJ6yEjzrmSG/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/?format=json","label":"View + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aB7nncGhiyNcxoQ6uzPLy8/permission-assignments/p3UTyQbSnQQfor98nZEGdo/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/?format=json","label":"View + submissions"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/aB7nncGhiyNcxoQ6uzPLy8/?format=json.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/aB7nncGhiyNcxoQ6uzPLy8/?format=json.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/aB7nncGhiyNcxoQ6uzPLy8/data/?format=json"},{"url":"https://kobo.correlaid.org/api/v2/assets/aVYGrf26S3PfV4H5NLHCXa/?format=json","date_modified":"2021-08-10T18:03:57.796483Z","date_created":"2021-08-10T18:03:57.796460Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","summary":{},"owner__username":"api_user","parent":null,"uid":"aVYGrf26S3PfV4H5NLHCXa","tag_string":"","settings":{"sector":{"label":"Arts, + Entertainment, and Recreation","value":"Arts, Entertainment, and Recreation"},"country":{"label":"Albania","value":"ALB"},"description":"kjhsdaflkj","share-metadata":false},"kind":"asset","name":"aklsdgjh","asset_type":"survey","version_id":"vfzzyv82ucSYk8fdNy4KKr","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/aVYGrf26S3PfV4H5NLHCXa/permission-assignments/pBRwJiP44ZPwxyAmqoB2kT/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/?format=json","label":"Add + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aVYGrf26S3PfV4H5NLHCXa/permission-assignments/ppKVMt4p3U6WwJznDnfdbZ/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/?format=json","label":"Edit + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aVYGrf26S3PfV4H5NLHCXa/permission-assignments/pvZdzn42CEJHU2T3Zy3Qnj/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/?format=json","label":"Edit + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aVYGrf26S3PfV4H5NLHCXa/permission-assignments/p2Dbp8GosSr7PKPZJBaRKD/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/?format=json","label":"Delete + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aVYGrf26S3PfV4H5NLHCXa/permission-assignments/pqJxU68YQDMEkN2oApQL3b/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/?format=json","label":"Manage + project"},{"url":"https://kobo.correlaid.org/api/v2/assets/aVYGrf26S3PfV4H5NLHCXa/permission-assignments/pYjZHDK88AnJ7Y8UCbYZ4U/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/?format=json","label":"Validate + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aVYGrf26S3PfV4H5NLHCXa/permission-assignments/pfuMuE6cZv2RD8ytUMvDZm/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/?format=json","label":"View + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aVYGrf26S3PfV4H5NLHCXa/permission-assignments/pfYD3Ab6LMmZ37yjNgxF79/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/?format=json","label":"View + submissions"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/aVYGrf26S3PfV4H5NLHCXa/?format=json.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/aVYGrf26S3PfV4H5NLHCXa/?format=json.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/aVYGrf26S3PfV4H5NLHCXa/data/?format=json"},{"url":"https://kobo.correlaid.org/api/v2/assets/a6GR4hhbjwzag26tQQp97N/?format=json","date_modified":"2021-08-10T18:03:56.337126Z","date_created":"2021-08-10T18:03:56.337102Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","summary":{},"owner__username":"api_user","parent":null,"uid":"a6GR4hhbjwzag26tQQp97N","tag_string":"","settings":{"sector":{"label":"Arts, + Entertainment, and Recreation","value":"Arts, Entertainment, and Recreation"},"country":{"label":"Albania","value":"ALB"},"description":"kjhsdaflkj","share-metadata":false},"kind":"asset","name":"aklsdgjh","asset_type":"survey","version_id":"vWwAJ2KbvhvcGzzPCGzeDC","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/a6GR4hhbjwzag26tQQp97N/permission-assignments/pZeU3m7w37q24WXsb7tQeX/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/?format=json","label":"Add + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/a6GR4hhbjwzag26tQQp97N/permission-assignments/pSf86LNDfLtn5WqepnfqhX/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/?format=json","label":"Edit + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/a6GR4hhbjwzag26tQQp97N/permission-assignments/phYeVr4UA7tUfAPtVTDq7z/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/?format=json","label":"Edit + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/a6GR4hhbjwzag26tQQp97N/permission-assignments/pYCzdQ5aEJLWDZzsyi5pdK/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/?format=json","label":"Delete + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/a6GR4hhbjwzag26tQQp97N/permission-assignments/pzhN7tcxXWFuw7t2GmA5av/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/?format=json","label":"Manage + project"},{"url":"https://kobo.correlaid.org/api/v2/assets/a6GR4hhbjwzag26tQQp97N/permission-assignments/pa9XHeZdNhsJNFpgxu2m7z/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/?format=json","label":"Validate + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/a6GR4hhbjwzag26tQQp97N/permission-assignments/pcv3isSrvjYk7bAFDeC96q/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/?format=json","label":"View + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/a6GR4hhbjwzag26tQQp97N/permission-assignments/pDRZTFVRNQjw26kdZkPRA5/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/?format=json","label":"View + submissions"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/a6GR4hhbjwzag26tQQp97N/?format=json.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/a6GR4hhbjwzag26tQQp97N/?format=json.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/a6GR4hhbjwzag26tQQp97N/data/?format=json"},{"url":"https://kobo.correlaid.org/api/v2/assets/aFKo6XhXtYRoYKnvufEDRK/?format=json","date_modified":"2021-08-10T18:00:20.026525Z","date_created":"2021-08-10T18:00:20.026503Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","summary":{},"owner__username":"api_user","parent":null,"uid":"aFKo6XhXtYRoYKnvufEDRK","tag_string":"","settings":{"sector":{"label":"Arts, + Entertainment, and Recreation","value":"Arts, Entertainment, and Recreation"},"country":{"label":"Åland + Islands","value":"ALA"},"description":"qwe","share-metadata":false},"kind":"asset","name":"q","asset_type":"survey","version_id":"vEBCrpBMEgH2rAh73iDn3k","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/aFKo6XhXtYRoYKnvufEDRK/permission-assignments/pTD2nSHwtCXLjQsmkVNXs2/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/?format=json","label":"Add + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aFKo6XhXtYRoYKnvufEDRK/permission-assignments/pqB5fkbKacra6xRZjx8PYV/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/?format=json","label":"Edit + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aFKo6XhXtYRoYKnvufEDRK/permission-assignments/pKEADJZbn2BPR7MAh5ChS3/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/?format=json","label":"Edit + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aFKo6XhXtYRoYKnvufEDRK/permission-assignments/pJef5YUEBg6sBasDMpMBFH/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/?format=json","label":"Delete + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aFKo6XhXtYRoYKnvufEDRK/permission-assignments/pDwSPF6WiFnDxfojdfXCDy/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/?format=json","label":"Manage + project"},{"url":"https://kobo.correlaid.org/api/v2/assets/aFKo6XhXtYRoYKnvufEDRK/permission-assignments/p3RbAbJUUgNit3U6xEG9NV/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/?format=json","label":"Validate + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aFKo6XhXtYRoYKnvufEDRK/permission-assignments/pLJxso6frfAHjQJAa9LifY/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/?format=json","label":"View + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aFKo6XhXtYRoYKnvufEDRK/permission-assignments/pAyRQvFf2VGQMJyRKek5oF/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/?format=json","label":"View + submissions"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/aFKo6XhXtYRoYKnvufEDRK/?format=json.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/aFKo6XhXtYRoYKnvufEDRK/?format=json.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/aFKo6XhXtYRoYKnvufEDRK/data/?format=json"},{"url":"https://kobo.correlaid.org/api/v2/assets/a4Jx4YhpZSi8ZLjpYkTovL/?format=json","date_modified":"2021-08-10T17:55:26.824905Z","date_created":"2021-08-10T17:55:26.824883Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","summary":{},"owner__username":"api_user","parent":null,"uid":"a4Jx4YhpZSi8ZLjpYkTovL","tag_string":"","settings":{"sector":{"label":"Arts, + Entertainment, and Recreation","value":"Arts, Entertainment, and Recreation"},"country":{"label":"Albania","value":"ALB"},"description":"kjhsdaflkj","share-metadata":false},"kind":"asset","name":"aklsdgjh","asset_type":"survey","version_id":"v73fhkPHxbpfdBW92NmXAW","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/a4Jx4YhpZSi8ZLjpYkTovL/permission-assignments/poTLJSUZ84qzpgFt8fgAB4/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/?format=json","label":"Add + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/a4Jx4YhpZSi8ZLjpYkTovL/permission-assignments/pFtSeK5S9VZs7FemGtJijm/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/?format=json","label":"Edit + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/a4Jx4YhpZSi8ZLjpYkTovL/permission-assignments/pSUroxoYouXNskdYZ9HC5Q/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/?format=json","label":"Edit + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/a4Jx4YhpZSi8ZLjpYkTovL/permission-assignments/pp9z9uSCbBFHDxrQwb7nur/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/?format=json","label":"Delete + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/a4Jx4YhpZSi8ZLjpYkTovL/permission-assignments/pEVuWvXtvdM8iX7wmJ78Fp/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/?format=json","label":"Manage + project"},{"url":"https://kobo.correlaid.org/api/v2/assets/a4Jx4YhpZSi8ZLjpYkTovL/permission-assignments/pTANkTC4iqkN7zsay36G4f/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/?format=json","label":"Validate + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/a4Jx4YhpZSi8ZLjpYkTovL/permission-assignments/psQVANWRijwj2vXb7MR7G5/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/?format=json","label":"View + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/a4Jx4YhpZSi8ZLjpYkTovL/permission-assignments/pFSR9iDpYDcbmbrh49EX8N/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/?format=json","label":"View + submissions"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/a4Jx4YhpZSi8ZLjpYkTovL/?format=json.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/a4Jx4YhpZSi8ZLjpYkTovL/?format=json.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/a4Jx4YhpZSi8ZLjpYkTovL/data/?format=json"},{"url":"https://kobo.correlaid.org/api/v2/assets/a3bi7muZnw92kgmrx3L2cH/?format=json","date_modified":"2021-08-10T16:54:12.946047Z","date_created":"2021-08-10T16:54:12.946026Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","summary":{},"owner__username":"api_user","parent":null,"uid":"a3bi7muZnw92kgmrx3L2cH","tag_string":"","settings":{"sector":{"label":"Educational + Services / Higher Education","value":"Educational Services / Higher Education"},"country":{"label":"Åland + Islands","value":"ALA"},"description":"World","share-metadata":false},"kind":"asset","name":"Hello","asset_type":"survey","version_id":"vBuivfoVhwCUXSFvxUQNWV","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/a3bi7muZnw92kgmrx3L2cH/permission-assignments/pQe8ebhLciFRMmjEE9CNCP/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/?format=json","label":"Add + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/a3bi7muZnw92kgmrx3L2cH/permission-assignments/pgbAkgxNP49kWeAe8gfCMk/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/?format=json","label":"Edit + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/a3bi7muZnw92kgmrx3L2cH/permission-assignments/ppSkBBiJPUuA5qdPHEiBwF/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/?format=json","label":"Edit + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/a3bi7muZnw92kgmrx3L2cH/permission-assignments/pCJNXH5QVHfiV6j7WwLXsx/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/?format=json","label":"Delete + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/a3bi7muZnw92kgmrx3L2cH/permission-assignments/pjBjQiWKCgyBGxZAbFnv7K/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/?format=json","label":"Manage + project"},{"url":"https://kobo.correlaid.org/api/v2/assets/a3bi7muZnw92kgmrx3L2cH/permission-assignments/po75ccbRetZUf8wH4Lnxiv/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/?format=json","label":"Validate + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/a3bi7muZnw92kgmrx3L2cH/permission-assignments/pbt7MGeYbRpsTThWn6eBSU/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/?format=json","label":"View + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/a3bi7muZnw92kgmrx3L2cH/permission-assignments/p6syNWbfyDudBVKPWwFtQ6/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/?format=json","label":"View + submissions"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/a3bi7muZnw92kgmrx3L2cH/?format=json.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/a3bi7muZnw92kgmrx3L2cH/?format=json.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/a3bi7muZnw92kgmrx3L2cH/data/?format=json"},{"url":"https://kobo.correlaid.org/api/v2/assets/aj88soPozxDVg2WCnMGVzX/?format=json","date_modified":"2021-08-09T21:14:17.153977Z","date_created":"2021-08-09T21:14:17.153939Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","summary":{"geo":false,"labels":["Your + name","Your age","Your favourite dog","Your favourite cat"],"columns":["type","name","label","required","select_from_list_name","calculation"],"languages":[null],"row_count":5,"default_translation":null},"owner__username":"api_user","parent":null,"uid":"aj88soPozxDVg2WCnMGVzX","tag_string":"","settings":{},"kind":"asset","name":"amP4TBwoEcCAzBMZJ96ata","asset_type":"block","version_id":"vTAwyyPiQBsCM7tqFB2dUw","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/aj88soPozxDVg2WCnMGVzX/permission-assignments/pQkLPqESkNkUBrkMjxwDoG/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/?format=json","label":"Edit + block"},{"url":"https://kobo.correlaid.org/api/v2/assets/aj88soPozxDVg2WCnMGVzX/permission-assignments/pGWjansPZeRCbbevnaTdcL/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/?format=json","label":"Manage + block"},{"url":"https://kobo.correlaid.org/api/v2/assets/aj88soPozxDVg2WCnMGVzX/permission-assignments/pbAyyYaYNvfFWnhNtXKssT/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/?format=json","label":"View + block"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/aj88soPozxDVg2WCnMGVzX/?format=json.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/aj88soPozxDVg2WCnMGVzX/?format=json.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/aj88soPozxDVg2WCnMGVzX/data/?format=json"},{"url":"https://kobo.correlaid.org/api/v2/assets/amP4TBwoEcCAzBMZJ96ata/?format=json","date_modified":"2021-08-09T21:09:30.189833Z","date_created":"2021-06-22T19:27:08.246420Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","summary":{"geo":false,"labels":["Your + name","Your age","Your favourite dog","Your favourite cat"],"columns":["type","label","required","select_from_list_name"],"languages":[null],"row_count":4,"default_translation":null},"owner__username":"api_user","parent":null,"uid":"amP4TBwoEcCAzBMZJ96ata","tag_string":"","settings":{"sector":{"label":"Information + / Media","value":"Information / Media"},"country":{"label":"Germany","value":"DEU"},"description":"bla","share-metadata":true},"kind":"asset","name":"[Malte/cloning]","asset_type":"survey","version_id":"vxqXfWoTA2u2vMdeYdddzT","has_deployment":true,"deployed_version_id":"vxqXfWoTA2u2vMdeYdddzT","deployment__identifier":"https://kc.correlaid.org/api_user/forms/amP4TBwoEcCAzBMZJ96ata","deployment__active":true,"deployment__submission_count":3,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/amP4TBwoEcCAzBMZJ96ata/permission-assignments/p7BLLLdhjzbp3yfHY99sPn/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/?format=json","label":"Add + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/amP4TBwoEcCAzBMZJ96ata/permission-assignments/pBzudoNfF4Wp6CSNGeaxBm/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/?format=json","label":"Edit + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/amP4TBwoEcCAzBMZJ96ata/permission-assignments/pFHNYCG6HXrJZHNJa9tHnG/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/?format=json","label":"Edit + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/amP4TBwoEcCAzBMZJ96ata/permission-assignments/peYkkSYHVSRySy5BR7pQhE/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/?format=json","label":"Delete + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/amP4TBwoEcCAzBMZJ96ata/permission-assignments/p5hZt3cCDxArixjPpm7uzy/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/?format=json","label":"Manage + project"},{"url":"https://kobo.correlaid.org/api/v2/assets/amP4TBwoEcCAzBMZJ96ata/permission-assignments/pdNmxwrgWpjN52dsqDrknr/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/?format=json","label":"Validate + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/amP4TBwoEcCAzBMZJ96ata/permission-assignments/pgd4AaBUaLRqx6sZCKUqW5/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/?format=json","label":"View + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/amP4TBwoEcCAzBMZJ96ata/permission-assignments/pCD83TPLg3Pdt3s7FQDAiC/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/?format=json","label":"View + submissions"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/amP4TBwoEcCAzBMZJ96ata/?format=json.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/amP4TBwoEcCAzBMZJ96ata/?format=json.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/amP4TBwoEcCAzBMZJ96ata/data/?format=json"},{"url":"https://kobo.correlaid.org/api/v2/assets/aDfgacXboQEheygYpsrVuN/?format=json","date_modified":"2021-07-29T15:37:05.880856Z","date_created":"2021-07-29T15:37:05.880833Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","summary":{},"owner__username":"api_user","parent":null,"uid":"aDfgacXboQEheygYpsrVuN","tag_string":"","settings":{"sector":{"label":"","value":""},"country":{"label":"","value":""},"description":"","share-metadata":false},"kind":"asset","name":"vcr_test_name","asset_type":"survey","version_id":"vsybrkg3WUncv9bBzbUDAk","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/aDfgacXboQEheygYpsrVuN/permission-assignments/pubPKkxn66xsb9XSHf7xC7/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/?format=json","label":"Add + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aDfgacXboQEheygYpsrVuN/permission-assignments/phpfZvGdojthcX9MmCywGE/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/?format=json","label":"Edit + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aDfgacXboQEheygYpsrVuN/permission-assignments/pQddSPmwoYPUF5u3h8Cdzv/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/?format=json","label":"Edit + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aDfgacXboQEheygYpsrVuN/permission-assignments/pXDmiJWonPcgQkpJyFh8Pr/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/?format=json","label":"Delete + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aDfgacXboQEheygYpsrVuN/permission-assignments/p2Xrwu6cieSz4ZbQAzYrGg/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/?format=json","label":"Manage + project"},{"url":"https://kobo.correlaid.org/api/v2/assets/aDfgacXboQEheygYpsrVuN/permission-assignments/pruJQzXQ9V386Rm3wvAU9j/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/?format=json","label":"Validate + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aDfgacXboQEheygYpsrVuN/permission-assignments/pUJXaLZLiuKbbUjvGJ47g9/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/?format=json","label":"View + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aDfgacXboQEheygYpsrVuN/permission-assignments/pmVUcpXMPUkodM55pTL3tC/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/?format=json","label":"View + submissions"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/aDfgacXboQEheygYpsrVuN/?format=json.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/aDfgacXboQEheygYpsrVuN/?format=json.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/aDfgacXboQEheygYpsrVuN/data/?format=json"},{"url":"https://kobo.correlaid.org/api/v2/assets/au6GRDfpigXuPhSfP27tVB/?format=json","date_modified":"2021-07-29T15:37:05.706889Z","date_created":"2021-07-29T15:37:05.706865Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","summary":{},"owner__username":"api_user","parent":null,"uid":"au6GRDfpigXuPhSfP27tVB","tag_string":"","settings":{"sector":{"label":"Environment","value":"ENV"},"country":{"label":"Angola","value":"AGO"},"description":"description","share-metadata":false},"kind":"asset","name":"vcr_test_name","asset_type":"survey","version_id":"vpnhJ84vDvDDdTJSyuQUdF","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/au6GRDfpigXuPhSfP27tVB/permission-assignments/pdsha54vkHekqre7fxtu5z/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/?format=json","label":"Add + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/au6GRDfpigXuPhSfP27tVB/permission-assignments/pY4NXdkJVe9jb6Fh2SiBWS/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/?format=json","label":"Edit + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/au6GRDfpigXuPhSfP27tVB/permission-assignments/pjujpekzDPJBwxuEbzZym5/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/?format=json","label":"Edit + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/au6GRDfpigXuPhSfP27tVB/permission-assignments/pwiJtZDEEC7MW7874j8Gut/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/?format=json","label":"Delete + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/au6GRDfpigXuPhSfP27tVB/permission-assignments/pzi2dyMo4kyqycZv8YEurj/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/?format=json","label":"Manage + project"},{"url":"https://kobo.correlaid.org/api/v2/assets/au6GRDfpigXuPhSfP27tVB/permission-assignments/pGKbVv9ujGfddy5f2Joeq8/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/?format=json","label":"Validate + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/au6GRDfpigXuPhSfP27tVB/permission-assignments/pcX3YjaFdxbKCYxTLdakMS/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/?format=json","label":"View + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/au6GRDfpigXuPhSfP27tVB/permission-assignments/peeKWqEbtztQ7btSAMVRPu/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/?format=json","label":"View + submissions"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/au6GRDfpigXuPhSfP27tVB/?format=json.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/au6GRDfpigXuPhSfP27tVB/?format=json.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/au6GRDfpigXuPhSfP27tVB/data/?format=json"},{"url":"https://kobo.correlaid.org/api/v2/assets/a3MM3HBjDwt5HCV4S6mcLm/?format=json","date_modified":"2021-07-27T20:50:10.880601Z","date_created":"2021-07-27T20:50:10.880579Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","summary":{},"owner__username":"api_user","parent":null,"uid":"a3MM3HBjDwt5HCV4S6mcLm","tag_string":"","settings":{"sector":{"label":"Environment","value":"Env"},"country":{"label":"Angola","value":"ANG"},"description":"This + is the description. It is empty.","share-metadata":false},"kind":"asset","name":"test + malte 2021-07-28","asset_type":"survey","version_id":"vhcFs6QLH3VqtSFVh9qZ2y","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/a3MM3HBjDwt5HCV4S6mcLm/permission-assignments/ppWnTCTW7bkVBvuDrQxYnD/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/?format=json","label":"Add + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/a3MM3HBjDwt5HCV4S6mcLm/permission-assignments/pRGF5aYL5AjyenWJgvvXcc/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/?format=json","label":"Edit + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/a3MM3HBjDwt5HCV4S6mcLm/permission-assignments/pUzk63V8pjpBJSbRKB9DdL/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/?format=json","label":"Edit + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/a3MM3HBjDwt5HCV4S6mcLm/permission-assignments/pe3FS25xbzJyCDaB3TzqWw/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/?format=json","label":"Delete + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/a3MM3HBjDwt5HCV4S6mcLm/permission-assignments/pgM9SoEGhjViBV3tzitmok/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/?format=json","label":"Manage + project"},{"url":"https://kobo.correlaid.org/api/v2/assets/a3MM3HBjDwt5HCV4S6mcLm/permission-assignments/pfKebdYFMXacoqiMPfFtmz/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/?format=json","label":"Validate + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/a3MM3HBjDwt5HCV4S6mcLm/permission-assignments/puVyuAW2Bg5sDxQcBJE4hy/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/?format=json","label":"View + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/a3MM3HBjDwt5HCV4S6mcLm/permission-assignments/pL7gweVNSKRb4ZKybCJqT6/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/?format=json","label":"View + submissions"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/a3MM3HBjDwt5HCV4S6mcLm/?format=json.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/a3MM3HBjDwt5HCV4S6mcLm/?format=json.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/a3MM3HBjDwt5HCV4S6mcLm/data/?format=json"},{"url":"https://kobo.correlaid.org/api/v2/assets/aUSuJppKGV2Eu3RLSh9JyS/?format=json","date_modified":"2021-07-26T23:52:31.417056Z","date_created":"2021-07-26T23:52:31.417033Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","summary":{},"owner__username":"api_user","parent":null,"uid":"aUSuJppKGV2Eu3RLSh9JyS","tag_string":"","settings":{"sector":"Angola","country":{"label":"Angola","value":"ANG"},"description":"This + is the description. It is empty.","share-metadata":false},"kind":"asset","name":"test + malte 2021-07-27","asset_type":"survey","version_id":"vjYyWGHRY8QgBEbahmdzav","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/aUSuJppKGV2Eu3RLSh9JyS/permission-assignments/pzPwK8zCmXfWrgNxhSHFwf/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/?format=json","label":"Add + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aUSuJppKGV2Eu3RLSh9JyS/permission-assignments/pnBFjkGuWUJsLsXZM5w8op/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/?format=json","label":"Edit + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aUSuJppKGV2Eu3RLSh9JyS/permission-assignments/pAWkWJVJpw7gdAzH4NdqnS/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/?format=json","label":"Edit + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aUSuJppKGV2Eu3RLSh9JyS/permission-assignments/ptFJrnpCq9naZN4K5dm8sm/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/?format=json","label":"Delete + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aUSuJppKGV2Eu3RLSh9JyS/permission-assignments/pNkuUdUCg4BuJ7QkhiCZvb/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/?format=json","label":"Manage + project"},{"url":"https://kobo.correlaid.org/api/v2/assets/aUSuJppKGV2Eu3RLSh9JyS/permission-assignments/pQ8PVAek9qf9mu5odQWvUq/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/?format=json","label":"Validate + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aUSuJppKGV2Eu3RLSh9JyS/permission-assignments/pX45SGuGrDuotPFrSkpCLL/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/?format=json","label":"View + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aUSuJppKGV2Eu3RLSh9JyS/permission-assignments/p8RBC4WVaHpRPff42cptQG/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/?format=json","label":"View + submissions"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/aUSuJppKGV2Eu3RLSh9JyS/?format=json.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/aUSuJppKGV2Eu3RLSh9JyS/?format=json.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/aUSuJppKGV2Eu3RLSh9JyS/data/?format=json"},{"url":"https://kobo.correlaid.org/api/v2/assets/aCZdBwzfyoX2AMDB5a9ADE/?format=json","date_modified":"2021-07-26T23:52:24.806614Z","date_created":"2021-07-26T23:52:24.806590Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","summary":{},"owner__username":"api_user","parent":null,"uid":"aCZdBwzfyoX2AMDB5a9ADE","tag_string":"","settings":{"sector":"Angola","country":{"label":"Angola","value":"ANG"},"description":"This + is the description. It is empty.","share-metadata":false},"kind":"asset","name":"test + malte 2021-07-27","asset_type":"survey","version_id":"vJNWfsg3kJ7Fks3RctDwvU","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/aCZdBwzfyoX2AMDB5a9ADE/permission-assignments/pHPkCoA8p8sE5Qw4ZVA7c5/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/?format=json","label":"Add + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aCZdBwzfyoX2AMDB5a9ADE/permission-assignments/pw7wSM8HYKwq6H3LCNHqQu/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/?format=json","label":"Edit + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aCZdBwzfyoX2AMDB5a9ADE/permission-assignments/pKWHkwHfXfCxtVVDHMsqmB/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/?format=json","label":"Edit + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aCZdBwzfyoX2AMDB5a9ADE/permission-assignments/pkYirwM4kBBf2B3APRQ5mj/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/?format=json","label":"Delete + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aCZdBwzfyoX2AMDB5a9ADE/permission-assignments/pY2AJuZvPE88RDVegdW7US/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/?format=json","label":"Manage + project"},{"url":"https://kobo.correlaid.org/api/v2/assets/aCZdBwzfyoX2AMDB5a9ADE/permission-assignments/p83gvRqxoVDLZ3HXZqDRNh/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/?format=json","label":"Validate + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aCZdBwzfyoX2AMDB5a9ADE/permission-assignments/pwoRcRpFNxesR9isg8pMBw/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/?format=json","label":"View + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aCZdBwzfyoX2AMDB5a9ADE/permission-assignments/prm3pgxJVQSRL86KSCpj2Y/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/?format=json","label":"View + submissions"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/aCZdBwzfyoX2AMDB5a9ADE/?format=json.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/aCZdBwzfyoX2AMDB5a9ADE/?format=json.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/aCZdBwzfyoX2AMDB5a9ADE/data/?format=json"},{"url":"https://kobo.correlaid.org/api/v2/assets/aT45DAwesB5Cs23nQPpgfz/?format=json","date_modified":"2021-07-26T23:52:04.851988Z","date_created":"2021-07-26T23:52:04.851961Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","summary":{},"owner__username":"api_user","parent":null,"uid":"aT45DAwesB5Cs23nQPpgfz","tag_string":"","settings":{"sector":"Angola","country":{"label":"Angola","value":"ANG"},"description":"This + is the description. It is empty.","share-metadata":false},"kind":"asset","name":"test + malte 2021-07-27","asset_type":"survey","version_id":"vAg3CmFogP4csdJ84MGDPn","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/aT45DAwesB5Cs23nQPpgfz/permission-assignments/pkFmSJ2RoNVKSRoZQTSvER/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/?format=json","label":"Add + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aT45DAwesB5Cs23nQPpgfz/permission-assignments/pRFtCiSXJTNfLL4LUfQJBF/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/?format=json","label":"Edit + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aT45DAwesB5Cs23nQPpgfz/permission-assignments/pj26hkbdysWgFLDye8qrkS/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/?format=json","label":"Edit + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aT45DAwesB5Cs23nQPpgfz/permission-assignments/pcxdKyhdtpBoZshrFcxBuh/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/?format=json","label":"Delete + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aT45DAwesB5Cs23nQPpgfz/permission-assignments/pQ5c7tWBMU4VVBkM4WobyL/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/?format=json","label":"Manage + project"},{"url":"https://kobo.correlaid.org/api/v2/assets/aT45DAwesB5Cs23nQPpgfz/permission-assignments/pGw7V3nJA8Q5LxX6AYkwZv/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/?format=json","label":"Validate + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aT45DAwesB5Cs23nQPpgfz/permission-assignments/p4crgi7iMshnAPD45naoCa/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/?format=json","label":"View + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aT45DAwesB5Cs23nQPpgfz/permission-assignments/pQA2pKNkRbfNWxSktkD9k7/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/?format=json","label":"View + submissions"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/aT45DAwesB5Cs23nQPpgfz/?format=json.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/aT45DAwesB5Cs23nQPpgfz/?format=json.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/aT45DAwesB5Cs23nQPpgfz/data/?format=json"},{"url":"https://kobo.correlaid.org/api/v2/assets/aQXHg5sgvpjG9GrJkVjz4Q/?format=json","date_modified":"2021-07-26T23:33:16.264227Z","date_created":"2021-07-26T23:33:16.264202Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","summary":{},"owner__username":"api_user","parent":null,"uid":"aQXHg5sgvpjG9GrJkVjz4Q","tag_string":"","settings":{"sector":{"label":"Environment","value":"Env"},"country":{"label":"Angola","value":"ANG"},"description":"This + is the description. It is empty.","share-metadata":false},"kind":"asset","name":"test + malte 2021-07-27","asset_type":"survey","version_id":"v89uFmcsKf2TEXMi44biF9","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/aQXHg5sgvpjG9GrJkVjz4Q/permission-assignments/pzWxHs7g69py8bTaa62rqA/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/?format=json","label":"Add + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aQXHg5sgvpjG9GrJkVjz4Q/permission-assignments/pqnhX9fSnYTWcwKCeHtXgD/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/?format=json","label":"Edit + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aQXHg5sgvpjG9GrJkVjz4Q/permission-assignments/piQpaAuQG9EhtbV4AVSWD4/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/?format=json","label":"Edit + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aQXHg5sgvpjG9GrJkVjz4Q/permission-assignments/p3hXpypAGjmSY7M6TAE9ov/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/?format=json","label":"Delete + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aQXHg5sgvpjG9GrJkVjz4Q/permission-assignments/prc45RYDVn27fsUpzQSDsw/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/?format=json","label":"Manage + project"},{"url":"https://kobo.correlaid.org/api/v2/assets/aQXHg5sgvpjG9GrJkVjz4Q/permission-assignments/pmZBJQVpAx2gStJMyJcS22/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/?format=json","label":"Validate + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aQXHg5sgvpjG9GrJkVjz4Q/permission-assignments/pigqacMYEmwynKyvQVqAyJ/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/?format=json","label":"View + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aQXHg5sgvpjG9GrJkVjz4Q/permission-assignments/pBxFvVNqQamduN9FBBkTjG/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/?format=json","label":"View + submissions"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/aQXHg5sgvpjG9GrJkVjz4Q/?format=json.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/aQXHg5sgvpjG9GrJkVjz4Q/?format=json.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/aQXHg5sgvpjG9GrJkVjz4Q/data/?format=json"},{"url":"https://kobo.correlaid.org/api/v2/assets/aSoX2fGyQ7GMFhYvfTyFJB/?format=json","date_modified":"2021-07-26T23:14:11.412827Z","date_created":"2021-07-26T23:14:11.412803Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","summary":{},"owner__username":"api_user","parent":null,"uid":"aSoX2fGyQ7GMFhYvfTyFJB","tag_string":"","settings":{"sector":"Environment","country":"Angola","description":"This + is the description. It is empty.","share-metadata":false},"kind":"asset","name":"test + malte 2021-07-27","asset_type":"survey","version_id":"vJ4iF9nvBFvDPBowXxCgxr","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/aSoX2fGyQ7GMFhYvfTyFJB/permission-assignments/p7S7CyHV7CRWTxheve2g3y/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/?format=json","label":"Add + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aSoX2fGyQ7GMFhYvfTyFJB/permission-assignments/pF4ntU7N2JX6teS5pBAZxu/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/?format=json","label":"Edit + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aSoX2fGyQ7GMFhYvfTyFJB/permission-assignments/pExXVwmSFRJzLw8HdcMgSm/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/?format=json","label":"Edit + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aSoX2fGyQ7GMFhYvfTyFJB/permission-assignments/p4KjEHzxLFKrmARJd2ffDJ/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/?format=json","label":"Delete + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aSoX2fGyQ7GMFhYvfTyFJB/permission-assignments/pmneLPgkwcnMt3VGjwbtB9/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/?format=json","label":"Manage + project"},{"url":"https://kobo.correlaid.org/api/v2/assets/aSoX2fGyQ7GMFhYvfTyFJB/permission-assignments/pxzvzZEdQnumSAVQDh2knJ/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/?format=json","label":"Validate + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aSoX2fGyQ7GMFhYvfTyFJB/permission-assignments/pRRh8s9VUPedozPfbc5yWV/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/?format=json","label":"View + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aSoX2fGyQ7GMFhYvfTyFJB/permission-assignments/p8Z9TBmQD6EVFQNg5NxoH6/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/?format=json","label":"View + submissions"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/aSoX2fGyQ7GMFhYvfTyFJB/?format=json.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/aSoX2fGyQ7GMFhYvfTyFJB/?format=json.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/aSoX2fGyQ7GMFhYvfTyFJB/data/?format=json"},{"url":"https://kobo.correlaid.org/api/v2/assets/apxYrm7i4mGc3Wxqu2eZ2r/?format=json","date_modified":"2021-07-12T20:11:25.852606Z","date_created":"2021-07-12T20:11:25.852585Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","summary":{},"owner__username":"api_user","parent":null,"uid":"apxYrm7i4mGc3Wxqu2eZ2r","tag_string":"","settings":{"sector":"Environment","country":"Angola","description":"description","share-metadata":"false"},"kind":"asset","name":"test + create block, with settings provided as parameters","asset_type":"block","version_id":"vfSHxcWLJfhG4JknBJHzCj","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/apxYrm7i4mGc3Wxqu2eZ2r/permission-assignments/psvGSqLLw4KivCL6RTaU4J/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/?format=json","label":"Edit + block"},{"url":"https://kobo.correlaid.org/api/v2/assets/apxYrm7i4mGc3Wxqu2eZ2r/permission-assignments/pLVrYUPVn4z9cNSHUUXtvs/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/?format=json","label":"Manage + block"},{"url":"https://kobo.correlaid.org/api/v2/assets/apxYrm7i4mGc3Wxqu2eZ2r/permission-assignments/pEmvTvUK9Xqj4U9vm7H8yy/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/?format=json","label":"View + block"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/apxYrm7i4mGc3Wxqu2eZ2r/?format=json.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/apxYrm7i4mGc3Wxqu2eZ2r/?format=json.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/apxYrm7i4mGc3Wxqu2eZ2r/data/?format=json"},{"url":"https://kobo.correlaid.org/api/v2/assets/adSrSMHEgmMGPmkvBEsF4v/?format=json","date_modified":"2021-07-12T20:11:02.359988Z","date_created":"2021-07-12T20:11:02.359966Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","summary":{},"owner__username":"api_user","parent":null,"uid":"adSrSMHEgmMGPmkvBEsF4v","tag_string":"","settings":{"sector":"Environment","country":"Angola","description":"description","share-metadata":"false"},"kind":"asset","name":"test + create template, with settings provided as parameters","asset_type":"template","version_id":"vRaB3oiXrgYFSS2dkAJf9T","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/adSrSMHEgmMGPmkvBEsF4v/permission-assignments/p8rWb6vG5fKRVQ5rWdWBz5/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/?format=json","label":"Edit + template"},{"url":"https://kobo.correlaid.org/api/v2/assets/adSrSMHEgmMGPmkvBEsF4v/permission-assignments/pTmt86PhPczLszeP258nK2/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/?format=json","label":"Manage + template"},{"url":"https://kobo.correlaid.org/api/v2/assets/adSrSMHEgmMGPmkvBEsF4v/permission-assignments/pReeCKTCr4TRLQTfpr5Q4o/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/?format=json","label":"View + template"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/adSrSMHEgmMGPmkvBEsF4v/?format=json.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/adSrSMHEgmMGPmkvBEsF4v/?format=json.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/adSrSMHEgmMGPmkvBEsF4v/data/?format=json"},{"url":"https://kobo.correlaid.org/api/v2/assets/aAhwQitVwHSrgfDjTwum8F/?format=json","date_modified":"2021-07-12T20:09:50.930976Z","date_created":"2021-07-12T20:09:50.930952Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","summary":{},"owner__username":"api_user","parent":null,"uid":"aAhwQitVwHSrgfDjTwum8F","tag_string":"","settings":{"sector":"","country":"","description":"","share-metadata":"false"},"kind":"asset","name":"test + create question, no settings","asset_type":"question","version_id":"v45TfPq9bQiYDpTNoNaurj","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/aAhwQitVwHSrgfDjTwum8F/permission-assignments/pgTxpiCBGQXX39o99RLhpb/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/?format=json","label":"Edit + question"},{"url":"https://kobo.correlaid.org/api/v2/assets/aAhwQitVwHSrgfDjTwum8F/permission-assignments/pCcNDNpjCivTJr6MJnhih4/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/?format=json","label":"Manage + question"},{"url":"https://kobo.correlaid.org/api/v2/assets/aAhwQitVwHSrgfDjTwum8F/permission-assignments/p5NBQ97SL7NFQiX3mx47mg/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/?format=json","label":"View + question"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/aAhwQitVwHSrgfDjTwum8F/?format=json.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/aAhwQitVwHSrgfDjTwum8F/?format=json.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/aAhwQitVwHSrgfDjTwum8F/data/?format=json"},{"url":"https://kobo.correlaid.org/api/v2/assets/a32dXjFvRR33Xii6Z5BXkA/?format=json","date_modified":"2021-07-12T20:09:45.089580Z","date_created":"2021-07-12T20:09:45.089561Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","summary":{},"owner__username":"api_user","parent":null,"uid":"a32dXjFvRR33Xii6Z5BXkA","tag_string":"","settings":{"sector":"","country":"","description":"","share-metadata":"false"},"kind":"asset","name":"test + create template, no settings","asset_type":"template","version_id":"vpPMmDUEYcG29RurTrrSoZ","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/a32dXjFvRR33Xii6Z5BXkA/permission-assignments/pWAFps2kcUGk8cFgGCEvwC/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/?format=json","label":"Edit + template"},{"url":"https://kobo.correlaid.org/api/v2/assets/a32dXjFvRR33Xii6Z5BXkA/permission-assignments/p5hsgwtdQGfKt6gCnR6LwS/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/?format=json","label":"Manage + template"},{"url":"https://kobo.correlaid.org/api/v2/assets/a32dXjFvRR33Xii6Z5BXkA/permission-assignments/pWwsUZbh4pZDZDSSESXYyA/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/?format=json","label":"View + template"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/a32dXjFvRR33Xii6Z5BXkA/?format=json.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/a32dXjFvRR33Xii6Z5BXkA/?format=json.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/a32dXjFvRR33Xii6Z5BXkA/data/?format=json"},{"url":"https://kobo.correlaid.org/api/v2/assets/azXhPczgcenp9rVcgzfVcM/?format=json","date_modified":"2021-07-12T20:09:35.194826Z","date_created":"2021-07-12T20:09:35.194801Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","summary":{},"owner__username":"api_user","parent":null,"uid":"azXhPczgcenp9rVcgzfVcM","tag_string":"","settings":{"sector":"","country":"","description":"","share-metadata":"false"},"kind":"asset","name":"test + create block, no settings","asset_type":"block","version_id":"vYisDkcTg6w3wyBr9tP82h","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/azXhPczgcenp9rVcgzfVcM/permission-assignments/pkYwFeVoeNxTkRioQGeCH3/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/?format=json","label":"Edit + block"},{"url":"https://kobo.correlaid.org/api/v2/assets/azXhPczgcenp9rVcgzfVcM/permission-assignments/pP8PWUhTQKbiTMMGdrKP7g/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/?format=json","label":"Manage + block"},{"url":"https://kobo.correlaid.org/api/v2/assets/azXhPczgcenp9rVcgzfVcM/permission-assignments/piXPtpzmZM7QaW2GYqrMB9/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/?format=json","label":"View + block"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/azXhPczgcenp9rVcgzfVcM/?format=json.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/azXhPczgcenp9rVcgzfVcM/?format=json.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/azXhPczgcenp9rVcgzfVcM/data/?format=json"},{"url":"https://kobo.correlaid.org/api/v2/assets/aQUfpaSGHJpu7eqcUKf87U/?format=json","date_modified":"2021-07-12T20:02:00.378380Z","date_created":"2021-07-12T20:02:00.378350Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","summary":{},"owner__username":"api_user","parent":null,"uid":"aQUfpaSGHJpu7eqcUKf87U","tag_string":"","settings":{"sector":"Environment","country":"Angola","description":"description","share-metadata":"true"},"kind":"asset","name":"test + create survey, with settings provided as parameters","asset_type":"survey","version_id":"vcjfKYUfz2iH5YJ8AhjdT3","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/aQUfpaSGHJpu7eqcUKf87U/permission-assignments/pBKFRho5xK5d8GSrQ5Rqtt/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/?format=json","label":"Add + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aQUfpaSGHJpu7eqcUKf87U/permission-assignments/pDeuGwVWdAbcasBbWZ58QZ/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/?format=json","label":"Edit + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aQUfpaSGHJpu7eqcUKf87U/permission-assignments/pFC524ac9YgFPnHXLvn4cH/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/?format=json","label":"Edit + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aQUfpaSGHJpu7eqcUKf87U/permission-assignments/pwhwh6zcqsjvUpuL3wJZAa/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/?format=json","label":"Delete + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aQUfpaSGHJpu7eqcUKf87U/permission-assignments/pTu2uVbKN5wjcHSEdyC4hh/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/?format=json","label":"Manage + project"},{"url":"https://kobo.correlaid.org/api/v2/assets/aQUfpaSGHJpu7eqcUKf87U/permission-assignments/pYKvh97ybuYBLjbBzzbnCE/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/?format=json","label":"Validate + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aQUfpaSGHJpu7eqcUKf87U/permission-assignments/pX85zxkWiSHk43iZgZEAuy/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/?format=json","label":"View + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aQUfpaSGHJpu7eqcUKf87U/permission-assignments/pZgGnejThdtoobEdfuie2n/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/?format=json","label":"View + submissions"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/aQUfpaSGHJpu7eqcUKf87U/?format=json.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/aQUfpaSGHJpu7eqcUKf87U/?format=json.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/aQUfpaSGHJpu7eqcUKf87U/data/?format=json"},{"url":"https://kobo.correlaid.org/api/v2/assets/aGYDjmTk39HHCmFhLduGGQ/?format=json","date_modified":"2021-07-12T19:38:15.967467Z","date_created":"2021-07-12T19:38:15.967445Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","summary":{},"owner__username":"api_user","parent":null,"uid":"aGYDjmTk39HHCmFhLduGGQ","tag_string":"","settings":{},"kind":"asset","name":"test + create question, no settings","asset_type":"question","version_id":"vbNhkosv8fH9vebx9aBPiQ","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/aGYDjmTk39HHCmFhLduGGQ/permission-assignments/pTXzmBBCFioiCvTmqWZMqr/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/?format=json","label":"Edit + question"},{"url":"https://kobo.correlaid.org/api/v2/assets/aGYDjmTk39HHCmFhLduGGQ/permission-assignments/pqncbKp8BguEh28txG8DJX/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/?format=json","label":"Manage + question"},{"url":"https://kobo.correlaid.org/api/v2/assets/aGYDjmTk39HHCmFhLduGGQ/permission-assignments/pP53HSGZvgrFtieUhS2TVx/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/?format=json","label":"View + question"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/aGYDjmTk39HHCmFhLduGGQ/?format=json.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/aGYDjmTk39HHCmFhLduGGQ/?format=json.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/aGYDjmTk39HHCmFhLduGGQ/data/?format=json"},{"url":"https://kobo.correlaid.org/api/v2/assets/a4MPenUthsYVNGxWE6GxNH/?format=json","date_modified":"2021-07-12T19:36:36.364317Z","date_created":"2021-07-12T19:36:36.364294Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","summary":{},"owner__username":"api_user","parent":null,"uid":"a4MPenUthsYVNGxWE6GxNH","tag_string":"","settings":{},"kind":"asset","name":"test + create survey, no settings","asset_type":"survey","version_id":"v2fW5Nx4YB9G2PLHvBiksZ","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/a4MPenUthsYVNGxWE6GxNH/permission-assignments/pUHHc8W2jRph9AnJWbBjC7/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/?format=json","label":"Add + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/a4MPenUthsYVNGxWE6GxNH/permission-assignments/pCdB2u4CEjgGNgQGNmuWVL/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/?format=json","label":"Edit + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/a4MPenUthsYVNGxWE6GxNH/permission-assignments/pKMdyqmomA2EGLzstB3KrH/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/?format=json","label":"Edit + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/a4MPenUthsYVNGxWE6GxNH/permission-assignments/pxAJRBong9n9eszvjokCWG/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/?format=json","label":"Delete + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/a4MPenUthsYVNGxWE6GxNH/permission-assignments/pnJME2Ts9uBS327u8yeR4T/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/?format=json","label":"Manage + project"},{"url":"https://kobo.correlaid.org/api/v2/assets/a4MPenUthsYVNGxWE6GxNH/permission-assignments/pdtzbLZcfikuaCUKmKVh6n/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/?format=json","label":"Validate + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/a4MPenUthsYVNGxWE6GxNH/permission-assignments/pcyAQanSM6ksJQzWugvHir/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/?format=json","label":"View + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/a4MPenUthsYVNGxWE6GxNH/permission-assignments/pWuMi6mbDh4NGddazWX4dQ/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/?format=json","label":"View + submissions"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/a4MPenUthsYVNGxWE6GxNH/?format=json.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/a4MPenUthsYVNGxWE6GxNH/?format=json.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/a4MPenUthsYVNGxWE6GxNH/data/?format=json"},{"url":"https://kobo.correlaid.org/api/v2/assets/a6pUSXYgQh2dde8atN88pA/?format=json","date_modified":"2021-07-06T20:12:48.277597Z","date_created":"2021-07-06T20:12:48.277573Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","summary":{"geo":true,"labels":["Please + say, for each of the following, how important it is in your life.","Work","Family","Friends + and acquaintances","Leisure time"],"columns":["name","type","appearance","label","select_from_list_name","required","hint","parameters","calculation"],"languages":[null],"row_count":24,"default_translation":null},"owner__username":"api_user","parent":null,"uid":"a6pUSXYgQh2dde8atN88pA","tag_string":"","settings":{},"kind":"asset","name":"vcr_test_name","asset_type":"survey","version_id":"vroBzYagYxWzxtLtmaCxiN","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/a6pUSXYgQh2dde8atN88pA/permission-assignments/pAnzX4VU9yxFeLEqTdagJX/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/?format=json","label":"Add + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/a6pUSXYgQh2dde8atN88pA/permission-assignments/p7HUzDYfNM3tL7k6PUFLUm/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/?format=json","label":"Edit + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/a6pUSXYgQh2dde8atN88pA/permission-assignments/p8HN9mpgsdE68xyN2DovZ7/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/?format=json","label":"Edit + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/a6pUSXYgQh2dde8atN88pA/permission-assignments/ppjvFdok8ZN4GEYLDDhUFY/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/?format=json","label":"Delete + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/a6pUSXYgQh2dde8atN88pA/permission-assignments/pCDEvuzZLv3ePafjcsbbEQ/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/?format=json","label":"Manage + project"},{"url":"https://kobo.correlaid.org/api/v2/assets/a6pUSXYgQh2dde8atN88pA/permission-assignments/p96QLm3otvv5vmzUxCa6Vj/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/?format=json","label":"Validate + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/a6pUSXYgQh2dde8atN88pA/permission-assignments/pMyYGaJxDQ9WoiHenH3JGD/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/?format=json","label":"View + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/a6pUSXYgQh2dde8atN88pA/permission-assignments/pJuhpnuiNUixmXqnmJQM3c/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/?format=json","label":"View + submissions"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/a6pUSXYgQh2dde8atN88pA/?format=json.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/a6pUSXYgQh2dde8atN88pA/?format=json.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/a6pUSXYgQh2dde8atN88pA/data/?format=json"},{"url":"https://kobo.correlaid.org/api/v2/assets/awA4Keq8WHBqU6yaihMmUB/?format=json","date_modified":"2021-07-06T19:55:15.055137Z","date_created":"2021-07-06T19:55:15.055115Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","summary":{"geo":true,"labels":["Please + say, for each of the following, how important it is in your life.","Work","Family","Friends + and acquaintances","Leisure time"],"columns":["name","type","appearance","label","select_from_list_name","required","hint","parameters","calculation"],"languages":[null],"row_count":24,"default_translation":null},"owner__username":"api_user","parent":null,"uid":"awA4Keq8WHBqU6yaihMmUB","tag_string":"","settings":{},"kind":"asset","name":"test + clone survey to survey","asset_type":"survey","version_id":"vtiMb27PnXzd8NBtYDbtUW","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/awA4Keq8WHBqU6yaihMmUB/permission-assignments/pwx6Btyx8KvZQNzdYjKTiz/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/?format=json","label":"Add + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/awA4Keq8WHBqU6yaihMmUB/permission-assignments/pP8Eoq4pGzCbhs3XibQSKY/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/?format=json","label":"Edit + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/awA4Keq8WHBqU6yaihMmUB/permission-assignments/pATSUy6tSaESMo6yyoVMkv/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/?format=json","label":"Edit + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/awA4Keq8WHBqU6yaihMmUB/permission-assignments/ppd8P9QfsEw6NawYfeafYV/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/?format=json","label":"Delete + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/awA4Keq8WHBqU6yaihMmUB/permission-assignments/puYnKuPrFzzPtuC6XvqXZQ/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/?format=json","label":"Manage + project"},{"url":"https://kobo.correlaid.org/api/v2/assets/awA4Keq8WHBqU6yaihMmUB/permission-assignments/pk4H3RCJRsx9yLPh4Z87zX/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/?format=json","label":"Validate + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/awA4Keq8WHBqU6yaihMmUB/permission-assignments/pJwaXnv73TUpzgVbkAmkNw/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/?format=json","label":"View + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/awA4Keq8WHBqU6yaihMmUB/permission-assignments/pStzbApKSHxbskmQyDr8Fc/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/?format=json","label":"View + submissions"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/awA4Keq8WHBqU6yaihMmUB/?format=json.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/awA4Keq8WHBqU6yaihMmUB/?format=json.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/awA4Keq8WHBqU6yaihMmUB/data/?format=json"},{"url":"https://kobo.correlaid.org/api/v2/assets/aLRy4TPnB4W4a45NyZUaio/?format=json","date_modified":"2021-07-06T19:31:22.114628Z","date_created":"2021-07-06T19:31:22.114606Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","summary":{"geo":true,"labels":["Please + say, for each of the following, how important it is in your life.","Work","Family","Friends + and acquaintances","Leisure time"],"columns":["name","type","appearance","label","select_from_list_name","required","hint","parameters","calculation"],"languages":[null],"row_count":24,"default_translation":null},"owner__username":"api_user","parent":null,"uid":"aLRy4TPnB4W4a45NyZUaio","tag_string":"","settings":{},"kind":"asset","name":"clone + template to template","asset_type":"template","version_id":"vUuMeaxA5j7b67XayN5Hq2","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/aLRy4TPnB4W4a45NyZUaio/permission-assignments/pwJ6o799ArxgJFZSsADQsi/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/?format=json","label":"Edit + template"},{"url":"https://kobo.correlaid.org/api/v2/assets/aLRy4TPnB4W4a45NyZUaio/permission-assignments/p39nPVQoj5fYMXQHifEvef/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/?format=json","label":"Manage + template"},{"url":"https://kobo.correlaid.org/api/v2/assets/aLRy4TPnB4W4a45NyZUaio/permission-assignments/pQbz3A5F5Kg8LaCK9Q7nTB/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/?format=json","label":"View + template"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/aLRy4TPnB4W4a45NyZUaio/?format=json.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/aLRy4TPnB4W4a45NyZUaio/?format=json.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/aLRy4TPnB4W4a45NyZUaio/data/?format=json"},{"url":"https://kobo.correlaid.org/api/v2/assets/afxiQ8KYXe5tGrqyFgrFQP/?format=json","date_modified":"2021-07-06T19:31:11.438968Z","date_created":"2021-07-06T19:31:11.438942Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","summary":{"geo":true,"labels":["Please + say, for each of the following, how important it is in your life.","Work","Family","Friends + and acquaintances","Leisure time"],"columns":["name","type","appearance","label","select_from_list_name","required","hint","parameters","calculation"],"languages":[null],"row_count":24,"default_translation":null},"owner__username":"api_user","parent":null,"uid":"afxiQ8KYXe5tGrqyFgrFQP","tag_string":"","settings":{},"kind":"asset","name":"clone + template to survey","asset_type":"survey","version_id":"vtM6v4ugDiu8whJzX3f7tG","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/afxiQ8KYXe5tGrqyFgrFQP/permission-assignments/pMSAZXrxCLrq29CfCj9YvX/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/?format=json","label":"Add + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/afxiQ8KYXe5tGrqyFgrFQP/permission-assignments/pxJpwBh3KNe6Y85QrETA9q/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/?format=json","label":"Edit + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/afxiQ8KYXe5tGrqyFgrFQP/permission-assignments/peEeQByKxpPQkmPjYWUG4d/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/?format=json","label":"Edit + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/afxiQ8KYXe5tGrqyFgrFQP/permission-assignments/pEpiqqLZmZqhEVv9RWRKAU/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/?format=json","label":"Delete + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/afxiQ8KYXe5tGrqyFgrFQP/permission-assignments/pzofojQreLm6mftec2UGTu/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/?format=json","label":"Manage + project"},{"url":"https://kobo.correlaid.org/api/v2/assets/afxiQ8KYXe5tGrqyFgrFQP/permission-assignments/pExPEDkvvkVSbaCHvJnrvu/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/?format=json","label":"Validate + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/afxiQ8KYXe5tGrqyFgrFQP/permission-assignments/pL4Tj8tqk5xnsTKv7dcJzJ/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/?format=json","label":"View + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/afxiQ8KYXe5tGrqyFgrFQP/permission-assignments/px2m3J7Yo7EQG3iNQJvRT9/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/?format=json","label":"View + submissions"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/afxiQ8KYXe5tGrqyFgrFQP/?format=json.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/afxiQ8KYXe5tGrqyFgrFQP/?format=json.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/afxiQ8KYXe5tGrqyFgrFQP/data/?format=json"},{"url":"https://kobo.correlaid.org/api/v2/assets/aEemw2UYBCre5kntYokigx/?format=json","date_modified":"2021-07-06T19:29:41.743383Z","date_created":"2021-07-06T19:29:41.743359Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","summary":{"geo":false,"labels":["what + is your age?"],"columns":["hint","name","type","label","required","constraint"],"languages":[null],"row_count":1,"default_translation":null},"owner__username":"api_user","parent":null,"uid":"aEemw2UYBCre5kntYokigx","tag_string":"","settings":{},"kind":"asset","name":"clone + question to template","asset_type":"template","version_id":"vwNL9ovQicg3Ab5j26ncCJ","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/aEemw2UYBCre5kntYokigx/permission-assignments/pFfGisfeRoYJpL9oj8qU3m/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/?format=json","label":"Edit + template"},{"url":"https://kobo.correlaid.org/api/v2/assets/aEemw2UYBCre5kntYokigx/permission-assignments/pvfaoBDRFHaY4R8HxxZaqT/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/?format=json","label":"Manage + template"},{"url":"https://kobo.correlaid.org/api/v2/assets/aEemw2UYBCre5kntYokigx/permission-assignments/pTJHgsphDTb37T2vymSAjt/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/?format=json","label":"View + template"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/aEemw2UYBCre5kntYokigx/?format=json.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/aEemw2UYBCre5kntYokigx/?format=json.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/aEemw2UYBCre5kntYokigx/data/?format=json"},{"url":"https://kobo.correlaid.org/api/v2/assets/aQn6StozWHdzt8WAUwTq7j/?format=json","date_modified":"2021-07-06T19:29:14.301252Z","date_created":"2021-07-06T19:29:14.301229Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","summary":{"geo":false,"labels":["what + is your age?"],"columns":["hint","name","type","label","required","constraint"],"languages":[null],"row_count":1,"default_translation":null},"owner__username":"api_user","parent":null,"uid":"aQn6StozWHdzt8WAUwTq7j","tag_string":"","settings":{},"kind":"asset","name":"clone + question to survey","asset_type":"survey","version_id":"vgESBhxnAdfKrwwn8HntGX","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/aQn6StozWHdzt8WAUwTq7j/permission-assignments/pzQoyYS6QLaVdqLcD28Tdi/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/?format=json","label":"Add + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aQn6StozWHdzt8WAUwTq7j/permission-assignments/pRFmuSv5ofDrJibFR8iowJ/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/?format=json","label":"Edit + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aQn6StozWHdzt8WAUwTq7j/permission-assignments/poSDTo6bZZTXWj9ZZ3Rbgh/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/?format=json","label":"Edit + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aQn6StozWHdzt8WAUwTq7j/permission-assignments/pgirKGyyxNySa5e3TBEkRx/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/?format=json","label":"Delete + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aQn6StozWHdzt8WAUwTq7j/permission-assignments/pP7ND6iW6kjahXtwBijmuz/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/?format=json","label":"Manage + project"},{"url":"https://kobo.correlaid.org/api/v2/assets/aQn6StozWHdzt8WAUwTq7j/permission-assignments/pMyYXrMHRaW4wFePpAF6d4/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/?format=json","label":"Validate + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aQn6StozWHdzt8WAUwTq7j/permission-assignments/pdNv59hbWdDah3arX88TYb/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/?format=json","label":"View + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aQn6StozWHdzt8WAUwTq7j/permission-assignments/pBTkn8kUPyv2ZSzhFBCPUs/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/?format=json","label":"View + submissions"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/aQn6StozWHdzt8WAUwTq7j/?format=json.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/aQn6StozWHdzt8WAUwTq7j/?format=json.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/aQn6StozWHdzt8WAUwTq7j/data/?format=json"},{"url":"https://kobo.correlaid.org/api/v2/assets/akugPPogXsuXhXeWo3L3Nm/?format=json","date_modified":"2021-07-06T19:28:54.302821Z","date_created":"2021-07-06T19:28:54.302800Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","summary":{"geo":false,"labels":["what + is your age?"],"columns":["hint","name","type","label","required","constraint"],"languages":[null],"row_count":1,"default_translation":null},"owner__username":"api_user","parent":null,"uid":"akugPPogXsuXhXeWo3L3Nm","tag_string":"","settings":{},"kind":"asset","name":"clone + question to question","asset_type":"question","version_id":"vU7xeeDd4LdJTDs8dtjuUU","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/akugPPogXsuXhXeWo3L3Nm/permission-assignments/pjAFMpjaHkSmHbJfoDdeMt/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/?format=json","label":"Edit + question"},{"url":"https://kobo.correlaid.org/api/v2/assets/akugPPogXsuXhXeWo3L3Nm/permission-assignments/pvtNviLsmj2uWQRjTW4BkJ/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/?format=json","label":"Manage + question"},{"url":"https://kobo.correlaid.org/api/v2/assets/akugPPogXsuXhXeWo3L3Nm/permission-assignments/pEY2Ko5tB9wt7juCjrcar6/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/?format=json","label":"View + question"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/akugPPogXsuXhXeWo3L3Nm/?format=json.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/akugPPogXsuXhXeWo3L3Nm/?format=json.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/akugPPogXsuXhXeWo3L3Nm/data/?format=json"},{"url":"https://kobo.correlaid.org/api/v2/assets/aCDL9G8bXN3j8ZseayUVsq/?format=json","date_modified":"2021-07-06T19:26:43.844788Z","date_created":"2021-07-06T19:26:43.844766Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","summary":{"geo":true,"labels":["Please + say, for each of the following, how important it is in your life.","Work","Family","Friends + and acquaintances","Leisure time"],"columns":["name","type","appearance","label","select_from_list_name","required","hint","parameters","calculation"],"languages":[null],"row_count":24,"default_translation":null},"owner__username":"api_user","parent":null,"uid":"aCDL9G8bXN3j8ZseayUVsq","tag_string":"","settings":{},"kind":"asset","name":"clone + block to template","asset_type":"template","version_id":"vEDiLr6eWa8asmEsnLptSb","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/aCDL9G8bXN3j8ZseayUVsq/permission-assignments/p9rcFRQ5qKMTQf6ay32bew/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/?format=json","label":"Edit + template"},{"url":"https://kobo.correlaid.org/api/v2/assets/aCDL9G8bXN3j8ZseayUVsq/permission-assignments/pxfVmH3tNfdUkiRJQgbjci/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/?format=json","label":"Manage + template"},{"url":"https://kobo.correlaid.org/api/v2/assets/aCDL9G8bXN3j8ZseayUVsq/permission-assignments/p5PUrrf2cNpeEd9WhuGgnL/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/?format=json","label":"View + template"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/aCDL9G8bXN3j8ZseayUVsq/?format=json.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/aCDL9G8bXN3j8ZseayUVsq/?format=json.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/aCDL9G8bXN3j8ZseayUVsq/data/?format=json"},{"url":"https://kobo.correlaid.org/api/v2/assets/avHH9SsT9Fen33zcPywbBH/?format=json","date_modified":"2021-07-06T19:26:15.361424Z","date_created":"2021-07-06T19:26:15.361400Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","summary":{"geo":true,"labels":["Please + say, for each of the following, how important it is in your life.","Work","Family","Friends + and acquaintances","Leisure time"],"columns":["name","type","appearance","label","select_from_list_name","required","hint","parameters","calculation"],"languages":[null],"row_count":24,"default_translation":null},"owner__username":"api_user","parent":null,"uid":"avHH9SsT9Fen33zcPywbBH","tag_string":"","settings":{},"kind":"asset","name":"clone + block to survey","asset_type":"survey","version_id":"vg9acyGjRqGH5hzj4PA5zq","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/avHH9SsT9Fen33zcPywbBH/permission-assignments/pbmAdpDsJetqQBQdVmA35B/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/?format=json","label":"Add + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/avHH9SsT9Fen33zcPywbBH/permission-assignments/prFm63mHiCbnArzxB4cxyE/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/?format=json","label":"Edit + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/avHH9SsT9Fen33zcPywbBH/permission-assignments/pYRPJSEF3REj9iYGQghQAg/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/?format=json","label":"Edit + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/avHH9SsT9Fen33zcPywbBH/permission-assignments/pvHe8BpeZk22TjpXWGypr2/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/?format=json","label":"Delete + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/avHH9SsT9Fen33zcPywbBH/permission-assignments/p9W5V9oyUWG6PR44sxKpw7/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/?format=json","label":"Manage + project"},{"url":"https://kobo.correlaid.org/api/v2/assets/avHH9SsT9Fen33zcPywbBH/permission-assignments/pxq8VHNbenbeUcEnjmUbkn/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/?format=json","label":"Validate + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/avHH9SsT9Fen33zcPywbBH/permission-assignments/pr9cueinxwu6uMW3VhCUZU/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/?format=json","label":"View + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/avHH9SsT9Fen33zcPywbBH/permission-assignments/pz5DgaPzLGdFxh4P8B2X5f/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/?format=json","label":"View + submissions"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/avHH9SsT9Fen33zcPywbBH/?format=json.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/avHH9SsT9Fen33zcPywbBH/?format=json.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/avHH9SsT9Fen33zcPywbBH/data/?format=json"},{"url":"https://kobo.correlaid.org/api/v2/assets/aLZFgjiwbcKNVWZn7KsQAt/?format=json","date_modified":"2021-07-06T19:25:25.146001Z","date_created":"2021-07-06T19:25:25.145977Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","summary":{"geo":true,"labels":["Please + say, for each of the following, how important it is in your life.","Work","Family","Friends + and acquaintances","Leisure time"],"columns":["name","type","appearance","label","select_from_list_name","required","hint","parameters","calculation"],"languages":[null],"row_count":24,"default_translation":null},"owner__username":"api_user","parent":null,"uid":"aLZFgjiwbcKNVWZn7KsQAt","tag_string":"","settings":{},"kind":"asset","name":"clone + block to question","asset_type":"block","version_id":"vFFQxoApnw3q2rq3Mz53xo","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/aLZFgjiwbcKNVWZn7KsQAt/permission-assignments/pmqu5RMm2VzH2t3NHKDUEp/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/?format=json","label":"Edit + block"},{"url":"https://kobo.correlaid.org/api/v2/assets/aLZFgjiwbcKNVWZn7KsQAt/permission-assignments/pE8p4XLn9HyxZ2xtwcMGvj/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/?format=json","label":"Manage + block"},{"url":"https://kobo.correlaid.org/api/v2/assets/aLZFgjiwbcKNVWZn7KsQAt/permission-assignments/pH35ctU2s52FeCHfLdfSD8/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/?format=json","label":"View + block"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/aLZFgjiwbcKNVWZn7KsQAt/?format=json.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/aLZFgjiwbcKNVWZn7KsQAt/?format=json.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/aLZFgjiwbcKNVWZn7KsQAt/data/?format=json"},{"url":"https://kobo.correlaid.org/api/v2/assets/aAssHeQyjKUF5GxmocAPNf/?format=json","date_modified":"2021-07-06T19:25:08.956989Z","date_created":"2021-07-06T19:25:08.956965Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","summary":{"geo":true,"labels":["Please + say, for each of the following, how important it is in your life.","Work","Family","Friends + and acquaintances","Leisure time"],"columns":["name","type","appearance","label","select_from_list_name","required","hint","parameters","calculation"],"languages":[null],"row_count":24,"default_translation":null},"owner__username":"api_user","parent":null,"uid":"aAssHeQyjKUF5GxmocAPNf","tag_string":"","settings":{},"kind":"asset","name":"clone + block to block","asset_type":"block","version_id":"vBtLG9vnhb2mYWVVSkDwke","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/aAssHeQyjKUF5GxmocAPNf/permission-assignments/pxrVszCDFEuUCEVYNunxZv/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/?format=json","label":"Edit + block"},{"url":"https://kobo.correlaid.org/api/v2/assets/aAssHeQyjKUF5GxmocAPNf/permission-assignments/pCCno2QzoH5qT9nnFxsGAr/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/?format=json","label":"Manage + block"},{"url":"https://kobo.correlaid.org/api/v2/assets/aAssHeQyjKUF5GxmocAPNf/permission-assignments/pGDj9KC9cFZeT2Ejzwkksb/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/?format=json","label":"View + block"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/aAssHeQyjKUF5GxmocAPNf/?format=json.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/aAssHeQyjKUF5GxmocAPNf/?format=json.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/aAssHeQyjKUF5GxmocAPNf/data/?format=json"},{"url":"https://kobo.correlaid.org/api/v2/assets/anxTvsL3xZd7CSvpt63qAd/?format=json","date_modified":"2021-07-06T19:15:35.670050Z","date_created":"2021-07-06T19:15:35.670026Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","summary":{"geo":true,"labels":["Please + say, for each of the following, how important it is in your life.","Work","Family","Friends + and acquaintances","Leisure time"],"columns":["name","type","appearance","label","select_from_list_name","required","hint","parameters","calculation"],"languages":[null],"row_count":24,"default_translation":null},"owner__username":"api_user","parent":null,"uid":"anxTvsL3xZd7CSvpt63qAd","tag_string":"","settings":{},"kind":"asset","name":"clone + survey to template","asset_type":"template","version_id":"vGabu9yzsWfe4YNKqVSnP2","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/anxTvsL3xZd7CSvpt63qAd/permission-assignments/pnjjJ6VkMf2D5rB9yEzkFF/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/?format=json","label":"Edit + template"},{"url":"https://kobo.correlaid.org/api/v2/assets/anxTvsL3xZd7CSvpt63qAd/permission-assignments/pEB4iLaZEw5hQSqsnaRbaT/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/?format=json","label":"Manage + template"},{"url":"https://kobo.correlaid.org/api/v2/assets/anxTvsL3xZd7CSvpt63qAd/permission-assignments/pHNMQ9ShMiRbUegCmLyGZ7/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/?format=json","label":"View + template"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/anxTvsL3xZd7CSvpt63qAd/?format=json.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/anxTvsL3xZd7CSvpt63qAd/?format=json.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/anxTvsL3xZd7CSvpt63qAd/data/?format=json"},{"url":"https://kobo.correlaid.org/api/v2/assets/aDMQ2rG8oJ5jmYxMeiHLob/?format=json","date_modified":"2021-07-06T19:14:57.419254Z","date_created":"2021-07-06T19:14:57.419233Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","summary":{"geo":true,"labels":["Please + say, for each of the following, how important it is in your life.","Work","Family","Friends + and acquaintances","Leisure time"],"columns":["name","type","appearance","label","select_from_list_name","required","hint","parameters","calculation"],"languages":[null],"row_count":24,"default_translation":null},"owner__username":"api_user","parent":null,"uid":"aDMQ2rG8oJ5jmYxMeiHLob","tag_string":"","settings":{},"kind":"asset","name":"clone + survey to question","asset_type":"block","version_id":"vLQ7u3iRWDmnmbrowH6W2W","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/aDMQ2rG8oJ5jmYxMeiHLob/permission-assignments/pTaV2PbbFsXUkC3R6kECGR/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/?format=json","label":"Edit + block"},{"url":"https://kobo.correlaid.org/api/v2/assets/aDMQ2rG8oJ5jmYxMeiHLob/permission-assignments/pZh8WPGpc3mpukLpy8R4Yv/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/?format=json","label":"Manage + block"},{"url":"https://kobo.correlaid.org/api/v2/assets/aDMQ2rG8oJ5jmYxMeiHLob/permission-assignments/pGsfWUncBzsCZsB6Fq5HyE/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/?format=json","label":"View + block"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/aDMQ2rG8oJ5jmYxMeiHLob/?format=json.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/aDMQ2rG8oJ5jmYxMeiHLob/?format=json.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/aDMQ2rG8oJ5jmYxMeiHLob/data/?format=json"},{"url":"https://kobo.correlaid.org/api/v2/assets/aYKJ5czzHiustZFpBBiWHk/?format=json","date_modified":"2021-07-06T19:14:39.238475Z","date_created":"2021-07-06T19:14:39.238451Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","summary":{"geo":true,"labels":["Please + say, for each of the following, how important it is in your life.","Work","Family","Friends + and acquaintances","Leisure time"],"columns":["name","type","appearance","label","select_from_list_name","required","hint","parameters","calculation"],"languages":[null],"row_count":24,"default_translation":null},"owner__username":"api_user","parent":null,"uid":"aYKJ5czzHiustZFpBBiWHk","tag_string":"","settings":{},"kind":"asset","name":"clone + survey to block","asset_type":"block","version_id":"vXNPcWM6aNauzMycK97PnG","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/aYKJ5czzHiustZFpBBiWHk/permission-assignments/puaZinDDbPALXHqjfVovAB/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/?format=json","label":"Edit + block"},{"url":"https://kobo.correlaid.org/api/v2/assets/aYKJ5czzHiustZFpBBiWHk/permission-assignments/pqqaM4JPBmpkuiVhJZXYQw/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/?format=json","label":"Manage + block"},{"url":"https://kobo.correlaid.org/api/v2/assets/aYKJ5czzHiustZFpBBiWHk/permission-assignments/pxkw6wXvmd9r34vdkSi6wq/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/?format=json","label":"View + block"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/aYKJ5czzHiustZFpBBiWHk/?format=json.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/aYKJ5czzHiustZFpBBiWHk/?format=json.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/aYKJ5czzHiustZFpBBiWHk/data/?format=json"},{"url":"https://kobo.correlaid.org/api/v2/assets/az2JpPivNFEdCNWR4mQNcV/?format=json","date_modified":"2021-07-06T19:13:48.214168Z","date_created":"2021-07-06T19:13:48.214146Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","summary":{"geo":true,"labels":["Please + say, for each of the following, how important it is in your life.","Work","Family","Friends + and acquaintances","Leisure time"],"columns":["name","type","appearance","label","select_from_list_name","required","hint","parameters","calculation"],"languages":[null],"row_count":24,"default_translation":null},"owner__username":"api_user","parent":null,"uid":"az2JpPivNFEdCNWR4mQNcV","tag_string":"","settings":{},"kind":"asset","name":"clone + survey to survey","asset_type":"survey","version_id":"vhMVqgtCbE3CyswvmZpCZg","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/az2JpPivNFEdCNWR4mQNcV/permission-assignments/pMfV4zJgMKC8Z5DLhPbSk8/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/?format=json","label":"Add + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/az2JpPivNFEdCNWR4mQNcV/permission-assignments/py3JddqHj3GwC2LCxA3zCo/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/?format=json","label":"Edit + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/az2JpPivNFEdCNWR4mQNcV/permission-assignments/phqkLnm2gdQRSAD7Gqpn4C/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/?format=json","label":"Edit + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/az2JpPivNFEdCNWR4mQNcV/permission-assignments/pJx8535pD9F3nkmj4Wd9Jo/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/?format=json","label":"Delete + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/az2JpPivNFEdCNWR4mQNcV/permission-assignments/pn9JX7T8YbdzS4yBAiWTWS/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/?format=json","label":"Manage + project"},{"url":"https://kobo.correlaid.org/api/v2/assets/az2JpPivNFEdCNWR4mQNcV/permission-assignments/pV9yqSKiq6yQzkimdLFn8D/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/?format=json","label":"Validate + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/az2JpPivNFEdCNWR4mQNcV/permission-assignments/p4hEiJqYe6H442FjbBYHXd/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/?format=json","label":"View + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/az2JpPivNFEdCNWR4mQNcV/permission-assignments/p89jr5JCdZyhvAaQ7o2uCw/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/?format=json","label":"View + submissions"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/az2JpPivNFEdCNWR4mQNcV/?format=json.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/az2JpPivNFEdCNWR4mQNcV/?format=json.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/az2JpPivNFEdCNWR4mQNcV/data/?format=json"},{"url":"https://kobo.correlaid.org/api/v2/assets/a5jjyWLUEmi49EHML6t9Nr/?format=json","date_modified":"2021-07-06T18:57:56.170304Z","date_created":"2021-06-12T14:32:20.811531Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","summary":{"geo":true,"labels":["Please + say, for each of the following, how important it is in your life.","Work","Family","Friends + and acquaintances","Leisure time"],"columns":["name","type","appearance","label","select_from_list_name","required","hint","parameters","calculation"],"languages":[null],"row_count":24,"default_translation":null},"owner__username":"api_user","parent":null,"uid":"a5jjyWLUEmi49EHML6t9Nr","tag_string":"","settings":{},"kind":"asset","name":"1206 + uploaded xls form","asset_type":"survey","version_id":"vH8kmSS552rACZCFjtPcHp","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/a5jjyWLUEmi49EHML6t9Nr/permission-assignments/pgDoNFTtYX3oPvPpWrYdgy/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/?format=json","label":"Add + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/a5jjyWLUEmi49EHML6t9Nr/permission-assignments/pkdDRZqpUbWBfQSDKPtFLd/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/?format=json","label":"Edit + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/a5jjyWLUEmi49EHML6t9Nr/permission-assignments/pEqitR3jCWJ9gZkt5NQWaP/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/?format=json","label":"Edit + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/a5jjyWLUEmi49EHML6t9Nr/permission-assignments/pmoX7HwKSQUJX8LheRQBvQ/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/?format=json","label":"Delete + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/a5jjyWLUEmi49EHML6t9Nr/permission-assignments/pNzQjx94aECX2rir2URzrQ/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/?format=json","label":"Manage + project"},{"url":"https://kobo.correlaid.org/api/v2/assets/a5jjyWLUEmi49EHML6t9Nr/permission-assignments/p5B6DNDYBewGrvoFBaT6DA/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/?format=json","label":"Validate + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/a5jjyWLUEmi49EHML6t9Nr/permission-assignments/pbqkSBVUd2vasUvVZzLyq2/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/?format=json","label":"View + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/a5jjyWLUEmi49EHML6t9Nr/permission-assignments/p7zGv4WgPSwW76KcSD6t3R/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/?format=json","label":"View + submissions"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/a5jjyWLUEmi49EHML6t9Nr/?format=json.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/a5jjyWLUEmi49EHML6t9Nr/?format=json.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/a5jjyWLUEmi49EHML6t9Nr/data/?format=json"},{"url":"https://kobo.correlaid.org/api/v2/assets/asq8bkKEk7qdst87UctMLb/?format=json","date_modified":"2021-07-05T22:05:36.188044Z","date_created":"2021-07-05T22:05:36.188020Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","summary":{},"owner__username":"api_user","parent":null,"uid":"asq8bkKEk7qdst87UctMLb","tag_string":"","settings":{},"kind":"asset","name":"new + 0507 This is a cloned survey (via API/R)","asset_type":"survey","version_id":"vmRrMK7Vdo9BMPGLGdAKBy","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/asq8bkKEk7qdst87UctMLb/permission-assignments/pNFd2EDvXRcCTG3UkeH5iW/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/?format=json","label":"Add + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/asq8bkKEk7qdst87UctMLb/permission-assignments/pM4qnhBKUU9zckYP8YTS44/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/?format=json","label":"Edit + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/asq8bkKEk7qdst87UctMLb/permission-assignments/pR5QjkeUajkeGdjzmnWVXr/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/?format=json","label":"Edit + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/asq8bkKEk7qdst87UctMLb/permission-assignments/pS8ptaTbRsUmZ4uBPtJRzM/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/?format=json","label":"Delete + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/asq8bkKEk7qdst87UctMLb/permission-assignments/pSLDeqZXgEqednH9nz2H6y/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/?format=json","label":"Manage + project"},{"url":"https://kobo.correlaid.org/api/v2/assets/asq8bkKEk7qdst87UctMLb/permission-assignments/prGE9ioA6RVgFf4DDJ82MF/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/?format=json","label":"Validate + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/asq8bkKEk7qdst87UctMLb/permission-assignments/pkYpWKtmbgBQZoZphupJDq/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/?format=json","label":"View + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/asq8bkKEk7qdst87UctMLb/permission-assignments/pUZt2gwRUuuMsFvUK6b99g/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/?format=json","label":"View + submissions"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/asq8bkKEk7qdst87UctMLb/?format=json.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/asq8bkKEk7qdst87UctMLb/?format=json.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/asq8bkKEk7qdst87UctMLb/data/?format=json"},{"url":"https://kobo.correlaid.org/api/v2/assets/aoEbMPTnXXhSzKKiPSCajJ/?format=json","date_modified":"2021-06-22T20:45:36.316977Z","date_created":"2021-06-22T20:45:36.316953Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","summary":{},"owner__username":"api_user","parent":null,"uid":"aoEbMPTnXXhSzKKiPSCajJ","tag_string":"","settings":{},"kind":"asset","name":"malte_mm","asset_type":"survey","version_id":"vZD4wzjQye2GgWDPUYzd87","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/aoEbMPTnXXhSzKKiPSCajJ/permission-assignments/pBR54xoZ3HhQcoCSJJGd7Z/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/?format=json","label":"Add + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aoEbMPTnXXhSzKKiPSCajJ/permission-assignments/p73EsvLcVRuvLjeFe8F26b/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/?format=json","label":"Edit + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aoEbMPTnXXhSzKKiPSCajJ/permission-assignments/pRxkVW2utyhaNJ7PiUCBA6/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/?format=json","label":"Edit + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aoEbMPTnXXhSzKKiPSCajJ/permission-assignments/pJAquhmUf54rU9gn2wuj9C/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/?format=json","label":"Delete + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aoEbMPTnXXhSzKKiPSCajJ/permission-assignments/poL6cv8i5WVuayuSRgeTQ3/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/?format=json","label":"Manage + project"},{"url":"https://kobo.correlaid.org/api/v2/assets/aoEbMPTnXXhSzKKiPSCajJ/permission-assignments/pBzpLNzYdB8TufGFiFj7iz/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/?format=json","label":"Validate + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aoEbMPTnXXhSzKKiPSCajJ/permission-assignments/pM2SzZPQPdZJLw8Sze74NA/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/?format=json","label":"View + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aoEbMPTnXXhSzKKiPSCajJ/permission-assignments/pnhjaFmEgmTK3mDgXRAHPq/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/?format=json","label":"View + submissions"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/aoEbMPTnXXhSzKKiPSCajJ/?format=json.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/aoEbMPTnXXhSzKKiPSCajJ/?format=json.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/aoEbMPTnXXhSzKKiPSCajJ/data/?format=json"},{"url":"https://kobo.correlaid.org/api/v2/assets/awVHD2euGQBNzRBN7FcaUL/?format=json","date_modified":"2021-06-12T14:34:31.102677Z","date_created":"2021-06-12T14:34:31.102659Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","summary":{"geo":true,"labels":["Please + say, for each of the following, how important it is in your life.","Work","Family","Friends + and acquaintances","Leisure time"],"columns":["type","name","appearance","label","select_from_list_name","required","hint","parameters","calculation"],"languages":[null],"row_count":24,"default_translation":null},"owner__username":"api_user","parent":null,"uid":"awVHD2euGQBNzRBN7FcaUL","tag_string":"","settings":{},"kind":"asset","name":"vcr_test_name","asset_type":"survey","version_id":"vJHfrTxnZzb2XMxKi2e8r4","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/awVHD2euGQBNzRBN7FcaUL/permission-assignments/ppnryQDXpV2TSwcFLjLJys/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/?format=json","label":"Add + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/awVHD2euGQBNzRBN7FcaUL/permission-assignments/p5D622FYsydLUX6BSH9ahT/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/?format=json","label":"Edit + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/awVHD2euGQBNzRBN7FcaUL/permission-assignments/pL5kPC3X4wUTvftRVcSjuQ/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/?format=json","label":"Edit + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/awVHD2euGQBNzRBN7FcaUL/permission-assignments/pS94FXLJyv2mQzLcWbsPxT/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/?format=json","label":"Delete + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/awVHD2euGQBNzRBN7FcaUL/permission-assignments/pbxYmt8Jh6zs7a2oBCjnjz/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/?format=json","label":"Manage + project"},{"url":"https://kobo.correlaid.org/api/v2/assets/awVHD2euGQBNzRBN7FcaUL/permission-assignments/pkXz4m29wyBMyrpqZkafYv/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/?format=json","label":"Validate + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/awVHD2euGQBNzRBN7FcaUL/permission-assignments/pWnW5RctbxUPYbmWGkLVtN/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/?format=json","label":"View + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/awVHD2euGQBNzRBN7FcaUL/permission-assignments/p9LKmAjfSmHrm247oAjaEf/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/?format=json","label":"View + submissions"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/awVHD2euGQBNzRBN7FcaUL/?format=json.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/awVHD2euGQBNzRBN7FcaUL/?format=json.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/awVHD2euGQBNzRBN7FcaUL/data/?format=json"},{"url":"https://kobo.correlaid.org/api/v2/assets/aNz6G8AXqvW2fejymw2eBo/?format=json","date_modified":"2021-06-12T14:07:07.280823Z","date_created":"2021-06-12T14:07:07.280800Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","summary":{},"owner__username":"api_user","parent":null,"uid":"aNz6G8AXqvW2fejymw2eBo","tag_string":"","settings":{},"kind":"asset","name":"vcr_test_name","asset_type":"survey","version_id":"vDeK4YC8HiwGZHbiyGPWuR","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/aNz6G8AXqvW2fejymw2eBo/permission-assignments/pBMsomczaLzvA6sBigxJy3/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/?format=json","label":"Add + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aNz6G8AXqvW2fejymw2eBo/permission-assignments/pEtyCneas8hpEBH8VJ868q/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/?format=json","label":"Edit + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aNz6G8AXqvW2fejymw2eBo/permission-assignments/p7noF45vPTu4iYFdqn64Qg/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/?format=json","label":"Edit + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aNz6G8AXqvW2fejymw2eBo/permission-assignments/pgbHhJHrMZZ95pGDmP3CcN/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/?format=json","label":"Delete + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aNz6G8AXqvW2fejymw2eBo/permission-assignments/p7CmVz5uNY7M36MLy2tpKm/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/?format=json","label":"Manage + project"},{"url":"https://kobo.correlaid.org/api/v2/assets/aNz6G8AXqvW2fejymw2eBo/permission-assignments/pUmmy4uJJpTrfc5NdPQk6K/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/?format=json","label":"Validate + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aNz6G8AXqvW2fejymw2eBo/permission-assignments/pZ8bJbmZYV9zUnSfN5X6as/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/?format=json","label":"View + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aNz6G8AXqvW2fejymw2eBo/permission-assignments/psn66HHNBsPKVhvcWDVuXG/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/?format=json","label":"View + submissions"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/aNz6G8AXqvW2fejymw2eBo/?format=json.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/aNz6G8AXqvW2fejymw2eBo/?format=json.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/aNz6G8AXqvW2fejymw2eBo/data/?format=json"},{"url":"https://kobo.correlaid.org/api/v2/assets/aQVGH8G68EP737tDBABRwC/?format=json","date_modified":"2021-06-12T13:37:10.361276Z","date_created":"2021-06-12T13:08:44.929148Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","summary":{},"owner__username":"api_user","parent":null,"uid":"aQVGH8G68EP737tDBABRwC","tag_string":"","settings":{},"kind":"asset","name":"vcr_test_name","asset_type":"survey","version_id":"vCrdJjJCz5uLQrGsGDQhDF","has_deployment":true,"deployed_version_id":"vCrdJjJCz5uLQrGsGDQhDF","deployment__identifier":"https://kc.correlaid.org/api_user/forms/aQVGH8G68EP737tDBABRwC","deployment__active":true,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/aQVGH8G68EP737tDBABRwC/permission-assignments/pWteuYWurvhpnmj9bFwznK/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/?format=json","label":"Add + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aQVGH8G68EP737tDBABRwC/permission-assignments/pQzTbPjHh23VmJYjbrABBm/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/?format=json","label":"Edit + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aQVGH8G68EP737tDBABRwC/permission-assignments/peXsNZbPygV4eQcc4e66YM/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/?format=json","label":"Edit + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aQVGH8G68EP737tDBABRwC/permission-assignments/pptCWLHPCoqFPhDdoRXvNS/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/?format=json","label":"Delete + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aQVGH8G68EP737tDBABRwC/permission-assignments/pP7zEB4zyAEYbGt3mnNh3e/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/?format=json","label":"Manage + project"},{"url":"https://kobo.correlaid.org/api/v2/assets/aQVGH8G68EP737tDBABRwC/permission-assignments/pTiL3oi4Sjny2NN7WfiM9u/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/?format=json","label":"Validate + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aQVGH8G68EP737tDBABRwC/permission-assignments/pcxJLozwrjLHW3QGckQz4J/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/?format=json","label":"View + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aQVGH8G68EP737tDBABRwC/permission-assignments/pX7eiGzAXxR7HxQPPDn26T/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/?format=json","label":"View + submissions"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/aQVGH8G68EP737tDBABRwC/?format=json.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/aQVGH8G68EP737tDBABRwC/?format=json.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/aQVGH8G68EP737tDBABRwC/data/?format=json"},{"url":"https://kobo.correlaid.org/api/v2/assets/amvEQmDhKf4zUDV8y8fmSa/?format=json","date_modified":"2021-06-12T13:23:02.871032Z","date_created":"2021-06-12T12:45:18.542410Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","summary":{},"owner__username":"api_user","parent":null,"uid":"amvEQmDhKf4zUDV8y8fmSa","tag_string":"","settings":{},"kind":"asset","name":"vcr_test_name","asset_type":"survey","version_id":"vxmaun2oB23QWSUiGByUft","has_deployment":true,"deployed_version_id":"vxmaun2oB23QWSUiGByUft","deployment__identifier":"https://kc.correlaid.org/api_user/forms/amvEQmDhKf4zUDV8y8fmSa","deployment__active":true,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/amvEQmDhKf4zUDV8y8fmSa/permission-assignments/pC5cZMZcv8zWwd9tpyskQN/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/?format=json","label":"Add + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/amvEQmDhKf4zUDV8y8fmSa/permission-assignments/pDqgdJBJFGeecse7K3vwmc/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/?format=json","label":"Edit + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/amvEQmDhKf4zUDV8y8fmSa/permission-assignments/pHHLMJypN72AmSAyFc4XCX/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/?format=json","label":"Edit + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/amvEQmDhKf4zUDV8y8fmSa/permission-assignments/pMF5CLfLbyhTm2Lg23jgzw/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/?format=json","label":"Delete + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/amvEQmDhKf4zUDV8y8fmSa/permission-assignments/pCu2Xgzpb5hAjEpL3XoU3W/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/?format=json","label":"Manage + project"},{"url":"https://kobo.correlaid.org/api/v2/assets/amvEQmDhKf4zUDV8y8fmSa/permission-assignments/pni6DQNwb4JjDvYiGL767h/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/?format=json","label":"Validate + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/amvEQmDhKf4zUDV8y8fmSa/permission-assignments/p6xYYAGjp86mScYphMMnYH/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/?format=json","label":"View + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/amvEQmDhKf4zUDV8y8fmSa/permission-assignments/p9ufCcNDYWmXYQ99t8Sm8Z/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/?format=json","label":"View + submissions"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/amvEQmDhKf4zUDV8y8fmSa/?format=json.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/amvEQmDhKf4zUDV8y8fmSa/?format=json.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/amvEQmDhKf4zUDV8y8fmSa/data/?format=json"},{"url":"https://kobo.correlaid.org/api/v2/assets/a84jmwwdPEsZMhK7s2i4SL/?format=json","date_modified":"2021-06-08T21:08:36.193053Z","date_created":"2021-05-15T18:50:36.054394Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","summary":{},"owner__username":"api_user","parent":null,"uid":"a84jmwwdPEsZMhK7s2i4SL","tag_string":"","settings":{},"kind":"asset","name":"A + survey object created via API/R","asset_type":"survey","version_id":"vrFx4VXXPVf6nThHWShbT4","has_deployment":true,"deployed_version_id":"vrFx4VXXPVf6nThHWShbT4","deployment__identifier":"https://kc.correlaid.org/api_user/forms/a84jmwwdPEsZMhK7s2i4SL","deployment__active":true,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/a84jmwwdPEsZMhK7s2i4SL/permission-assignments/pP2WmnNULKmpHuCen7uADN/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/?format=json","label":"Add + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/a84jmwwdPEsZMhK7s2i4SL/permission-assignments/pFHqEz8MLBfQR4KgEHa4sQ/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/?format=json","label":"Edit + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/a84jmwwdPEsZMhK7s2i4SL/permission-assignments/pqzz2xF7mWb6CmELvuEnQ7/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/?format=json","label":"Edit + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/a84jmwwdPEsZMhK7s2i4SL/permission-assignments/pZLpGn4QEV7PjwNvQznnbU/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/?format=json","label":"Delete + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/a84jmwwdPEsZMhK7s2i4SL/permission-assignments/peMU4HmNMmynoWQVHGzdCn/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/?format=json","label":"Manage + project"},{"url":"https://kobo.correlaid.org/api/v2/assets/a84jmwwdPEsZMhK7s2i4SL/permission-assignments/pUJn6uhe3cZ4CQghu5aAUT/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/?format=json","label":"Validate + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/a84jmwwdPEsZMhK7s2i4SL/permission-assignments/pH37tYqYySZz9ff7SujeDL/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/?format=json","label":"View + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/a84jmwwdPEsZMhK7s2i4SL/permission-assignments/pWCyCDL6qpXutV2xfkcPQo/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/?format=json","label":"View + submissions"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/a84jmwwdPEsZMhK7s2i4SL/?format=json.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/a84jmwwdPEsZMhK7s2i4SL/?format=json.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/a84jmwwdPEsZMhK7s2i4SL/data/?format=json"},{"url":"https://kobo.correlaid.org/api/v2/assets/aqhMVBiEQkpshvZwqGwHp4/?format=json","date_modified":"2021-06-08T06:27:03.919193Z","date_created":"2021-06-08T06:25:58.456587Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","summary":{"geo":false,"labels":["New + Question"],"columns":["type","label","required","select_from_list_name"],"languages":[null],"row_count":1,"default_translation":null},"owner__username":"api_user","parent":null,"uid":"aqhMVBiEQkpshvZwqGwHp4","tag_string":"","settings":{"sector":null,"country":null,"description":"","share-metadata":false},"kind":"asset","name":"test2","asset_type":"survey","version_id":"vvuFEhkumaKBYuiAJzQxEo","has_deployment":true,"deployed_version_id":"vvuFEhkumaKBYuiAJzQxEo","deployment__identifier":"https://kc.correlaid.org/api_user/forms/aqhMVBiEQkpshvZwqGwHp4","deployment__active":true,"deployment__submission_count":2,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/aqhMVBiEQkpshvZwqGwHp4/permission-assignments/puXFGRst3d53QVfFKni7yX/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/?format=json","label":"Add + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aqhMVBiEQkpshvZwqGwHp4/permission-assignments/pc64H4ixqehQWSgKLLUpSY/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/?format=json","label":"Edit + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aqhMVBiEQkpshvZwqGwHp4/permission-assignments/p5dLUeaaDgSHFuPEftyzYV/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/?format=json","label":"Edit + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aqhMVBiEQkpshvZwqGwHp4/permission-assignments/pbC2uk6NAHieFRa52ZSdqu/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/?format=json","label":"Delete + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aqhMVBiEQkpshvZwqGwHp4/permission-assignments/pQL3Qp6g8YEi8cLN9R6JKd/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/?format=json","label":"Manage + project"},{"url":"https://kobo.correlaid.org/api/v2/assets/aqhMVBiEQkpshvZwqGwHp4/permission-assignments/pHLf2EFst63XwYX9wTfodK/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/?format=json","label":"Validate + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aqhMVBiEQkpshvZwqGwHp4/permission-assignments/p9iJ7aeFK7dyvFW2PEuPco/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/?format=json","label":"View + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aqhMVBiEQkpshvZwqGwHp4/permission-assignments/p2kMFufESbVzVKN3Y7aZ93/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/?format=json","label":"View + submissions"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/aqhMVBiEQkpshvZwqGwHp4/?format=json.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/aqhMVBiEQkpshvZwqGwHp4/?format=json.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/aqhMVBiEQkpshvZwqGwHp4/data/?format=json"},{"url":"https://kobo.correlaid.org/api/v2/assets/aDsfwoHCXhHX3i84ZM8UKs/?format=json","date_modified":"2021-06-01T18:34:17.120631Z","date_created":"2021-06-01T18:34:17.120607Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","summary":{},"owner__username":"api_user","parent":null,"uid":"aDsfwoHCXhHX3i84ZM8UKs","tag_string":"","settings":{},"kind":"asset","name":"vignette + code - This is a cloned survey (via API/R)","asset_type":"survey","version_id":"vmdbdsMg4AYtUVkZBnm6J9","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/aDsfwoHCXhHX3i84ZM8UKs/permission-assignments/pWkbfznLbCh9FhdL6eMcP7/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/?format=json","label":"Add + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aDsfwoHCXhHX3i84ZM8UKs/permission-assignments/pYeeHHwZYSvB38b5ACZsYu/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/?format=json","label":"Edit + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aDsfwoHCXhHX3i84ZM8UKs/permission-assignments/pueAicEBzgPUB8DRvcoQwe/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/?format=json","label":"Edit + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aDsfwoHCXhHX3i84ZM8UKs/permission-assignments/p563nxwADHRAgVG78Gv8d4/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/?format=json","label":"Delete + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aDsfwoHCXhHX3i84ZM8UKs/permission-assignments/pFdcJAZhKmRzpjGM9LVicC/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/?format=json","label":"Manage + project"},{"url":"https://kobo.correlaid.org/api/v2/assets/aDsfwoHCXhHX3i84ZM8UKs/permission-assignments/pQd73RQYUBJrczQYZXWE5Y/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/?format=json","label":"Validate + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aDsfwoHCXhHX3i84ZM8UKs/permission-assignments/ptZWm2pV3cYhxEhH4SPrQb/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/?format=json","label":"View + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aDsfwoHCXhHX3i84ZM8UKs/permission-assignments/pbrhERpnsHdMDuDTcnoLQs/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/?format=json","label":"View + submissions"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/aDsfwoHCXhHX3i84ZM8UKs/?format=json.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/aDsfwoHCXhHX3i84ZM8UKs/?format=json.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/aDsfwoHCXhHX3i84ZM8UKs/data/?format=json"},{"url":"https://kobo.correlaid.org/api/v2/assets/awC7sYUkvs9s3ZekcTnbTX/?format=json","date_modified":"2021-05-27T20:26:36.197584Z","date_created":"2021-05-27T20:26:36.197562Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","summary":{},"owner__username":"api_user","parent":null,"uid":"awC7sYUkvs9s3ZekcTnbTX","tag_string":"","settings":{},"kind":"asset","name":"string","asset_type":"survey","version_id":"vfNsbsMXBPcpocvsqhMhZu","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/awC7sYUkvs9s3ZekcTnbTX/permission-assignments/ps3fPWdSD5trPykr6F28is/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/?format=json","label":"Add + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/awC7sYUkvs9s3ZekcTnbTX/permission-assignments/piaXijd4VpajRx6k9dpdDP/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/?format=json","label":"Edit + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/awC7sYUkvs9s3ZekcTnbTX/permission-assignments/pavA4BNXF7KjKyBPtt9KKL/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/?format=json","label":"Edit + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/awC7sYUkvs9s3ZekcTnbTX/permission-assignments/pvPmBb4pYXWuVctuyU4uwr/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/?format=json","label":"Delete + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/awC7sYUkvs9s3ZekcTnbTX/permission-assignments/pV4eK5EBu5BpMGAyjf4N4w/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/?format=json","label":"Manage + project"},{"url":"https://kobo.correlaid.org/api/v2/assets/awC7sYUkvs9s3ZekcTnbTX/permission-assignments/pGeniMjkNu7b53Kmd2db8V/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/?format=json","label":"Validate + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/awC7sYUkvs9s3ZekcTnbTX/permission-assignments/pjNHZYkMZmXLcMEkfUeRrQ/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/?format=json","label":"View + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/awC7sYUkvs9s3ZekcTnbTX/permission-assignments/p7LvhHdr9bdAZwFRCMoLGe/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/?format=json","label":"View + submissions"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/awC7sYUkvs9s3ZekcTnbTX/?format=json.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/awC7sYUkvs9s3ZekcTnbTX/?format=json.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/awC7sYUkvs9s3ZekcTnbTX/data/?format=json"},{"url":"https://kobo.correlaid.org/api/v2/assets/aMPwk5HB3C6nt3e7yH2Ppo/?format=json","date_modified":"2021-05-15T19:06:24.927986Z","date_created":"2021-05-15T19:05:17.311721Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","summary":{"geo":false,"labels":["Your + name","Your age","Your favourite dog","Your favourite cat"],"columns":["type","label","required","select_from_list_name"],"languages":[null],"row_count":4,"default_translation":null},"owner__username":"api_user","parent":null,"uid":"aMPwk5HB3C6nt3e7yH2Ppo","tag_string":"","settings":{"sector":{"label":"Other","value":"Other"},"country":{"label":"Germany","value":"DEU"},"description":""},"kind":"asset","name":"This + is a cloned survey (via API/R)","asset_type":"survey","version_id":"vN7gDMN3Td8BEw8T56jkdz","has_deployment":true,"deployed_version_id":"vN7gDMN3Td8BEw8T56jkdz","deployment__identifier":"https://kc.correlaid.org/api_user/forms/aMPwk5HB3C6nt3e7yH2Ppo","deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/aMPwk5HB3C6nt3e7yH2Ppo/permission-assignments/pafJxbJ393kwMa6h2azqes/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/?format=json","label":"Add + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aMPwk5HB3C6nt3e7yH2Ppo/permission-assignments/prbeRno37N6BrVxYecE6bE/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/?format=json","label":"Edit + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aMPwk5HB3C6nt3e7yH2Ppo/permission-assignments/pFQLp9k7E5gdNpVfQ7kgHn/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/?format=json","label":"Edit + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aMPwk5HB3C6nt3e7yH2Ppo/permission-assignments/pnTHhhhVh9QjSfrWxyFNmN/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/?format=json","label":"Delete + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aMPwk5HB3C6nt3e7yH2Ppo/permission-assignments/pAa7oZv5CeZNA539knsaT4/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/?format=json","label":"Manage + project"},{"url":"https://kobo.correlaid.org/api/v2/assets/aMPwk5HB3C6nt3e7yH2Ppo/permission-assignments/pwndvZuiuuWsKjbg5BCcsw/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/?format=json","label":"Validate + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aMPwk5HB3C6nt3e7yH2Ppo/permission-assignments/pfnzZ3uPryi86d7yoDh5Wg/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/?format=json","label":"View + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aMPwk5HB3C6nt3e7yH2Ppo/permission-assignments/pf6PTwyAqeghSdVotG2PQW/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/?format=json","label":"View + submissions"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/aMPwk5HB3C6nt3e7yH2Ppo/?format=json.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/aMPwk5HB3C6nt3e7yH2Ppo/?format=json.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/aMPwk5HB3C6nt3e7yH2Ppo/data/?format=json"},{"url":"https://kobo.correlaid.org/api/v2/assets/ajzghKK6NELaixPQqsm49e/?format=json","date_modified":"2021-05-13T16:59:25.147719Z","date_created":"2021-04-28T19:52:13.144873Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","summary":{"geo":false,"labels":["Your + name","Your age","Your favourite dog","Your favourite cat"],"columns":["type","label","required","select_from_list_name"],"languages":[null],"row_count":4,"default_translation":null},"owner__username":"api_user","parent":null,"uid":"ajzghKK6NELaixPQqsm49e","tag_string":"","settings":{"sector":{"label":"Other","value":"Other"},"country":{"label":"Germany","value":"DEU"},"description":"","share-metadata":false},"kind":"asset","name":"test_built_from_scratch","asset_type":"survey","version_id":"v39addKozAjjUTpsr8eYRm","has_deployment":true,"deployed_version_id":"v39addKozAjjUTpsr8eYRm","deployment__identifier":"https://kc.correlaid.org/api_user/forms/ajzghKK6NELaixPQqsm49e","deployment__active":true,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/ajzghKK6NELaixPQqsm49e/permission-assignments/pNh4FweRqmRpTGz5r49QsY/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/?format=json","label":"Add + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/ajzghKK6NELaixPQqsm49e/permission-assignments/pHFo8upcnYmy9rnhFEQ3gf/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/?format=json","label":"Edit + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/ajzghKK6NELaixPQqsm49e/permission-assignments/pZgG8gtvSRUJFD9PCx8KVu/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/?format=json","label":"Edit + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/ajzghKK6NELaixPQqsm49e/permission-assignments/ph6z7ox7XG79Mv6ApCpHjW/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/?format=json","label":"Delete + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/ajzghKK6NELaixPQqsm49e/permission-assignments/pFefHXsa5tMSx5HdufFUyj/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/?format=json","label":"Manage + project"},{"url":"https://kobo.correlaid.org/api/v2/assets/ajzghKK6NELaixPQqsm49e/permission-assignments/pdG8GpXaRpHqPpZrcoNfLJ/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/?format=json","label":"Validate + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/ajzghKK6NELaixPQqsm49e/permission-assignments/p8MCoXV4zWS9Ww7AjTnrNW/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/?format=json","label":"View + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/ajzghKK6NELaixPQqsm49e/permission-assignments/p8piyLxXaq94EeQX3FjNTD/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/?format=json","label":"View + submissions"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/ajzghKK6NELaixPQqsm49e/?format=json.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/ajzghKK6NELaixPQqsm49e/?format=json.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/ajzghKK6NELaixPQqsm49e/data/?format=json"},{"url":"https://kobo.correlaid.org/api/v2/assets/aZX4ysiPdP3JHnTMbnu2n2/?format=json","date_modified":"2021-05-03T15:01:49.807891Z","date_created":"2021-02-25T15:29:57.813770Z","owner":"https://kobo.correlaid.org/api/v2/users/super_admin/?format=json","summary":{"geo":false,"labels":["Hello!","Disclaimer","What + is your first name?","What is your last name?","Which email address can we + use to contact you?"],"columns":["type","name","required","label","hint","constraint","constraint_message","select_from_list_name","relevant","kobo--score-choices","guidance_hint"],"languages":["English + (en)","Deutsch (de)"],"row_count":47,"default_translation":"English (en)"},"owner__username":"super_admin","parent":"https://kobo.correlaid.org/api/v2/collections/cjpaoCes6BZiCbzn9Tv6bA/?format=json","uid":"aZX4ysiPdP3JHnTMbnu2n2","tag_string":"","settings":{},"kind":"asset","name":"Template + survey applications","asset_type":"template","version_id":"vMD7uBPhuWpRMCmJuKVrHp","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/aZX4ysiPdP3JHnTMbnu2n2/permission-assignments/pp36NL4VjBftHBtRCZk57E/?format=json","user":"https://kobo.correlaid.org/api/v2/users/AnonymousUser/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/?format=json","label":"View + template"},{"url":"https://kobo.correlaid.org/api/v2/assets/aZX4ysiPdP3JHnTMbnu2n2/permission-assignments/pHSuoJARdj6whAguP4bR95/?format=json","user":"https://kobo.correlaid.org/api/v2/users/super_admin/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/?format=json","label":"Edit + template"},{"url":"https://kobo.correlaid.org/api/v2/assets/aZX4ysiPdP3JHnTMbnu2n2/permission-assignments/pxvuW7j3gv9EgqSZFuC2bp/?format=json","user":"https://kobo.correlaid.org/api/v2/users/super_admin/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/?format=json","label":"Manage + template"},{"url":"https://kobo.correlaid.org/api/v2/assets/aZX4ysiPdP3JHnTMbnu2n2/permission-assignments/pLQwWRnuW7VQ3wS6ANT6ow/?format=json","user":"https://kobo.correlaid.org/api/v2/users/super_admin/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/?format=json","label":"View + template"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/aZX4ysiPdP3JHnTMbnu2n2/?format=json.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/aZX4ysiPdP3JHnTMbnu2n2/?format=json.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/aZX4ysiPdP3JHnTMbnu2n2/data/?format=json"},{"url":"https://kobo.correlaid.org/api/v2/assets/aSmGHTKbLZWu2uc4HzEbtn/?format=json","date_modified":"2021-03-20T20:58:54.630077Z","date_created":"2021-03-20T20:54:26.707919Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","summary":{"geo":true,"labels":["What + is your favorite ice cream flavor?","What marvel movies have you seen?","what + is your age?","email_address","Where do you live?"],"columns":["type","label","required","select_from_list_name","hint","name","constraint","constraint_message"],"languages":[null,"Deutsch + (de)","English (en)"],"row_count":6,"default_translation":null},"owner__username":"api_user","parent":null,"uid":"aSmGHTKbLZWu2uc4HzEbtn","tag_string":"","settings":{"sector":null,"country":null,"description":"a + survey containing at least one question for each question type","share-metadata":false},"kind":"asset","name":"kbtbr + test survey misc questions","asset_type":"survey","version_id":"vJEfSwVjJE2z4vfWoAcrKr","has_deployment":true,"deployed_version_id":"vJEfSwVjJE2z4vfWoAcrKr","deployment__identifier":"https://kc.correlaid.org/api_user/forms/aSmGHTKbLZWu2uc4HzEbtn","deployment__active":true,"deployment__submission_count":3,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/aSmGHTKbLZWu2uc4HzEbtn/permission-assignments/p6PS8kdkgHWsiUstTTEwwW/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/?format=json","label":"Add + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aSmGHTKbLZWu2uc4HzEbtn/permission-assignments/puy3NyiYiJ8hHdWUMUhChJ/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/?format=json","label":"Edit + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aSmGHTKbLZWu2uc4HzEbtn/permission-assignments/peigSbkHJF6bibPvJvHz56/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/?format=json","label":"Edit + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aSmGHTKbLZWu2uc4HzEbtn/permission-assignments/pYNHgfx49MSXmNYPF2Uhmo/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/?format=json","label":"Delete + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aSmGHTKbLZWu2uc4HzEbtn/permission-assignments/pMVBtkCh8bEX2MFi6yvyjN/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/?format=json","label":"Manage + project"},{"url":"https://kobo.correlaid.org/api/v2/assets/aSmGHTKbLZWu2uc4HzEbtn/permission-assignments/pJu2BGRjXQGqkJ9cXTLcsK/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/?format=json","label":"Validate + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/aSmGHTKbLZWu2uc4HzEbtn/permission-assignments/p8uaVBFvCa8KzJRxWeoT3w/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/?format=json","label":"View + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/aSmGHTKbLZWu2uc4HzEbtn/permission-assignments/pNj9tfxWu2PdGM3szsTk6H/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/?format=json","label":"View + submissions"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/aSmGHTKbLZWu2uc4HzEbtn/?format=json.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/aSmGHTKbLZWu2uc4HzEbtn/?format=json.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/aSmGHTKbLZWu2uc4HzEbtn/data/?format=json"},{"url":"https://kobo.correlaid.org/api/v2/assets/akx2SZbwn65hGBAWgBYwiQ/?format=json","date_modified":"2021-03-20T20:51:48.113048Z","date_created":"2021-03-20T20:49:29.213835Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","summary":{"geo":false,"labels":["What + is your first name?","What is your last name?","Which email address can we + use to contact you?","What is your gender?","My gender is:"],"columns":["name","type","label","required","constraint","constraint_message","hint","select_from_list_name","relevant","kobo--score-choices","guidance_hint"],"languages":["English + (en)","Deutsch (de)"],"row_count":43,"default_translation":"English (en)"},"owner__username":"api_user","parent":null,"uid":"akx2SZbwn65hGBAWgBYwiQ","tag_string":"","settings":{"description":"test + survey for development of kbtbr R package","share-metadata":false},"kind":"asset","name":"kbtbr + test survey applications","asset_type":"survey","version_id":"vCHJLzRcCKrSLDzPKbKcFB","has_deployment":true,"deployed_version_id":"vCHJLzRcCKrSLDzPKbKcFB","deployment__identifier":"https://kc.correlaid.org/api_user/forms/akx2SZbwn65hGBAWgBYwiQ","deployment__active":true,"deployment__submission_count":4,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/akx2SZbwn65hGBAWgBYwiQ/permission-assignments/pnyZLEHpnKcCVtFkeqBdbe/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/add_submissions/?format=json","label":"Add + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/akx2SZbwn65hGBAWgBYwiQ/permission-assignments/pWDzU3sJuuyAxwPXvToAyj/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/?format=json","label":"Edit + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/akx2SZbwn65hGBAWgBYwiQ/permission-assignments/p22BSFCxU9uKb7FJFKmjhY/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_submissions/?format=json","label":"Edit + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/akx2SZbwn65hGBAWgBYwiQ/permission-assignments/p2hrbBFFgw7XeRuzyXm3Zs/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/delete_submissions/?format=json","label":"Delete + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/akx2SZbwn65hGBAWgBYwiQ/permission-assignments/pJgmjhfJbEkFgZT3pGSxDA/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/?format=json","label":"Manage + project"},{"url":"https://kobo.correlaid.org/api/v2/assets/akx2SZbwn65hGBAWgBYwiQ/permission-assignments/pWBYiU98vEBHyVvYfMQwzn/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/validate_submissions/?format=json","label":"Validate + submissions"},{"url":"https://kobo.correlaid.org/api/v2/assets/akx2SZbwn65hGBAWgBYwiQ/permission-assignments/pEPkXKgVTJ2ziGmCDLPvrC/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/?format=json","label":"View + form"},{"url":"https://kobo.correlaid.org/api/v2/assets/akx2SZbwn65hGBAWgBYwiQ/permission-assignments/pcwCQpqmwgryL5agX9Apx7/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_submissions/?format=json","label":"View + submissions"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/akx2SZbwn65hGBAWgBYwiQ/?format=json.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/akx2SZbwn65hGBAWgBYwiQ/?format=json.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/akx2SZbwn65hGBAWgBYwiQ/data/?format=json"},{"url":"https://kobo.correlaid.org/api/v2/assets/a7AV5JhRHKf8EWGBJLswwC/?format=json","date_modified":"2021-03-20T20:51:13.674659Z","date_created":"2021-03-20T20:50:19.480897Z","owner":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","summary":{"geo":false,"labels":["what + is your age?"],"columns":["type","name","label","hint","required","constraint"],"languages":[null],"row_count":1,"default_translation":null},"owner__username":"api_user","parent":null,"uid":"a7AV5JhRHKf8EWGBJLswwC","tag_string":"","settings":{},"kind":"asset","name":"Age","asset_type":"question","version_id":"ve66TcLYqgsfpeQRyA9YZn","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/a7AV5JhRHKf8EWGBJLswwC/permission-assignments/pKxDdHLsvodLsanDMYK4k6/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/?format=json","label":"Edit + question"},{"url":"https://kobo.correlaid.org/api/v2/assets/a7AV5JhRHKf8EWGBJLswwC/permission-assignments/p4ZPwsutnufKJceaKte7Ab/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/?format=json","label":"Manage + question"},{"url":"https://kobo.correlaid.org/api/v2/assets/a7AV5JhRHKf8EWGBJLswwC/permission-assignments/pU7m8s8y7S9LYnUKWya4Me/?format=json","user":"https://kobo.correlaid.org/api/v2/users/api_user/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/?format=json","label":"View + question"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/a7AV5JhRHKf8EWGBJLswwC/?format=json.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/a7AV5JhRHKf8EWGBJLswwC/?format=json.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/a7AV5JhRHKf8EWGBJLswwC/data/?format=json"},{"url":"https://kobo.correlaid.org/api/v2/assets/a45JAGjSNac4tQGREXR79e/?format=json","date_modified":"2021-02-25T15:15:00.494023Z","date_created":"2021-02-25T07:45:34.578117Z","owner":"https://kobo.correlaid.org/api/v2/users/super_admin/?format=json","summary":{"geo":false,"labels":["What + is your gender?","My gender is:"],"columns":["hint","name","type","label","required","select_from_list_name","relevant"],"languages":["English + (en)","Deutsch (de)"],"row_count":2,"default_translation":"English (en)"},"owner__username":"super_admin","parent":"https://kobo.correlaid.org/api/v2/collections/cjpaoCes6BZiCbzn9Tv6bA/?format=json","uid":"a45JAGjSNac4tQGREXR79e","tag_string":"","settings":{},"kind":"asset","name":"gender","asset_type":"block","version_id":"vvvbx6kAbsWDsqahxFxfmx","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/a45JAGjSNac4tQGREXR79e/permission-assignments/pp3zL2eF8nHCCJQjyiftYP/?format=json","user":"https://kobo.correlaid.org/api/v2/users/AnonymousUser/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/?format=json","label":"View + block"},{"url":"https://kobo.correlaid.org/api/v2/assets/a45JAGjSNac4tQGREXR79e/permission-assignments/peNGxpyTBD8nueLwFJgGUT/?format=json","user":"https://kobo.correlaid.org/api/v2/users/super_admin/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/?format=json","label":"Edit + block"},{"url":"https://kobo.correlaid.org/api/v2/assets/a45JAGjSNac4tQGREXR79e/permission-assignments/p2vS7GToSNmuS2TWAqX9YK/?format=json","user":"https://kobo.correlaid.org/api/v2/users/super_admin/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/?format=json","label":"Manage + block"},{"url":"https://kobo.correlaid.org/api/v2/assets/a45JAGjSNac4tQGREXR79e/permission-assignments/pQW49WA8zj7LNnMv54Dv2L/?format=json","user":"https://kobo.correlaid.org/api/v2/users/super_admin/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/?format=json","label":"View + block"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/a45JAGjSNac4tQGREXR79e/?format=json.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/a45JAGjSNac4tQGREXR79e/?format=json.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/a45JAGjSNac4tQGREXR79e/data/?format=json"},{"url":"https://kobo.correlaid.org/api/v2/assets/a9BzPvnNLub346sr8M7R33/?format=json","date_modified":"2021-02-25T14:46:55.138284Z","date_created":"2021-02-25T07:45:19.198776Z","owner":"https://kobo.correlaid.org/api/v2/users/super_admin/?format=json","summary":{"geo":false,"labels":["What + is your first name?","What is your last name?","Which email address can we + use to contact you?"],"columns":["type","name","required","label","constraint","constraint_message"],"languages":["English + (en)","Deutsch (de)"],"row_count":3,"default_translation":"English (en)"},"owner__username":"super_admin","parent":"https://kobo.correlaid.org/api/v2/collections/cjpaoCes6BZiCbzn9Tv6bA/?format=json","uid":"a9BzPvnNLub346sr8M7R33","tag_string":"","settings":{},"kind":"asset","name":"name + and email","asset_type":"block","version_id":"vSEHjmUidgBcfC56tGsDuJ","has_deployment":false,"deployed_version_id":null,"deployment__identifier":null,"deployment__active":false,"deployment__submission_count":0,"permissions":[{"url":"https://kobo.correlaid.org/api/v2/assets/a9BzPvnNLub346sr8M7R33/permission-assignments/pKFAAdjpFdYcwHNhMGWg4s/?format=json","user":"https://kobo.correlaid.org/api/v2/users/AnonymousUser/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/?format=json","label":"View + block"},{"url":"https://kobo.correlaid.org/api/v2/assets/a9BzPvnNLub346sr8M7R33/permission-assignments/pyhWc7z6D4EaQVeXoo38Pa/?format=json","user":"https://kobo.correlaid.org/api/v2/users/super_admin/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/change_asset/?format=json","label":"Edit + block"},{"url":"https://kobo.correlaid.org/api/v2/assets/a9BzPvnNLub346sr8M7R33/permission-assignments/p2ow2DBYsTuyBD3SXueFjv/?format=json","user":"https://kobo.correlaid.org/api/v2/users/super_admin/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/manage_asset/?format=json","label":"Manage + block"},{"url":"https://kobo.correlaid.org/api/v2/assets/a9BzPvnNLub346sr8M7R33/permission-assignments/pUaxf7JWWrefyH5XFN59yT/?format=json","user":"https://kobo.correlaid.org/api/v2/users/super_admin/?format=json","permission":"https://kobo.correlaid.org/api/v2/permissions/view_asset/?format=json","label":"View + block"}],"downloads":[{"format":"xls","url":"https://kobo.correlaid.org/api/v2/assets/a9BzPvnNLub346sr8M7R33/?format=json.xls"},{"format":"xml","url":"https://kobo.correlaid.org/api/v2/assets/a9BzPvnNLub346sr8M7R33/?format=json.xml"}],"data":"https://kobo.correlaid.org/api/v2/assets/a9BzPvnNLub346sr8M7R33/data/?format=json"}]}' + recorded_at: 2022-01-24 13:04:46 GMT + recorded_with: vcr/0.6.0, webmockr/0.8.0 diff --git a/vignettes/assets/import-xls-form.yml b/vignettes/assets/import-xls-form.yml new file mode 100644 index 0000000..f27504f --- /dev/null +++ b/vignettes/assets/import-xls-form.yml @@ -0,0 +1,36 @@ +http_interactions: +- request: + method: post + uri: https://kobo.correlaid.org/imports/ + body: + encoding: '' + string: file=list(path = "/Users/frie/dev/correlaid/projects/kbtbr/vignettes/assets/xls_form_downloaded.xls", + type = "application/vnd.ms-excel") + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3 crul/1.1.0 + Accept-Encoding: gzip, deflate + Authorization: fakebearertoken + Accept: application/json + response: + status: + status_code: '201' + message: Created + explanation: Document created, URL follows + headers: + status: HTTP/1.1 201 Created + server: nginx + date: Mon, 24 Jan 2022 13:16:28 GMT + content-type: application/json + content-length: '121' + connection: keep-alive + vary: Accept, Accept-Language, Cookie, Origin + allow: GET, POST, HEAD, OPTIONS + x-kobonaut: api_user + x-frame-options: SAMEORIGIN + content-language: en + body: + encoding: UTF-8 + file: no + string: '{"uid":"iXZmuqhTNuXoxnyftKCrg3","url":"https://kobo.correlaid.org/imports/iXZmuqhTNuXoxnyftKCrg3/","status":"processing"}' + recorded_at: 2022-01-24 13:16:26 GMT + recorded_with: vcr/0.6.0, webmockr/0.8.0 diff --git a/vignettes/articles/rating_question.png b/vignettes/assets/rating_question.png similarity index 100% rename from vignettes/articles/rating_question.png rename to vignettes/assets/rating_question.png diff --git a/vignettes/articles/xls_form_downloaded.xls b/vignettes/assets/xls_form_downloaded.xls similarity index 100% rename from vignettes/articles/xls_form_downloaded.xls rename to vignettes/assets/xls_form_downloaded.xls diff --git a/vignettes/articles/xls_form_downloaded.xml b/vignettes/assets/xls_form_downloaded.xml similarity index 100% rename from vignettes/articles/xls_form_downloaded.xml rename to vignettes/assets/xls_form_downloaded.xml diff --git a/vignettes/articles/response_overview.Rmd b/vignettes/dev_only/response_overview.Rmd similarity index 99% rename from vignettes/articles/response_overview.Rmd rename to vignettes/dev_only/response_overview.Rmd index c9b3cba..9265bf0 100644 --- a/vignettes/articles/response_overview.Rmd +++ b/vignettes/dev_only/response_overview.Rmd @@ -1,15 +1,12 @@ --- -title: "Response overview" +title: "Overview over different API endpoints" output: - html_document: - toc: yes - toc_depth: 3 + github_document --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE, eval=FALSE) devtools::load_all() -library(kbtbr) library(dplyr) library(purrr) library(tidyr) diff --git a/vignettes/articles/using_crul.Rmd b/vignettes/dev_only/using_crul.Rmd similarity index 100% rename from vignettes/articles/using_crul.Rmd rename to vignettes/dev_only/using_crul.Rmd diff --git a/vignettes/kbtbr.Rmd b/vignettes/kbtbr.Rmd new file mode 100644 index 0000000..4485e03 --- /dev/null +++ b/vignettes/kbtbr.Rmd @@ -0,0 +1,261 @@ +--- +title: "Get started" +output: rmarkdown::html_vignette +vignette: > + %\VignetteIndexEntry{Get started} + %\VignetteEngine{knitr::rmarkdown} + %\VignetteEncoding{UTF-8} +--- + + +```{r setup, include=FALSE} +knitr::opts_chunk$set(echo = TRUE, eval = TRUE) +library(dplyr) +library(purrr) +library(tidyr) + + +# properly set up vcr +library(vcr) +vcr_dir <- "./assets" +if (!nzchar(Sys.getenv("KBTBR_TOKEN"))) { + if (dir.exists(vcr_dir)) { + # Fake API token to fool our package + Sys.setenv("KBTBR_TOKEN" = "fakebearertoken") + } else { + # If there's no mock files nor API token, impossible to run tests + stop("No API key nor cassettes, tests cannot be run.", + call. = FALSE + ) + } +} + +invisible(vcr::vcr_configure( + dir = vcr_dir, + filter_request_headers = list(Authorization = "fakebearertoken") +)) +vcr::check_cassette_names() +``` + +# Overview +kbtbr is a wrapper for the [KoBoToolbox APIs](https://support.kobotoolbox.org/api.html). It focuses on API v2 but also makes use of v1 if required. + +kbtbr uses [R6](https://r6.r-lib.org/articles/Introduction.html) classes. This means it has an object-oriented user interface which might feel unfamiliar to R users at first. But don't worry - you should get used to it quickly! + + + +# Setup +## Authentication + +Get an API token using any of the methods described in the [KoBoToolbox documentation](https://support.kobotoolbox.org/api.html#getting-your-api-token). +Then store it as an environment variable by opening and editing your `.Renviron`: + + +```{r eval=FALSE} +usethis::edit_r_environ() +``` + +Add your token on a new line as follows: + +``` +KBTBR_TOKEN=yourapitokenhere +``` +Save the file and restart R/RStudio. + + +Of course, you can also use local environment files or any other method to securely store the API token. + +## Base URL +In order to use kbtbr, you need to know the _base URLs_ of your KoBoToolbox server (cf. [here](https://support.kobotoolbox.org/api.html#using-the-api)). There are two _base URLs_, one for API version 2 and one for version 1. +To use the kbtbr package, you only need to specify the _base URL_ for version 2. However, certain functionalities that rely on the version 1 API will require its _base URL_. + +If you are using one of the [two hosted instances](https://support.kobotoolbox.org/server.html), those are the base URLs: + + +```{r echo=FALSE, eval=TRUE} +baseurls <- tibble::tribble( + ~version, ~`Humanitarian Server (OCHA)`, ~`Non-Humanitarian Server`, + "v2", "https://kobo.humanitarianresponse.info", "https://kf.kobotoolbox.org", + "v1", "https://kc.humanitarianresponse.info", "https://kc.kobotoolbox.org" +) + +knitr::kable(baseurls) + +``` + +## Creating the Kobo instance + +With the right base URL(s), we can create an instance of the `Kobo` class. The `base_url_v1` argument is optional. + +```{r kobo} +library(kbtbr) +base_url_v2 <- "https://kobo.correlaid.org" # replace with your base URL for v2 +base_url_v1 <- "https://kc.correlaid.org" # replace with your base URL for v1 +token <- Sys.getenv("KBTBR_TOKEN") + +kobo <- Kobo$new(base_url_v2, base_url_v1, token) +kobo +``` + +For alternative ways of initializing the `Kobo` class, see [here](/articles/koboclient-class.html#the-use-of-koboclient-in-the-kobo-interface). + +# Working with the Kobo class + +A good first step is to get an overview over all your assets. Almost everything in KoBoToolbox is an asset: questions, blocks, forms, templates. + +```{r include=FALSE} +vcr::use_cassette("get-assets", { + assets <- kobo$get_assets() +}) +``` + +```{r eval=FALSE} +assets <- kobo$get_assets() +``` + +```{r} +table(assets$asset_type) +``` + +You can also just get your forms/surveys: + +```{r include=FALSE} +vcr::use_cassette("get-surveys", { + surveys <- kobo$get_surveys() +}) +``` + +```{r eval=FALSE} +surveys <- kobo$get_surveys() +``` + +Inspect the data manually: +```{r} +head(surveys) +``` + +You can then extract the ID of a single survey by filtering for its name. + +```{r} +test_id <- surveys$uid[surveys$name == "kbtbr Testing Survey"] +``` + +Get the answers (or _submissions_ in KoBoToolbox API lingo) to the form/survey: + +```{r include=FALSE} +vcr::use_cassette("get-submissions", { + submissions <- kobo$get_submissions(test_id) +}) +``` + +```{r eval=FALSE} +submissions <- kobo$get_submissions(test_id) +``` + +```{r} +glimpse(submissions) +``` + +Check out [Data wrangling of responses](/articles/wrangling-survey-responses.html) to see how to handle messy column names. + +# Kobo Administration with `kbtbr` + +With `kbtbr`, you can also manage your assets and do other useful administration tasks right from your R console. + + +## Create an Asset +You can also create assets using the `create_asset()` method of the Kobo class. This can be useful if you need to create a lot of assets at once. + +```{r include=FALSE} +vcr::use_cassette("create-asset", { + res <- kobo$create_asset("Question block", + asset_type = "block", + description = "this question block was created with the API.") +}) + +``` + +```{r eval=FALSE} +res <- kobo$create_asset("Question block", + asset_type = "block", + description = "this question block was created with the API.") +``` + +```{r} +res$status_http() +response_content <- res$parse("UTF-8") %>% jsonlite::fromJSON() +str(response_content, max.level = 1) +``` + + +## Cloning an Asset + +In order to clone an asset, you just have to specify its ID, a new name for the cloned asset and its type. + +```{r include=FALSE} +vcr::use_cassette("clone-asset", { + res <- kobo$clone_asset(test_id, "Test survey copy", "survey") +}) +``` + +```{r eval=FALSE} +res <- kobo$clone_asset(test_id, "Test survey copy", "survey") +``` + +```{r} +class(res) +res$status_http() +``` + +Parse out the ID of the asset that was created: + +```{r} +response_content <- res$parse("UTF-8") %>% jsonlite::fromJSON() +str(response_content, max.level = 1) +test_clone_id <- response_content$uid +``` + + +## Deploying an asset + +To deploy an existing asset, e.g. after cloning or updating: + +```{r include=FALSE} +vcr::use_cassette("deploy-asset", { + res <- kobo$deploy_asset(test_clone_id) +}) +``` + +```{r eval=FALSE} +res <- kobo$deploy_asset(test_clone_id) +``` + +```{r} +class(res) +res$status_http() +response_content <- res$parse("UTF-8") %>% jsonlite::fromJSON() +str(response_content, max.level = 1) +``` + +## Importing XLS forms + +You can import an XLS form. This will create a draft survey/form which you could then again deploy using `kobo$deploy_asset()`. + +```{r include=FALSE} +vcr::use_cassette("import-xls-form", { + res <- kobo$import_xls_form(name = "XLS Form via import", "assets/xls_form_downloaded.xls") +}) +``` +```{r eval=FALSE} +res <- kobo$import_xls_form(name = "XLS Form via import", "assets/xls_form_downloaded.xls") +``` + +```{r} +res$status_http() +``` + +# Making it your own: `post` and `get` + +`kbtbr` is by no means complete. So you might find that some of your use cases are not covered by the existing methods of the `Kobo` class. For this purpose, `Kobo` as well as the lower-level `KoboClient` class expose generic `get` and `post` functions which should allow you to implement more functionalities on your own. You can check out the existing high-level functions (e.g. `get_assets` or `clone_asset`) to get ideas how your code should look like. Of course, contributions to `kbtbr` are always welcome. + + diff --git a/vignettes/articles/KoboClient_class.Rmd b/vignettes/koboclient-class.Rmd similarity index 62% rename from vignettes/articles/KoboClient_class.Rmd rename to vignettes/koboclient-class.Rmd index c1d046f..f32b07a 100644 --- a/vignettes/articles/KoboClient_class.Rmd +++ b/vignettes/koboclient-class.Rmd @@ -1,24 +1,23 @@ --- -title: "The KoboClient class and how to use it" +title: "Advanced: The KoboClient class" date: "`r Sys.Date()`" -output: rmarkdown::html_vignette +output: rmarkdown::html_vignette vignette: > - %\VignetteIndexEntry{2. The KoboClient class and how to use it} - %\VignetteEngine{knitr::rmarkdown} - %\VignetteEncoding{UTF-8} - + %\VignetteIndexEntry{Advanced: The KoboClient class} + %\VignetteEngine{knitr::rmarkdown} + %\VignetteEncoding{UTF-8} --- ```{r setup, include=TRUE, echo=FALSE} -devtools::load_all() knitr::opts_chunk$set( collapse = TRUE, - comment = "#>" + comment = "#>", + echo = TRUE ) # setup vcr library(vcr) -vcr_dir <- "." +vcr_dir <- "./assets" if (!nzchar(Sys.getenv("KBTBR_TOKEN"))) { if (dir.exists(vcr_dir)) { # Fake API token to fool our package @@ -41,8 +40,7 @@ vcr::check_cassette_names() Most users should not need the `KoboClient` class because `Kobo` takes care of the end-user services. `Kobo` uses `KoboClient` under the hood. `KoboClient` is effectively an HTTP client and inherits its features from the -[crul](https://github.com/ropensci/crul) library, in particular from -[`crul::HttpClient`](https://docs.ropensci.org/crul/reference/HttpClient.html). +[crul](https://github.com/ropensci/crul) library, in particular from `crul::HttpClient`. # Getting started @@ -56,8 +54,9 @@ The `KoboClient` will check if the variable `KBTBR_TOKEN` is set during the init The first step to start a session is to create an object from the R6 class by calling the `$new` method. ```{r} +library(kbtbr) base_url <- "https://kobo.correlaid.org" -my_session <- KoboClient$new(base_url) +my_session <- KoboClient$new(base_url, kobo_token = "faketoken") class(my_session) ``` @@ -69,13 +68,13 @@ that is the parent R6 class. For example, -```{r, results='hide'} +```{r} my_session$print() ``` will show you several properties set in the HTTP client, like the headers, the URL and other properties. The `$print()` method is not implemented in the KoboClient class, but it is automatically inherited from its parent class. -KoboClient is called a child of [`crul::HttpClient`](https://docs.ropensci.org/crul/reference/HttpClient.html), +KoboClient is called a child of `crul::HttpClient`, the parent, and by the inheritance mechanism can have all of its features (methods and fields) of the parent, but it can also provide more features or specialize some of the parent methods. In our case, for example, some features @@ -88,11 +87,11 @@ method described in the next section. The get method is based on the method [`$get()`](https://docs.ropensci.org/crul/reference/HttpClient.html#method-get) of the parent class. -The get method will query the APIs and return an R6 object of class `crul::HttpClient`. +Hence, the `get` method will query the APIs and return an R6 object of class `crul::HttpResponse`. -```{r include=FALSE} -vcr::use_cassette("kobo-assets", { - assets <- my_session$get(path = "api/v2/assets/") +```{r include=FALSE, results='hide'} +vcr::use_cassette("get-assets", { + assets <- my_session$get(path = "api/v2/assets/", query = list(format = "json")) }) ``` @@ -101,38 +100,46 @@ assets <- my_session$get(path = "api/v2/assets/") ``` ```{r} -str(assets, max.level = 2) +str(assets, max.level = 1) ``` -# The use of KoboClient in the Kobo interface -The Kobo interface uses KoboClient for its HTTP requests. -Kobo can create a session by initializing a KoboClient instance, or the user can pass a session, a KoboClient instance associated with an API base URL. -Since the API_v2 base URL -can be different from the API_v1 one, when the user provides the `base_url_v1`, the Kobo interface prepares a second KoboClient instance to communicate with the v1 version of the APIs. +# The use of KoboClient in the Kobo class + +The `Kobo` class uses `KoboClient` for its HTTP requests. +Kobo can create a session by initializing a `KoboClient` instance itself based on `base_url_v2`. This is probably the easiest way to initialize a `Kobo` instance. -The user can create their KoboClient instance and then pass it to the Kobo interface. The Kobo interface will use the session for all the communication with the servers. +```{r} +kobo <- Kobo$new(base_url) +``` + +Alternatively, the user can pass a session - a `KoboClient` instance associated with an API base URL - via the `session_v2` argument of `Kobo$new()`. The Kobo instance will then use this session for all the communication with the servers. ```{r} +# passing a KoboClient instance / a session to Kobo my_session <- KoboClient$new(base_url) kobo <- Kobo$new(session_v2 = my_session) ``` +If the user specifies `base_url_v1` as an argument to `Kobo$new()` to make use of functionality based on KoBoToolbox API v1, the initializer of `Kobo` will initialize a second `KoboClient` instance to communicate with the v1 version of the API. The `Kobo` instance will then have two sessions, one for v2 and one for v1. - -```{r eval=FALSE} -assets <- kobo$get_assets() +```{r} +# specifying session for API v2 directly, but letting Kobo initialize the one for API v1 +kobo <- Kobo$new(session_v2 = my_session, base_url_v1 = "kc.correlaid.org") +kobo ``` + ```{r include=FALSE} -vcr::use_cassette("kobo-assets2", { +vcr::use_cassette("get-assets", { assets <- kobo$get_assets() }) ``` -```{r echo=FALSE} -head(assets) +```{r eval=FALSE} +assets <- kobo$get_assets() +``` +```{r} +colnames(assets) ``` - - diff --git a/vignettes/articles/wrangling_survey_responses.Rmd b/vignettes/wrangling-survey-responses.Rmd similarity index 92% rename from vignettes/articles/wrangling_survey_responses.Rmd rename to vignettes/wrangling-survey-responses.Rmd index 8904fce..574da6e 100644 --- a/vignettes/articles/wrangling_survey_responses.Rmd +++ b/vignettes/wrangling-survey-responses.Rmd @@ -1,9 +1,13 @@ --- -title: "Wrangling form submissions" +title: "Data wrangling of responses" output: html_document: toc: yes toc_depth: 3 +vignette: > + %\VignetteIndexEntry{Data wrangling of responses} + %\VignetteEngine{knitr::rmarkdown} + %\VignetteEncoding{UTF-8} --- ```{r, include = FALSE} @@ -30,7 +34,7 @@ BASE_URL <- "https://kobo.correlaid.org" ```{r include=FALSE} # properly set up vcr library(vcr) -vcr_dir <- "." +vcr_dir <- "./assets" if (!nzchar(Sys.getenv("KBTBR_TOKEN"))) { if (dir.exists(vcr_dir)) { # Fake API token to fool our package @@ -56,7 +60,7 @@ kobo <- Kobo$new(base_url_v2 = BASE_URL, kobo_token = Sys.getenv("KBTBR_TOKEN")) # this only executes if kobo-asset-submissions-data.yml is not present -vcr::use_cassette("kobo-asset-submissions-data", { +vcr::use_cassette("get-submissions", { submissions_df <- kobo$get_submissions("aRo4wg5utWT7dwdnQQEAE7") }) ``` @@ -75,7 +79,7 @@ Let's look at the column names: colnames(submissions_df) ``` -The form contains questions of several of the available types in KoboToolbox. The whole list of available types can be found [here](https://support.kobotoolbox.org/question_types.html). More information also on the [xlsform](https://xlsform.org/en/) page. +The form contains questions of several of the available types in KoBoToolbox. The whole list of available types can be found [here](https://support.kobotoolbox.org/question_types.html). More information also on the [xlsform](https://xlsform.org/en/) page. Our test form includes: @@ -156,7 +160,7 @@ submissions_df <- renamed_except_rating ### Type conversion In general, the KoBoToolbox API will return all data as character vectors. Hence, conversion is necessary where applicable. -To convert multiple columns at once, you can use [`dplyr::across`](https://dplyr.tidyverse.org/reference/across.html) in combination with the [tidyselect helpers](https://tidyselect.r-lib.org/reference/select_helpers.html): +To convert multiple columns at once, you can use `dplyr::across` in combination with the [tidyselect helpers](https://tidyselect.r-lib.org/reference/select_helpers.html): To check which columns need converting: @@ -182,7 +186,8 @@ glimpse(submissions_df) ``` ### Location/Point type -For the geographic point question type where respondents can pick a location on a map, the response is returned as a character vector which contains the following elements seperated by whitespace: +For the geographic point question type where respondents can pick a location on a map, the response is returned as a character vector which contains the following elements separated by whitespace: + - latitude - longitude - altitude @@ -212,7 +217,7 @@ submissions_df %>% For rating questions - the question type corresponding to Likert scale type question matrices - one column is returned for each "subquestion". For example: -![](rating_question.png) +![](assets/rating_question.png) will be returned as six columns starting with the question label for the whole question, in this case `importance_in_life`: @@ -237,7 +242,7 @@ imp_life_long library(ggplot2) imp_life_long %>% group_by(category) %>% - summarize(mean_level = mean(level)) %>% + summarize(mean_level = mean(level, na.rm = TRUE)) %>% ggplot(aes(x = category, y = mean_level)) + geom_col() + coord_flip() + From c3402af129cba5eba72597b3aae0cf8ced5e87b8 Mon Sep 17 00:00:00 2001 From: Frie Date: Mon, 24 Jan 2022 15:03:50 +0100 Subject: [PATCH 25/57] do not print warning for not specifying v1 url (no consequences as of now) --- R/kobo.R | 4 ++-- tests/testthat/test-kobo.R | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/R/kobo.R b/R/kobo.R index 7c8f4bf..87b18bf 100644 --- a/R/kobo.R +++ b/R/kobo.R @@ -50,8 +50,8 @@ Kobo <- R6::R6Class("Kobo", } else if (!checkmate::test_null(session_v1)) { self$session_v1 <- session_v1 } else { - # TODO: add to warning once we know what functnality is covered by v1. - usethis::ui_info("You have not passed base_url_v1. This means you cannot use the following functions:") + # TODO: add to warning once we add functionality enabled by v1 only + # usethis::ui_info("You have not passed base_url_v1. You cannot use the following functions:") } }, #' @description diff --git a/tests/testthat/test-kobo.R b/tests/testthat/test-kobo.R index a7517f2..e6885b2 100644 --- a/tests/testthat/test-kobo.R +++ b/tests/testthat/test-kobo.R @@ -54,6 +54,7 @@ test_that("Kobo is initialized correctly if we provide a KoboClient instance", { }) test_that("we get a message if we do not specify base_url_v1, but Kobo is initialized.", { + testthat::skip("skipping because currently this message is not printed because no functionality depends on v1 API") expect_message( { kobo_obj <- Kobo$new(base_url_v2 = BASE_URL, kobo_token = "foo") @@ -65,6 +66,7 @@ test_that("we get a message if we do not specify base_url_v1, but Kobo is initia c("Kobo", "R6") ) }) + #' ----------------------------------------------------------------------------- #' Testing $get_* methods test_that("Request to v1 throws error if v1 session is not initialized", { From b8fe2bf2f4da8d597866362eb9d2f0e13d016033 Mon Sep 17 00:00:00 2001 From: Frie Date: Mon, 24 Jan 2022 15:30:17 +0100 Subject: [PATCH 26/57] readme update and code of conduct/contributing.md --- CODE_OF_CONDUCT.md | 1 + CONTRIBUTING.md | 42 ++++++++++++++++++++++++++++++++++++++++++ README.Rmd | 25 +++++++++++++++++-------- README.md | 33 +++++++++++++++++++++++---------- 4 files changed, 83 insertions(+), 18 deletions(-) create mode 100644 CODE_OF_CONDUCT.md create mode 100644 CONTRIBUTING.md diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..dab5df8 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1 @@ +`kbtbr` was initiated within [CorrelAid](https://correlaid.org). As such, it falls under the [CorrelAid Code of Conduct](https://correlaid.org/about/codeofconduct/). diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..33a6b5b --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,42 @@ +# How to contribute to kbtbr + +## Code of Conduct +`kbtbr` was initiated within [CorrelAid](https://correlaid.org). As such, it falls under the [CorrelAid Code of Conduct](https://correlaid.org/about/codeofconduct/). + +## Reporting issues +Issue reports are always welcome. Please provide a [Reprex](https://www.tidyverse.org/help/) if possible. This might not be possible because of the nature of the `kbtbr` package. In this case, please describe your problem as well as possible, including screenshots and HTTP responses (excluding sensitive data such as API tokens). + +## Contribute +We welcome contributions in the form of Pull Requests. Before opening a PR, please open an issue describing what problem you'd like to be working on so that the maintainers can discuss the issue with you and propose feasible solution approaches. + +### Code styling +Please style any code with the following [styler](https://styler.r-lib.org/) command: + +```r +styler::style_pkg(style = styler::tidyverse_style, indent_by = 4) +``` +### Package development workflow + +#### Branching model +We follow a [feature (or topic) branching workflow](https://git-scm.com/book/en/v2/Git-Branching-Branching-Workflows). This means that you should create a new Git branch for each issue (or set of related issues) that you are working on. The branch name should contain the issue number to allow for easier cross-referencing. + +#### Long-lived branches + +- `main`: default branch. Should only contain the releases of the package + hotfixes (small, critical bug fixes that can't wait until the next release) +- `dev`: this is where we develop and branch off the feature branches + +#### Short-lived branches +Short-lived branches for feature development and bugfixes ("feature branches") should be branched off from the `dev` branch. + +```bash +# create branch from dev branch +git checkout dev +git switch -c 1-project-skeleton # or git checkout -b 1-project-skeleton +# ... work on your branch with add, commit, push +``` + +before making a Pull Request to `dev`, pull in the changes from the `dev` branch to avoid running into merge conflicts. With your feature branch checked out, run: + +```bash +git merge dev +``` diff --git a/README.Rmd b/README.Rmd index ca448e0..bf61b87 100644 --- a/README.Rmd +++ b/README.Rmd @@ -13,26 +13,35 @@ output: github_document knitr::opts_chunk$set(echo = TRUE) ``` -`kbtbr` is a wrapper for the [KoBoToolbox APIs](https://support.kobotoolbox.org/api.html). It focuses on API v2 but also makes use of v1 if required. +`kbtbr` is a wrapper for the [KoBoToolbox APIs](https://support.kobotoolbox.org/api.html). It focuses on API v2 but also makes use of v1 if required (currently no dependencies on v1). `kbtbr` not only allows you to pull answers to your surveys directly into your R session but also lets you create and clone assets and import XLS forms straight from your R console. Finally, it provides flexible low-level functions to implement functionalities currently missing from the package yourself. # Installation `kbtbr` is not on CRAN yet. You can install the current version from GitHub: ```{r installation, eval=FALSE} -# using remotes remotes::install_github("CorrelAid/kbtbr") +``` + +Install the development version (unstable!) -# using devtools -devtools::install_github("CorrelAid/kbtbr") +```{r installation-dev, eval=FALSE} +remotes::install_github("CorrelAid/kbtbr", ref = "dev") ``` # Get started -Check out the _Get started_: +```{r eval=FALSE} +library(kbtbr) +# replace with https://kobo.humanitarianresponse.info for the humanitarian server or your own if you self-host +base_url_v2 <- "https://kf.kobotoolbox.org" +token <- Sys.getenv("KBTBR_TOKEN") + +kobo <- Kobo$new(base_url_v2, base_url_v1, token) +kobo$get_surveys() +``` -- [stable version](https://correlaid.github.io/kbtbr/get-started) -- [development version](https://correlaid.github.io/kbtbr/dev/get-started) +See the documentation for more! # Documentation @@ -43,4 +52,4 @@ Documentation is available as a [`pkgdown`](https://pkgdown.r-lib.org/) website: # Contributing to kbtbr -See the [CONTRIBUTING.md](https://github.com/correlaid/kbtbr/blob/main/.github/CONTRIBUTING.md). +Please refer to the [CONTRIBUTING.md](https://github.com/correlaid/kbtbr/blob/main/.github/CONTRIBUTING.md). diff --git a/README.md b/README.md index ec63325..cfde2fc 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,12 @@ coverage](https://codecov.io/gh/CorrelAid/kbtbr/branch/main/graph/badge.svg)](ht `kbtbr` is a wrapper for the [KoBoToolbox APIs](https://support.kobotoolbox.org/api.html). It focuses on API v2 -but also makes use of v1 if required. +but also makes use of v1 if required (currently no dependencies on v1). +`kbtbr` not only allows you to pull answers to your surveys directly +into your R session but also lets you create and clone assets and import +XLS forms straight from your R console. Finally, it provides flexible +low-level functions to implement functionalities currently missing from +the package yourself. # Installation @@ -20,28 +25,36 @@ but also makes use of v1 if required. GitHub: ``` r -# using remotes remotes::install_github("CorrelAid/kbtbr") +``` + +Install the development version (unstable!) -# using devtools -devtools::install_github("CorrelAid/kbtbr") +``` r +remotes::install_github("CorrelAid/kbtbr", ref = "dev") ``` # Get started -Check out the *Get started*: +``` r +library(kbtbr) +# replace with https://kobo.humanitarianresponse.info for the humanitarian server or your own if you self-host +base_url_v2 <- "https://kf.kobotoolbox.org" +token <- Sys.getenv("KBTBR_TOKEN") + +kobo <- Kobo$new(base_url_v2, base_url_v1, token) +kobo$get_surveys() +``` - - [stable version](https://correlaid.github.io/kbtbr/get-started) - - [development - version](https://correlaid.github.io/kbtbr/dev/get-started) +See the documentation for more! # Documentation Documentation is available as a [`pkgdown`](https://pkgdown.r-lib.org/) website: - - [stable version](https://correlaid.github.io/kbtbr/) - - [development version](https://correlaid.github.io/kbtbr/dev/) +- [stable version](https://correlaid.github.io/kbtbr/) +- [development version](https://correlaid.github.io/kbtbr/dev/) # Contributing to kbtbr From 2d14c62e46c8f4e66add475d864c5b5ff60d2c70 Mon Sep 17 00:00:00 2001 From: Frie Date: Mon, 24 Jan 2022 17:56:09 +0100 Subject: [PATCH 27/57] different landing pages for github and pkgdown --- README.Rmd | 1 + README.md | 2 +- pkgdown/index.Rmd | 54 +++++++++++++++++++++++++++++++++++++++ pkgdown/index.md | 64 +++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 120 insertions(+), 1 deletion(-) create mode 100644 pkgdown/index.Rmd create mode 100644 pkgdown/index.md diff --git a/README.Rmd b/README.Rmd index bf61b87..eb462c6 100644 --- a/README.Rmd +++ b/README.Rmd @@ -1,3 +1,4 @@ + --- title: "kbtbr" output: github_document diff --git a/README.md b/README.md index cfde2fc..623686b 100644 --- a/README.md +++ b/README.md @@ -58,5 +58,5 @@ website: # Contributing to kbtbr -See the +Please refer to the [CONTRIBUTING.md](https://github.com/correlaid/kbtbr/blob/main/.github/CONTRIBUTING.md). diff --git a/pkgdown/index.Rmd b/pkgdown/index.Rmd new file mode 100644 index 0000000..cf229e7 --- /dev/null +++ b/pkgdown/index.Rmd @@ -0,0 +1,54 @@ +--- +title: "kbtbr" +output: github_document +--- + + +[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental) +[![R-CMD-check](https://github.com/CorrelAid/kbtbr/workflows/R-CMD-check/badge.svg)](https://github.com/CorrelAid/kbtbr/actions) +[![Codecov test coverage](https://codecov.io/gh/CorrelAid/kbtbr/branch/main/graph/badge.svg)](https://codecov.io/gh/CorrelAid/kbtbr?branch=main) + + +```{r setup, include=FALSE} +knitr::opts_chunk$set(echo = TRUE) +``` + +`kbtbr` is a wrapper for the [KoBoToolbox APIs](https://support.kobotoolbox.org/api.html). It focuses on API v2 but also makes use of v1 if required (currently no dependencies on v1). `kbtbr` not only allows you to pull answers to your surveys directly into your R session but also lets you create and clone assets and import XLS forms straight from your R console. Finally, it provides flexible low-level functions to implement functionalities currently missing from the package yourself. + +# Installation + +`kbtbr` is not on CRAN yet. You can install the current version from GitHub: + +```{r installation, eval=FALSE} +remotes::install_github("CorrelAid/kbtbr") +``` + +Install the development version (unstable!) + +```{r installation-dev, eval=FALSE} +remotes::install_github("CorrelAid/kbtbr", ref = "dev") +``` + +# Get started + +```{r eval=FALSE} +library(kbtbr) +# replace with https://kobo.humanitarianresponse.info for the humanitarian server or your own if you self-host +base_url_v2 <- "https://kf.kobotoolbox.org" +token <- Sys.getenv("KBTBR_TOKEN") + +kobo <- Kobo$new(base_url_v2, base_url_v1, token) +kobo$get_surveys() +``` + +See the [Get started](articles/kbtbr.html) and the other [articles](articles/index.html) for more examples! + +# Limitations +The following limitations of `kbtbr` are known to the developers: + +- not all endpoints have dedicated functions in the `Kobo` class. This is a conscious choice. Implementing high-level functions for all endpoints would be a lot of work. +- no support for pagination + +# Contributing to kbtbr + +Please refer to the [CONTRIBUTING.md](https://github.com/correlaid/kbtbr/blob/main/.github/CONTRIBUTING.md). diff --git a/pkgdown/index.md b/pkgdown/index.md new file mode 100644 index 0000000..9f066d5 --- /dev/null +++ b/pkgdown/index.md @@ -0,0 +1,64 @@ +kbtbr +================ + + + +[![Lifecycle: +experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental) +[![R-CMD-check](https://github.com/CorrelAid/kbtbr/workflows/R-CMD-check/badge.svg)](https://github.com/CorrelAid/kbtbr/actions) +[![Codecov test +coverage](https://codecov.io/gh/CorrelAid/kbtbr/branch/main/graph/badge.svg)](https://codecov.io/gh/CorrelAid/kbtbr?branch=main) + + +`kbtbr` is a wrapper for the [KoBoToolbox +APIs](https://support.kobotoolbox.org/api.html). It focuses on API v2 +but also makes use of v1 if required (currently no dependencies on v1). +`kbtbr` not only allows you to pull answers to your surveys directly +into your R session but also lets you create and clone assets and import +XLS forms straight from your R console. Finally, it provides flexible +low-level functions to implement functionalities currently missing from +the package yourself. + +# Installation + +`kbtbr` is not on CRAN yet. You can install the current version from +GitHub: + +``` r +remotes::install_github("CorrelAid/kbtbr") +``` + +Install the development version (unstable!) + +``` r +remotes::install_github("CorrelAid/kbtbr", ref = "dev") +``` + +# Get started + +``` r +library(kbtbr) +# replace with https://kobo.humanitarianresponse.info for the humanitarian server or your own if you self-host +base_url_v2 <- "https://kf.kobotoolbox.org" +token <- Sys.getenv("KBTBR_TOKEN") + +kobo <- Kobo$new(base_url_v2, base_url_v1, token) +kobo$get_surveys() +``` + +See the [Get started](articles/kbtbr.html) and the other +[articles](articles/index.html) for more examples! + +# Limitations + +The following limitations of `kbtbr` are known to the developers: + +- not all endpoints have dedicated functions in the `Kobo` class. This + is a conscious choice. Implementing high-level functions for all + endpoints would be a lot of work. +- no support for pagination + +# Contributing to kbtbr + +Please refer to the +[CONTRIBUTING.md](https://github.com/correlaid/kbtbr/blob/main/.github/CONTRIBUTING.md). From 02cd7b816f10c15765a3f31365df8574f55de52a Mon Sep 17 00:00:00 2001 From: Frie Date: Mon, 24 Jan 2022 17:56:49 +0100 Subject: [PATCH 28/57] code of conduct and contributing md --- .github/CONTRIBUTING.md | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index f38e9e7..33a6b5b 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -1,36 +1,42 @@ -# Contributing to kbtbr +# How to contribute to kbtbr ## Code of Conduct -By contributing to this project, you agree to abide by the terms of the [CorrelAid Code of Conduct](https://correlaid.org/about/codeofconduct/). For more technical details on how to contribute, see the [CONTRIBUTING.md](https://github.com/correlaid/kbtbr/blob/main/.github/CONTRIBUTING.md). +`kbtbr` was initiated within [CorrelAid](https://correlaid.org). As such, it falls under the [CorrelAid Code of Conduct](https://correlaid.org/about/codeofconduct/). -## Code styling +## Reporting issues +Issue reports are always welcome. Please provide a [Reprex](https://www.tidyverse.org/help/) if possible. This might not be possible because of the nature of the `kbtbr` package. In this case, please describe your problem as well as possible, including screenshots and HTTP responses (excluding sensitive data such as API tokens). + +## Contribute +We welcome contributions in the form of Pull Requests. Before opening a PR, please open an issue describing what problem you'd like to be working on so that the maintainers can discuss the issue with you and propose feasible solution approaches. + +### Code styling Please style any code with the following [styler](https://styler.r-lib.org/) command: ```r -styler::style_pkg(style = styler::tidyverse_style, indent_by = 4) +styler::style_pkg(style = styler::tidyverse_style, indent_by = 4) ``` -## Package development workflow +### Package development workflow -## Branching model +#### Branching model We follow a [feature (or topic) branching workflow](https://git-scm.com/book/en/v2/Git-Branching-Branching-Workflows). This means that you should create a new Git branch for each issue (or set of related issues) that you are working on. The branch name should contain the issue number to allow for easier cross-referencing. -### Long-lived branches +#### Long-lived branches - `main`: default branch. Should only contain the releases of the package + hotfixes (small, critical bug fixes that can't wait until the next release) - `dev`: this is where we develop and branch off the feature branches -### Short-lived branches -Short-lived branches for feature development and bugfixes ("feature branches") should be branched off from the `dev` branch. +#### Short-lived branches +Short-lived branches for feature development and bugfixes ("feature branches") should be branched off from the `dev` branch. ```bash # create branch from dev branch -git checkout dev +git checkout dev git switch -c 1-project-skeleton # or git checkout -b 1-project-skeleton -# ... work on your branch with add, commit, push +# ... work on your branch with add, commit, push ``` -before making a Pull Request to `dev`, pull in the changes from the `dev` branch to avoid running into merge conflicts. With your feature branch checked out, run: +before making a Pull Request to `dev`, pull in the changes from the `dev` branch to avoid running into merge conflicts. With your feature branch checked out, run: ```bash -git merge dev +git merge dev ``` From 2037a1c545777eff7204ee7340f6084c157b6054 Mon Sep 17 00:00:00 2001 From: Frie Date: Mon, 24 Jan 2022 18:43:34 +0100 Subject: [PATCH 29/57] fix rcmdcheck note re non used imports --- DESCRIPTION | 7 +++-- NAMESPACE | 2 ++ R/kobo.R | 16 +++++----- man/Kobo.Rd | 39 ++++++++++++++++++------ vignettes/kbtbr.Rmd | 8 ++--- vignettes/koboclient-class.Rmd | 2 +- vignettes/wrangling-survey-responses.Rmd | 2 +- 7 files changed, 49 insertions(+), 27 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 4f8eb3c..604c999 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -22,7 +22,8 @@ Suggests: vcr, withr, dplyr, - tidyr + tidyr, + knitr Config/testthat/edition: 3 Imports: crul, @@ -31,7 +32,7 @@ Imports: magrittr, jsonlite, glue, - tibble, - janitor + tibble Roxygen: list(markdown = TRUE) RoxygenNote: 7.1.1 +VignetteBuilder: knitr diff --git a/NAMESPACE b/NAMESPACE index ce209c7..456b5d6 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -5,5 +5,7 @@ export(Kobo) export(KoboClient) importFrom(checkmate,assert_character) importFrom(crul,HttpClient) +importFrom(glue,glue) importFrom(magrittr,"%>%") +importFrom(tibble,tibble) importFrom(usethis,ui_stop) diff --git a/R/kobo.R b/R/kobo.R index 87b18bf..a723f12 100644 --- a/R/kobo.R +++ b/R/kobo.R @@ -1,6 +1,6 @@ #' @title Kobo Class #' @description -#' Interface object for the Kobo API that can handle KoboClient instances +#' Interface object for the Kobo API that can handle [KoboClient] instances #' (sessions) for both API versions. #' The Class exposes both generic and specific methods for HTTP requests / #' interactions with the various endpoints. @@ -9,9 +9,9 @@ Kobo <- R6::R6Class("Kobo", # private = list( # ), public = list( - #' @field session_v2 KoboClient session for v2 of the API + #' @field session_v2 [kbtbr::KoboClient] session for v2 of the API session_v2 = NULL, - #' @field session_v1 KoboClient session for v1 of the API + #' @field session_v1 `KoboClient` session for v1 of the API session_v1 = NULL, #' @description @@ -23,10 +23,10 @@ Kobo <- R6::R6Class("Kobo", #' For example: https://kc.correlaid.org. #' @param kobo_token character. The API token. Defaults to requesting #' the systen environment `KBTBR_TOKEN`. - #' @param session_v2 KoboClient. Alternatively, pass directly - #' a KoboClient instance for the API version v2. - #' @param session_v1 KoboKlient. In addition to session_v2 one can pass - #' also a KoboClient instance for the API version v1. + #' @param session_v2 [KoboClient] To pass directly + #' a [KoboClient] instance for the API version v2. + #' @param session_v1 [KoboClient] In addition to session_v2 one can pass + #' also a [KoboClient] instance for the API version v1. initialize = function(base_url_v2 = NULL, base_url_v1 = NULL, kobo_token = Sys.getenv("KBTBR_TOKEN"), session_v2 = NULL, session_v1 = NULL) { @@ -145,6 +145,7 @@ Kobo <- R6::R6Class("Kobo", #' @description #' Returns a list of all assets available in the server as tibble + #' @importFrom tibble tibble get_assets = function() { return(tibble::tibble(self$get("assets/")$results)) }, @@ -174,6 +175,7 @@ Kobo <- R6::R6Class("Kobo", #' Get an asset given its id. #' @param id character. ID of the asset within the Kobo API. #' @return Asset. object of class [kbtbr::Asset] + #' @importFrom glue glue get_asset = function(id) { res <- self$get(glue::glue("assets/{id}/")) Asset$new(res, self) diff --git a/man/Kobo.Rd b/man/Kobo.Rd index a79a617..4fd2a31 100644 --- a/man/Kobo.Rd +++ b/man/Kobo.Rd @@ -4,7 +4,7 @@ \alias{Kobo} \title{Kobo Class} \description{ -Interface object for the Kobo API that can handle KoboClient instances +Interface object for the Kobo API that can handle \link{KoboClient} instances (sessions) for both API versions. The Class exposes both generic and specific methods for HTTP requests / interactions with the various endpoints. @@ -12,9 +12,9 @@ interactions with the various endpoints. \section{Public fields}{ \if{html}{\out{
}} \describe{ -\item{\code{session_v2}}{KoboClient session for v2 of the API} +\item{\code{session_v2}}{\link{KoboClient} session for v2 of the API} -\item{\code{session_v1}}{KoboClient session for v1 of the API} +\item{\code{session_v1}}{\code{KoboClient} session for v1 of the API} } \if{html}{\out{
}} } @@ -25,6 +25,7 @@ interactions with the various endpoints. \item \href{#method-get}{\code{Kobo$get()}} \item \href{#method-post}{\code{Kobo$post()}} \item \href{#method-get_assets}{\code{Kobo$get_assets()}} +\item \href{#method-get_surveys}{\code{Kobo$get_surveys()}} \item \href{#method-get_asset}{\code{Kobo$get_asset()}} \item \href{#method-get_submissions}{\code{Kobo$get_submissions()}} \item \href{#method-clone_asset}{\code{Kobo$clone_asset()}} @@ -62,11 +63,11 @@ For example: https://kc.correlaid.org.} \item{\code{kobo_token}}{character. The API token. Defaults to requesting the systen environment \code{KBTBR_TOKEN}.} -\item{\code{session_v2}}{KoboClient. Alternatively, pass directly -a KoboClient instance for the API version v2.} +\item{\code{session_v2}}{\link{KoboClient} To pass directly +a \link{KoboClient} instance for the API version v2.} -\item{\code{session_v1}}{KoboKlient. In addition to session_v2 one can pass -also a KoboClient instance for the API version v1.} +\item{\code{session_v1}}{\link{KoboClient} In addition to session_v2 one can pass +also a \link{KoboClient} instance for the API version v1.} } \if{html}{\out{}} } @@ -131,12 +132,32 @@ Returns an object of class \code{crul::HttpResponse}. \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-get_assets}{}}} \subsection{Method \code{get_assets()}}{ -Example method to send a GET request to the \code{assets} endpoint -(due to default to \code{v2}, no further specification is needed). +Returns a list of all assets available in the server as tibble \subsection{Usage}{ \if{html}{\out{
}}\preformatted{Kobo$get_assets()}\if{html}{\out{
}} } +} +\if{html}{\out{
}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-get_surveys}{}}} +\subsection{Method \code{get_surveys()}}{ +High-level GET request for \code{surveys} endpoints endpoint +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{Kobo$get_surveys(show_all_cols = FALSE)}\if{html}{\out{
}} +} + +\subsection{Arguments}{ +\if{html}{\out{
}} +\describe{ +\item{\code{show_all_cols}}{if true returns all the columns available +for an asset} +} +\if{html}{\out{
}} +} +\subsection{Returns}{ +An user-friendly summary of the available surveys as a tibble +} } \if{html}{\out{
}} \if{html}{\out{}} diff --git a/vignettes/kbtbr.Rmd b/vignettes/kbtbr.Rmd index 4485e03..d931e8f 100644 --- a/vignettes/kbtbr.Rmd +++ b/vignettes/kbtbr.Rmd @@ -3,17 +3,13 @@ title: "Get started" output: rmarkdown::html_vignette vignette: > %\VignetteIndexEntry{Get started} - %\VignetteEngine{knitr::rmarkdown} + %\VignetteEngine{knitr::knitr} %\VignetteEncoding{UTF-8} --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE, eval = TRUE) -library(dplyr) -library(purrr) -library(tidyr) - # properly set up vcr library(vcr) @@ -153,7 +149,7 @@ submissions <- kobo$get_submissions(test_id) ``` ```{r} -glimpse(submissions) +str(submissions) ``` Check out [Data wrangling of responses](/articles/wrangling-survey-responses.html) to see how to handle messy column names. diff --git a/vignettes/koboclient-class.Rmd b/vignettes/koboclient-class.Rmd index f32b07a..4483409 100644 --- a/vignettes/koboclient-class.Rmd +++ b/vignettes/koboclient-class.Rmd @@ -4,7 +4,7 @@ date: "`r Sys.Date()`" output: rmarkdown::html_vignette vignette: > %\VignetteIndexEntry{Advanced: The KoboClient class} - %\VignetteEngine{knitr::rmarkdown} + %\VignetteEngine{knitr::knitr} %\VignetteEncoding{UTF-8} --- diff --git a/vignettes/wrangling-survey-responses.Rmd b/vignettes/wrangling-survey-responses.Rmd index 574da6e..9c112cc 100644 --- a/vignettes/wrangling-survey-responses.Rmd +++ b/vignettes/wrangling-survey-responses.Rmd @@ -6,7 +6,7 @@ output: toc_depth: 3 vignette: > %\VignetteIndexEntry{Data wrangling of responses} - %\VignetteEngine{knitr::rmarkdown} + %\VignetteEngine{knitr::knitr} %\VignetteEncoding{UTF-8} --- From 697c4cdf5cc408ef71f89020abe407638f69c427 Mon Sep 17 00:00:00 2001 From: Malte Kyhos Date: Fri, 28 Jan 2022 18:43:38 +0100 Subject: [PATCH 30/57] Remove dependency: glue --- DESCRIPTION | 1 - NAMESPACE | 1 - R/asset.R | 8 +++++--- R/kobo.R | 3 +-- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 604c999..952bec1 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -31,7 +31,6 @@ Imports: checkmate, magrittr, jsonlite, - glue, tibble Roxygen: list(markdown = TRUE) RoxygenNote: 7.1.1 diff --git a/NAMESPACE b/NAMESPACE index 62395cc..22a0138 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -5,7 +5,6 @@ export(Kobo) export(KoboClient) import(checkmate) importFrom(crul,HttpClient) -importFrom(glue,glue) importFrom(magrittr,"%>%") importFrom(tibble,tibble) importFrom(usethis,ui_stop) diff --git a/R/asset.R b/R/asset.R index 854078d..b833ae5 100644 --- a/R/asset.R +++ b/R/asset.R @@ -77,8 +77,10 @@ Asset <- R6::R6Class("Asset", # check that everything exists in list that we need needed_names <- c("uid", "name", "url", "data", "owner__username", "asset_type") if (!test_subset(needed_names, names(asset_list))) { - missing_elements <- setdiff(needed_names, names(asset_list)) %>% paste(collapse = ", ") - usethis::ui_stop(glue::glue("Argument asset_list is missing the following required elements: {missing_elements}")) + missing_elements <- setdiff(needed_names, names(asset_list)) + usethis::ui_stop( + sprintf("Argument asset_list is missing the following required elements: %s", toString(missing_elements)) + ) } private$.uid <- asset_list$uid @@ -100,7 +102,7 @@ Asset <- R6::R6Class("Asset", if (private$.type != "survey") { usethis::ui_stop("Only valid for assets of type 'survey'. Current asset is of type '{private$.type}'.") } - path <- glue::glue("assets/{private$.uid}/data/") + path <- sprintf("assets/%s/data/", private$.uid) private$.kobo$get(path)$results %>% tibble::as_tibble() }, diff --git a/R/kobo.R b/R/kobo.R index 1a5719e..221d4e7 100644 --- a/R/kobo.R +++ b/R/kobo.R @@ -174,9 +174,8 @@ Kobo <- R6::R6Class("Kobo", #' Get an asset given its id. #' @param id character. ID of the asset within the Kobo API. #' @return Asset. object of class [kbtbr::Asset] - #' @importFrom glue glue get_asset = function(id) { - res <- self$get(glue::glue("assets/{id}/")) + res <- self$get(sprintf("assets/%s/", id)) Asset$new(res, self) }, From dcd1793f4bda1d1799d374cd9e5956b166c0be75 Mon Sep 17 00:00:00 2001 From: Malte Kyhos Date: Fri, 28 Jan 2022 18:54:39 +0100 Subject: [PATCH 31/57] Import usethis::ui_ funs once for all --- R/asset.R | 16 ++++++++-------- R/kobo-client.R | 3 +-- R/kobo.R | 16 ++++++++-------- R/zzz.R | 5 +++++ 4 files changed, 22 insertions(+), 18 deletions(-) diff --git a/R/asset.R b/R/asset.R index b833ae5..e9e8959 100644 --- a/R/asset.R +++ b/R/asset.R @@ -8,7 +8,7 @@ Asset <- R6::R6Class("Asset", if (missing(value)) { return(private$.uid) } else { - usethis::ui_stop("Read-only.") + ui_stop("Read-only.") } }, #' @field name @@ -17,7 +17,7 @@ Asset <- R6::R6Class("Asset", if (missing(value)) { return(private$.name) } else { - usethis::ui_stop("Read-only.") + ui_stop("Read-only.") } }, #' @field asset_url @@ -28,7 +28,7 @@ Asset <- R6::R6Class("Asset", if (missing(value)) { return(private$.asset_url) } else { - usethis::ui_stop("Read-only.") + ui_stop("Read-only.") } }, #' @field data_url @@ -39,7 +39,7 @@ Asset <- R6::R6Class("Asset", if (missing(value)) { return(private$.data_url) } else { - usethis::ui_stop("Read-only.") + ui_stop("Read-only.") } }, #' @field owner_username @@ -48,7 +48,7 @@ Asset <- R6::R6Class("Asset", if (missing(value)) { return(private$.owner_username) } else { - usethis::ui_stop("Read-only.") + ui_stop("Read-only.") } }, #' @field type @@ -57,7 +57,7 @@ Asset <- R6::R6Class("Asset", if (missing(value)) { return(private$.type) } else { - usethis::ui_stop("Read-only.") + ui_stop("Read-only.") } } ), @@ -78,7 +78,7 @@ Asset <- R6::R6Class("Asset", needed_names <- c("uid", "name", "url", "data", "owner__username", "asset_type") if (!test_subset(needed_names, names(asset_list))) { missing_elements <- setdiff(needed_names, names(asset_list)) - usethis::ui_stop( + ui_stop( sprintf("Argument asset_list is missing the following required elements: %s", toString(missing_elements)) ) } @@ -100,7 +100,7 @@ Asset <- R6::R6Class("Asset", #' @return tibble. submissions as a tibble. if no submissions were made yet, the tibble will have no columns. get_submissions = function() { if (private$.type != "survey") { - usethis::ui_stop("Only valid for assets of type 'survey'. Current asset is of type '{private$.type}'.") + ui_stop("Only valid for assets of type 'survey'. Current asset is of type '{private$.type}'.") } path <- sprintf("assets/%s/data/", private$.uid) private$.kobo$get(path)$results %>% diff --git a/R/kobo-client.R b/R/kobo-client.R index c0a4f64..da5d6c8 100644 --- a/R/kobo-client.R +++ b/R/kobo-client.R @@ -2,7 +2,6 @@ #' @description #' A class to interact with the KoboToolbox API, extending [`crul::HttpClient`]. #' @importFrom crul HttpClient -#' @importFrom usethis ui_stop #' @export KoboClient <- R6::R6Class("KoboClient", inherit = crul::HttpClient, @@ -23,7 +22,7 @@ KoboClient <- R6::R6Class("KoboClient", # Check and set private fields assert_character(kobo_token) if (kobo_token == "") { - usethis::ui_stop( + ui_stop( "No valid token detected. Set the KBTBR_TOKEN environment variable or pass the token directly to the function (not recommended)." diff --git a/R/kobo.R b/R/kobo.R index 221d4e7..7a77c19 100644 --- a/R/kobo.R +++ b/R/kobo.R @@ -51,7 +51,7 @@ Kobo <- R6::R6Class("Kobo", self$session_v1 <- session_v1 } else { # TODO: add to warning once we add functionality enabled by v1 only - # usethis::ui_info("You have not passed base_url_v1. You cannot use the following functions:") + # ui_info("You have not passed base_url_v1. You cannot use the following functions:") } }, #' @description @@ -68,7 +68,7 @@ Kobo <- R6::R6Class("Kobo", get = function(path, query = list(), version = "v2", format = "json", parse = TRUE) { if (!format %in% c("json", "csv")) { - usethis::ui_stop("Unsupported format. Only 'json' and 'csv' are supported") + ui_stop("Unsupported format. Only 'json' and 'csv' are supported") } query$format <- format @@ -79,7 +79,7 @@ Kobo <- R6::R6Class("Kobo", ) } else if (version == "v1") { if (test_null(self$session_v1)) { - usethis::ui_stop( + ui_stop( paste( "Session for API v1 is not initalized.", "Please re-initalize the Kobo client with the", @@ -92,7 +92,7 @@ Kobo <- R6::R6Class("Kobo", query = query ) } else { - usethis::ui_stop( + ui_stop( "Invalid version. Must be either v1 or v2. Come back in a couple of years." ) @@ -104,11 +104,11 @@ Kobo <- R6::R6Class("Kobo", res$raise_for_ct_json() return(res$parse("UTF-8") %>% jsonlite::fromJSON()) } else if (format == "csv" & parse) { - usethis::ui_stop( + ui_stop( "TODO: Not supported yet" ) } else if (parse) { - usethis::ui_stop( + ui_stop( "TODO: Not supported yet" ) } @@ -131,12 +131,12 @@ Kobo <- R6::R6Class("Kobo", } } else if (version == "v1") { if (test_null(self$session_v1)) { - usethis::ui_stop("Session for API v1 is not initalized. + ui_stop("Session for API v1 is not initalized. Please re-initalize the Kobo client with the base_url_v1 argument.") } self$session_v1$post(path = paste0("api/v1/", path), body = body) } else { - usethis::ui_stop( + ui_stop( "Invalid version. Must be either v1 or v2. Come back in a couple of years." ) diff --git a/R/zzz.R b/R/zzz.R index dd99ba8..0389f93 100644 --- a/R/zzz.R +++ b/R/zzz.R @@ -1,2 +1,7 @@ +#' @title kbtbr: R client for the KoBoToolbox API +#' +#' @docType package +#' @name kbtbr #' @import checkmate +#' @importFrom usethis ui_stop ui_info ui_warn NULL From 08d44d53758f0eba014f67f0adec6e727b7bf87a Mon Sep 17 00:00:00 2001 From: Malte Kyhos Date: Fri, 28 Jan 2022 19:04:09 +0100 Subject: [PATCH 32/57] Only one version of list_as_json_char needed --- R/list_as_json_char.R | 21 --------------------- R/utils.R | 18 ++++++++++++++---- man/list_as_json_char.Rd | 12 ++---------- 3 files changed, 16 insertions(+), 35 deletions(-) delete mode 100644 R/list_as_json_char.R diff --git a/R/list_as_json_char.R b/R/list_as_json_char.R deleted file mode 100644 index 43361d9..0000000 --- a/R/list_as_json_char.R +++ /dev/null @@ -1,21 +0,0 @@ -#' Helper function to convert R list to JSON-like string -#' -#' @description -#' Converts R lists to JSON-like strings for POST request's body. -#' -#' #' @keywords internal -#' -#' @param list R list that should be converted to the JSON-like string -#' -#' @examples -#' \dontrun{ -#' example_body <- list_as_json_char(list( -#' "name" = "A survey object created via API/R", -#' "asset_type" = "survey" -#' )) -#' } -#' -list_as_json_char <- function(list) { - jsonlite::toJSON(x = list, pretty = TRUE, auto_unbox = TRUE) %>% - as.character() -} diff --git a/R/utils.R b/R/utils.R index fe05d60..67c7b54 100644 --- a/R/utils.R +++ b/R/utils.R @@ -15,13 +15,23 @@ check_repair_path <- function(path) { } } +#' Helper function to convert R list to JSON-like string +#' #' @description -#' Converts R list into JSON-like string. +#' Converts R lists to JSON-like strings for POST request's body. +#' +#' #' @keywords internal +#' +#' @param list R list that should be converted to the JSON-like string #' -#' @keywords internal +#' @examples +#' \dontrun{ +#' example_body <- list_as_json_char(list( +#' "name" = "A survey object created via API/R", +#' "asset_type" = "survey" +#' )) +#' } #' -#' @param list R list to be converted. -#' @return JSON-like string list_as_json_char <- function(list) { jsonlite::toJSON(x = list, pretty = TRUE, auto_unbox = TRUE) %>% as.character() diff --git a/man/list_as_json_char.Rd b/man/list_as_json_char.Rd index 7c85c7a..42fc4ac 100644 --- a/man/list_as_json_char.Rd +++ b/man/list_as_json_char.Rd @@ -1,25 +1,18 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/list_as_json_char.R, R/utils.R +% Please edit documentation in R/utils.R \name{list_as_json_char} \alias{list_as_json_char} \title{Helper function to convert R list to JSON-like string} \usage{ -list_as_json_char(list) - list_as_json_char(list) } \arguments{ -\item{list}{R list to be converted.} -} -\value{ -JSON-like string +\item{list}{R list that should be converted to the JSON-like string} } \description{ Converts R lists to JSON-like strings for POST request's body. #' @keywords internal - -Converts R list into JSON-like string. } \examples{ \dontrun{ @@ -30,4 +23,3 @@ example_body <- list_as_json_char(list( } } -\keyword{internal} From 1b490fee1997619f1588c768be63e6d90b5ee193 Mon Sep 17 00:00:00 2001 From: Malte Kyhos Date: Fri, 28 Jan 2022 19:07:45 +0100 Subject: [PATCH 33/57] Rename function: check_repair_path -> append_slash --- R/kobo-client.R | 4 ++-- R/utils.R | 4 ++-- tests/testthat/test-utils.R | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/R/kobo-client.R b/R/kobo-client.R index da5d6c8..e48cb8a 100644 --- a/R/kobo-client.R +++ b/R/kobo-client.R @@ -55,7 +55,7 @@ KoboClient <- R6::R6Class("KoboClient", #' [`crul::HttpClient`] for reference #' @return the server response as a crul::HttpResponse object. get = function(path, query = list(), ...) { - path <- check_repair_path(path) + path <- append_slash(path) res <- super$get(path = path, query = query, ...) return(res) }, @@ -71,7 +71,7 @@ KoboClient <- R6::R6Class("KoboClient", #' [`crul::HttpClient`] for reference #' @return Returns an object of class `crul::HttpResponse`. post = function(path, body, ...) { - path <- check_repair_path(path) + path <- append_slash(path) res <- super$post(path = path, body = body, ...) res$raise_for_status() return(res) diff --git a/R/utils.R b/R/utils.R index 67c7b54..a821ab7 100644 --- a/R/utils.R +++ b/R/utils.R @@ -3,11 +3,11 @@ # if we write the functions outside the classes and set them later in the class # code readability is higher imo -#' @title Check URL +#' @title Repair URL by appending trailing slash #' @param path The path, for example appended to the base URL. #' @return The path string with optionally an appended trailing slash. #' @noRd -check_repair_path <- function(path) { +append_slash <- function(path) { if (substr(path, nchar(path), nchar(path)) != "/") { return(paste0(path, "/")) } else { diff --git a/tests/testthat/test-utils.R b/tests/testthat/test-utils.R index eed858e..992a2f5 100644 --- a/tests/testthat/test-utils.R +++ b/tests/testthat/test-utils.R @@ -6,12 +6,12 @@ test_that("Enforcing trailing slash to a string works", { path_correct <- "this/is/my/url/" path_wrong <- "this/is/my/url" expect_equal( - check_repair_path(path_correct), + append_slash(path_correct), path_correct ) expect_equal( - check_repair_path(path_wrong), + append_slash(path_wrong), path_correct ) }) From bc10016071507b09c0679bf52a04d085ddbae5c7 Mon Sep 17 00:00:00 2001 From: Malte Kyhos Date: Fri, 28 Jan 2022 19:08:09 +0100 Subject: [PATCH 34/57] Update namespace/docs (missed it) --- NAMESPACE | 2 ++ man/kbtbr.Rd | 6 ++++++ 2 files changed, 8 insertions(+) create mode 100644 man/kbtbr.Rd diff --git a/NAMESPACE b/NAMESPACE index 22a0138..3bf32fc 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -7,4 +7,6 @@ import(checkmate) importFrom(crul,HttpClient) importFrom(magrittr,"%>%") importFrom(tibble,tibble) +importFrom(usethis,ui_info) importFrom(usethis,ui_stop) +importFrom(usethis,ui_warn) diff --git a/man/kbtbr.Rd b/man/kbtbr.Rd new file mode 100644 index 0000000..74d0645 --- /dev/null +++ b/man/kbtbr.Rd @@ -0,0 +1,6 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/zzz.R +\docType{package} +\name{kbtbr} +\alias{kbtbr} +\title{kbtbr: R client for the KoBoToolbox API} From f0c7041298e07b4e6a38fdab72676349b8819f7c Mon Sep 17 00:00:00 2001 From: Malte Kyhos Date: Fri, 28 Jan 2022 19:26:40 +0100 Subject: [PATCH 35/57] KoboClient: inline function call --- R/kobo-client.R | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/R/kobo-client.R b/R/kobo-client.R index e48cb8a..c2a68bc 100644 --- a/R/kobo-client.R +++ b/R/kobo-client.R @@ -55,8 +55,11 @@ KoboClient <- R6::R6Class("KoboClient", #' [`crul::HttpClient`] for reference #' @return the server response as a crul::HttpResponse object. get = function(path, query = list(), ...) { - path <- append_slash(path) - res <- super$get(path = path, query = query, ...) + res <- super$get( + path = append_slash(path), + query = query, + ... + ) return(res) }, From 059680c660f14905c0b2240b83b07298f794ebdd Mon Sep 17 00:00:00 2001 From: Malte Kyhos Date: Fri, 28 Jan 2022 19:27:16 +0100 Subject: [PATCH 36/57] Kobo/KoboClient: add and update assertions --- R/kobo-client.R | 7 +++++-- R/kobo.R | 28 +++++++++++++++++++++++++--- 2 files changed, 30 insertions(+), 5 deletions(-) diff --git a/R/kobo-client.R b/R/kobo-client.R index c2a68bc..2c6a7d9 100644 --- a/R/kobo-client.R +++ b/R/kobo-client.R @@ -18,9 +18,9 @@ KoboClient <- R6::R6Class("KoboClient", #' the system environment variable `KBTBR_TOKEN`. initialize = function(base_url, kobo_token = Sys.getenv("KBTBR_TOKEN")) { + assert_string(base_url) + assert_string(kobo_token) - # Check and set private fields - assert_character(kobo_token) if (kobo_token == "") { ui_stop( "No valid token detected. Set the KBTBR_TOKEN environment @@ -74,6 +74,9 @@ KoboClient <- R6::R6Class("KoboClient", #' [`crul::HttpClient`] for reference #' @return Returns an object of class `crul::HttpResponse`. post = function(path, body, ...) { + assert_string(path) + assert_list(body) + path <- append_slash(path) res <- super$post(path = path, body = body, ...) res$raise_for_status() diff --git a/R/kobo.R b/R/kobo.R index 7a77c19..62f5059 100644 --- a/R/kobo.R +++ b/R/kobo.R @@ -67,6 +67,10 @@ Kobo <- R6::R6Class("Kobo", #' object. get = function(path, query = list(), version = "v2", format = "json", parse = TRUE) { + assert_string(path) + assert_list(query) + assert_flag(parse) + if (!format %in% c("json", "csv")) { ui_stop("Unsupported format. Only 'json' and 'csv' are supported") } @@ -123,6 +127,9 @@ Kobo <- R6::R6Class("Kobo", #' should be executed (available: `v1`, `v2`). Defaults to `v2`. #' @return Returns an object of class `crul::HttpResponse`. post = function(path, body, version = "v2") { + assert_string(path) + assert_list(body) + if (version == "v2") { if (path != "imports/") { self$session_v2$post(path = paste0("api/v2/", path), body = body) @@ -156,6 +163,8 @@ Kobo <- R6::R6Class("Kobo", #' for an asset #' @return An user-friendly summary of the available surveys as a tibble get_surveys = function(show_all_cols = FALSE) { + assert_flag(show_all_cols) + assets_res <- self$get_assets() fil <- assets_res$asset_type == "survey" columns_of_interest <- c( @@ -175,6 +184,8 @@ Kobo <- R6::R6Class("Kobo", #' @param id character. ID of the asset within the Kobo API. #' @return Asset. object of class [kbtbr::Asset] get_asset = function(id) { + assert_string(id) + res <- self$get(sprintf("assets/%s/", id)) Asset$new(res, self) }, @@ -184,6 +195,8 @@ Kobo <- R6::R6Class("Kobo", #' @param id character. ID of the survey asset within the Kobo API. #' @return tibble. submissions as a tibble. if no submissions were made yet, the tibble will have no columns. get_submissions = function(id) { + assert_string(id) + asset <- self$get_asset(id) asset$get_submissions() }, @@ -195,6 +208,10 @@ Kobo <- R6::R6Class("Kobo", #' "block", "question", "survey", "template". #' @return Returns an object of class `crul::HttpResponse`. clone_asset = function(clone_from, new_name, asset_type) { + assert_string(clone_from) + assert_string(new_name) + assert_choice(asset_type, choices = c("block", "question", "survey", "template")) + body <- list( "clone_from" = clone_from, "name" = new_name, @@ -210,8 +227,10 @@ Kobo <- R6::R6Class("Kobo", #' @param uid character. UID of the asset to be deployed. #' @return Returns an object of class `crul::HttpResponse`. deploy_asset = function(uid) { + assert_string(uid) + body <- list("active" = "true") - endpoint <- paste0("assets/", uid, "/deployment/") + endpoint <- sprintf("assets/%s/deployment/", uid) self$post(endpoint, body = body) }, @@ -222,6 +241,9 @@ Kobo <- R6::R6Class("Kobo", #' @param file_path character. The path to the XLS form file. #' @return Returns an object of class `crul::HttpResponse`. import_xls_form = function(name, file_path) { + assert_string(name) + assert_file_exists(file_path) + body <- list( "name" = name, "library" = "false", @@ -258,8 +280,8 @@ Kobo <- R6::R6Class("Kobo", assert_logical(share_metadata) assert_list(sector, names = "named") assert_list(country, names = "named") - assertSetEqual(names(sector), c("label", "value")) - assertSetEqual(names(country), c("label", "value")) + assert_set_equal(names(sector), c("label", "value")) + assert_set_equal(names(country), c("label", "value")) body <- list( "name" = name, From 8dfdea92e2a1e1ebb38615d20c4bbafc136531e6 Mon Sep 17 00:00:00 2001 From: Frie Date: Mon, 31 Jan 2022 13:51:55 +0100 Subject: [PATCH 37/57] hard wrap markdown - delete duplicate file --- .github/CONTRIBUTING.md | 34 +++++++++++++++++++++++++-------- CONTRIBUTING.md | 42 ----------------------------------------- 2 files changed, 26 insertions(+), 50 deletions(-) delete mode 100644 CONTRIBUTING.md diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 33a6b5b..662b07b 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -1,16 +1,26 @@ # How to contribute to kbtbr ## Code of Conduct -`kbtbr` was initiated within [CorrelAid](https://correlaid.org). As such, it falls under the [CorrelAid Code of Conduct](https://correlaid.org/about/codeofconduct/). +`kbtbr` was initiated within [CorrelAid](https://correlaid.org). As such, it +falls under the [CorrelAid Code of +Conduct](https://correlaid.org/about/codeofconduct/). ## Reporting issues -Issue reports are always welcome. Please provide a [Reprex](https://www.tidyverse.org/help/) if possible. This might not be possible because of the nature of the `kbtbr` package. In this case, please describe your problem as well as possible, including screenshots and HTTP responses (excluding sensitive data such as API tokens). +Issue reports are always welcome. Please provide a +[Reprex](https://www.tidyverse.org/help/) if possible. This might not be +possible because of the nature of the `kbtbr` package. In this case, please +describe your problem as well as possible, including screenshots and HTTP +responses (excluding sensitive data such as API tokens). ## Contribute -We welcome contributions in the form of Pull Requests. Before opening a PR, please open an issue describing what problem you'd like to be working on so that the maintainers can discuss the issue with you and propose feasible solution approaches. +We welcome contributions in the form of Pull Requests. Before opening a PR, +please open an issue describing what problem you'd like to be working on so that +the maintainers can discuss the issue with you and propose feasible solution +approaches. ### Code styling -Please style any code with the following [styler](https://styler.r-lib.org/) command: +Please style any code with the following [styler](https://styler.r-lib.org/) +command: ```r styler::style_pkg(style = styler::tidyverse_style, indent_by = 4) @@ -18,15 +28,21 @@ styler::style_pkg(style = styler::tidyverse_style, indent_by = 4) ### Package development workflow #### Branching model -We follow a [feature (or topic) branching workflow](https://git-scm.com/book/en/v2/Git-Branching-Branching-Workflows). This means that you should create a new Git branch for each issue (or set of related issues) that you are working on. The branch name should contain the issue number to allow for easier cross-referencing. +We follow a [feature (or topic) branching +workflow](https://git-scm.com/book/en/v2/Git-Branching-Branching-Workflows). +This means that you should create a new Git branch for each issue (or set of +related issues) that you are working on. The branch name should contain the +issue number to allow for easier cross-referencing. #### Long-lived branches -- `main`: default branch. Should only contain the releases of the package + hotfixes (small, critical bug fixes that can't wait until the next release) +- `main`: default branch. Should only contain the releases of the package + + hotfixes (small, critical bug fixes that can't wait until the next release) - `dev`: this is where we develop and branch off the feature branches #### Short-lived branches -Short-lived branches for feature development and bugfixes ("feature branches") should be branched off from the `dev` branch. +Short-lived branches for feature development and bugfixes ("feature branches") +should be branched off from the `dev` branch. ```bash # create branch from dev branch @@ -35,7 +51,9 @@ git switch -c 1-project-skeleton # or git checkout -b 1-project-skeleton # ... work on your branch with add, commit, push ``` -before making a Pull Request to `dev`, pull in the changes from the `dev` branch to avoid running into merge conflicts. With your feature branch checked out, run: +before making a Pull Request to `dev`, pull in the changes from the `dev` branch +to avoid running into merge conflicts. With your feature branch checked out, +run: ```bash git merge dev diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index 33a6b5b..0000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,42 +0,0 @@ -# How to contribute to kbtbr - -## Code of Conduct -`kbtbr` was initiated within [CorrelAid](https://correlaid.org). As such, it falls under the [CorrelAid Code of Conduct](https://correlaid.org/about/codeofconduct/). - -## Reporting issues -Issue reports are always welcome. Please provide a [Reprex](https://www.tidyverse.org/help/) if possible. This might not be possible because of the nature of the `kbtbr` package. In this case, please describe your problem as well as possible, including screenshots and HTTP responses (excluding sensitive data such as API tokens). - -## Contribute -We welcome contributions in the form of Pull Requests. Before opening a PR, please open an issue describing what problem you'd like to be working on so that the maintainers can discuss the issue with you and propose feasible solution approaches. - -### Code styling -Please style any code with the following [styler](https://styler.r-lib.org/) command: - -```r -styler::style_pkg(style = styler::tidyverse_style, indent_by = 4) -``` -### Package development workflow - -#### Branching model -We follow a [feature (or topic) branching workflow](https://git-scm.com/book/en/v2/Git-Branching-Branching-Workflows). This means that you should create a new Git branch for each issue (or set of related issues) that you are working on. The branch name should contain the issue number to allow for easier cross-referencing. - -#### Long-lived branches - -- `main`: default branch. Should only contain the releases of the package + hotfixes (small, critical bug fixes that can't wait until the next release) -- `dev`: this is where we develop and branch off the feature branches - -#### Short-lived branches -Short-lived branches for feature development and bugfixes ("feature branches") should be branched off from the `dev` branch. - -```bash -# create branch from dev branch -git checkout dev -git switch -c 1-project-skeleton # or git checkout -b 1-project-skeleton -# ... work on your branch with add, commit, push -``` - -before making a Pull Request to `dev`, pull in the changes from the `dev` branch to avoid running into merge conflicts. With your feature branch checked out, run: - -```bash -git merge dev -``` From 15e678f6fd2555995411f36b9b82dd77404b45f7 Mon Sep 17 00:00:00 2001 From: Frie Date: Mon, 31 Jan 2022 13:54:17 +0100 Subject: [PATCH 38/57] Kobo is a class not an object Co-authored-by: Malte Kyhos --- R/kobo.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/kobo.R b/R/kobo.R index a723f12..7ea2245 100644 --- a/R/kobo.R +++ b/R/kobo.R @@ -1,6 +1,6 @@ #' @title Kobo Class #' @description -#' Interface object for the Kobo API that can handle [KoboClient] instances +#' Interface class for the Kobo API that can handle [KoboClient] instances #' (sessions) for both API versions. #' The Class exposes both generic and specific methods for HTTP requests / #' interactions with the various endpoints. From 32a4b6aeb03772e065a3570e4fcaca10669251a8 Mon Sep 17 00:00:00 2001 From: Frie Date: Mon, 31 Jan 2022 13:56:31 +0100 Subject: [PATCH 39/57] fix spelling mistake --- vignettes/wrangling-survey-responses.Rmd | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vignettes/wrangling-survey-responses.Rmd b/vignettes/wrangling-survey-responses.Rmd index 9c112cc..dde9085 100644 --- a/vignettes/wrangling-survey-responses.Rmd +++ b/vignettes/wrangling-survey-responses.Rmd @@ -107,7 +107,9 @@ submissions_df <- submissions_df %>% colnames(submissions_df) ``` -For very large forms, it might be useful to investigate on how to sort the columns alphabetically or by the order they appeard in the form. With the small form here, we can still individually select the columns to put them into a meaningful order: +For very large forms, it might be useful to investigate on how to sort the columns alphabetically or by the +order they appeared in the form. With the small form here, we can still individually select +the columns to put them into a meaningful order: ```{r} From bc8d25886e05902edd51f97a83592d334c3a05aa Mon Sep 17 00:00:00 2001 From: Frie Date: Mon, 31 Jan 2022 13:56:44 +0100 Subject: [PATCH 40/57] do not use :: if we i import tibble --- R/kobo.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/kobo.R b/R/kobo.R index a723f12..3c01f52 100644 --- a/R/kobo.R +++ b/R/kobo.R @@ -147,7 +147,7 @@ Kobo <- R6::R6Class("Kobo", #' Returns a list of all assets available in the server as tibble #' @importFrom tibble tibble get_assets = function() { - return(tibble::tibble(self$get("assets/")$results)) + return(tibble(self$get("assets/")$results)) }, #' @description From b23956429ad35de680cb2e5f02ef71f46bbbf284 Mon Sep 17 00:00:00 2001 From: Frie Date: Mon, 31 Jan 2022 15:28:21 +0100 Subject: [PATCH 41/57] use tidyverse (@MKyhos said no baseR) --- vignettes/kbtbr.Rmd | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vignettes/kbtbr.Rmd b/vignettes/kbtbr.Rmd index d931e8f..2542ded 100644 --- a/vignettes/kbtbr.Rmd +++ b/vignettes/kbtbr.Rmd @@ -13,6 +13,7 @@ knitr::opts_chunk$set(echo = TRUE, eval = TRUE) # properly set up vcr library(vcr) +library(dplyr) vcr_dir <- "./assets" if (!nzchar(Sys.getenv("KBTBR_TOKEN"))) { if (dir.exists(vcr_dir)) { @@ -85,6 +86,7 @@ With the right base URL(s), we can create an instance of the `Kobo` class. The ` ```{r kobo} library(kbtbr) +library(dplyr) base_url_v2 <- "https://kobo.correlaid.org" # replace with your base URL for v2 base_url_v1 <- "https://kc.correlaid.org" # replace with your base URL for v1 token <- Sys.getenv("KBTBR_TOKEN") @@ -133,7 +135,7 @@ head(surveys) You can then extract the ID of a single survey by filtering for its name. ```{r} -test_id <- surveys$uid[surveys$name == "kbtbr Testing Survey"] +test_id <- surveys %>% filter(name == "kbtbr Testing Survey") %>% pull(uid) ``` Get the answers (or _submissions_ in KoBoToolbox API lingo) to the form/survey: From f65bd34b7a340dd595e4adb6a486bc5ab0b57983 Mon Sep 17 00:00:00 2001 From: Frie Date: Mon, 31 Jan 2022 15:30:23 +0100 Subject: [PATCH 42/57] no html preview --- README.Rmd | 4 +++- pkgdown/index.Rmd | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/README.Rmd b/README.Rmd index eb462c6..0c1c0ef 100644 --- a/README.Rmd +++ b/README.Rmd @@ -1,7 +1,9 @@ --- title: "kbtbr" -output: github_document +output: + github_document: + html_preview: false --- diff --git a/pkgdown/index.Rmd b/pkgdown/index.Rmd index cf229e7..ba70605 100644 --- a/pkgdown/index.Rmd +++ b/pkgdown/index.Rmd @@ -1,6 +1,8 @@ --- title: "kbtbr" -output: github_document +output: + github_document: + html_preview: false --- From fc88a1c811648b43c043f13d4f4d82e87fc5ea0b Mon Sep 17 00:00:00 2001 From: Frie Date: Mon, 31 Jan 2022 15:35:47 +0100 Subject: [PATCH 43/57] code of conduct title --- CODE_OF_CONDUCT.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index dab5df8..85ab255 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -1 +1,3 @@ +# Code of Conduct + `kbtbr` was initiated within [CorrelAid](https://correlaid.org). As such, it falls under the [CorrelAid Code of Conduct](https://correlaid.org/about/codeofconduct/). From 513ebe9b94069c14ba370949a4632821e4ab5ebb Mon Sep 17 00:00:00 2001 From: Frie Date: Mon, 31 Jan 2022 15:53:11 +0100 Subject: [PATCH 44/57] fix check notes --- .Rbuildignore | 2 ++ DESCRIPTION | 5 ++++- man/Kobo.Rd | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.Rbuildignore b/.Rbuildignore index 3b86d6a..366d330 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -9,3 +9,5 @@ ^docs$ ^pkgdown$ ^LICENSE\.md$ +^CODE_OF_CONDUCT.md +^README.Rmd diff --git a/DESCRIPTION b/DESCRIPTION index 604c999..5b98308 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -23,7 +23,10 @@ Suggests: withr, dplyr, tidyr, - knitr + knitr, + janitor, + ggplot2, + stringr Config/testthat/edition: 3 Imports: crul, diff --git a/man/Kobo.Rd b/man/Kobo.Rd index 4fd2a31..306440a 100644 --- a/man/Kobo.Rd +++ b/man/Kobo.Rd @@ -4,7 +4,7 @@ \alias{Kobo} \title{Kobo Class} \description{ -Interface object for the Kobo API that can handle \link{KoboClient} instances +Interface class for the Kobo API that can handle \link{KoboClient} instances (sessions) for both API versions. The Class exposes both generic and specific methods for HTTP requests / interactions with the various endpoints. From b875b2f9b7ec70beb50e9e24fca30431e65ae710 Mon Sep 17 00:00:00 2001 From: Malte Kyhos Date: Sat, 5 Feb 2022 12:41:37 +0100 Subject: [PATCH 45/57] Apply new indent --- R/asset.R | 230 +++++----- R/kobo-client.R | 144 +++--- R/kobo.R | 528 +++++++++++----------- R/utils.R | 18 +- tests/testthat/setup-kbtbr.R | 22 +- tests/testthat/test-asset.R | 182 ++++---- tests/testthat/test-kobo-client.R | 50 +-- tests/testthat/test-kobo.R | 714 +++++++++++++++--------------- tests/testthat/test-utils.R | 20 +- 9 files changed, 954 insertions(+), 954 deletions(-) diff --git a/R/asset.R b/R/asset.R index e9e8959..59c3830 100644 --- a/R/asset.R +++ b/R/asset.R @@ -1,122 +1,122 @@ #' Asset #' Class to hold an asset Asset <- R6::R6Class("Asset", - active = list( - #' @field uid - #' uid of the asset. - uid = function(value) { - if (missing(value)) { - return(private$.uid) - } else { - ui_stop("Read-only.") - } - }, - #' @field name - #' name of the asset. - name = function(value) { - if (missing(value)) { - return(private$.name) - } else { - ui_stop("Read-only.") - } - }, - #' @field asset_url - #' asset_url of the asset. takes the form of assets/{uid}/ - #' Contains most of the information about an asset such as meta data, permissions, xls form content and - #' links to other related endpoints. - asset_url = function(value) { - if (missing(value)) { - return(private$.asset_url) - } else { - ui_stop("Read-only.") - } - }, - #' @field data_url - #' data_url of the asset. This can be used to get data related to the asset. - #' Most useful for the asset type `survey` where this URL - #' gives access to the submissions to the survey. - data_url = function(value) { - if (missing(value)) { - return(private$.data_url) - } else { - ui_stop("Read-only.") - } - }, - #' @field owner_username - #' username of the owner of the asset. - owner_username = function(value) { - if (missing(value)) { - return(private$.owner_username) - } else { - ui_stop("Read-only.") - } - }, - #' @field type - #' type of the asset. Type of the asset, e.g. survey, question, block or template. - type = function(value) { - if (missing(value)) { - return(private$.type) - } else { - ui_stop("Read-only.") - } - } - ), - private = list( - .uid = NA, - .name = NA, - .asset_url = NA, - .data_url = NA, - .owner_username = NA, - .type = NA, - .kobo = NULL - ), - #' @param asset_list list. a list with the asset data, such as obtained through a call to assets/{id} - #' @param kobo Kobo instance. Instance of class Kobo used internally to make requests to the API. - public = list( - initialize = function(asset_list, kobo) { - # check that everything exists in list that we need - needed_names <- c("uid", "name", "url", "data", "owner__username", "asset_type") - if (!test_subset(needed_names, names(asset_list))) { - missing_elements <- setdiff(needed_names, names(asset_list)) - ui_stop( - sprintf("Argument asset_list is missing the following required elements: %s", toString(missing_elements)) - ) - } + active = list( + #' @field uid + #' uid of the asset. + uid = function(value) { + if (missing(value)) { + return(private$.uid) + } else { + ui_stop("Read-only.") + } + }, + #' @field name + #' name of the asset. + name = function(value) { + if (missing(value)) { + return(private$.name) + } else { + ui_stop("Read-only.") + } + }, + #' @field asset_url + #' asset_url of the asset. takes the form of assets/{uid}/ + #' Contains most of the information about an asset such as meta data, permissions, xls form content and + #' links to other related endpoints. + asset_url = function(value) { + if (missing(value)) { + return(private$.asset_url) + } else { + ui_stop("Read-only.") + } + }, + #' @field data_url + #' data_url of the asset. This can be used to get data related to the asset. + #' Most useful for the asset type `survey` where this URL + #' gives access to the submissions to the survey. + data_url = function(value) { + if (missing(value)) { + return(private$.data_url) + } else { + ui_stop("Read-only.") + } + }, + #' @field owner_username + #' username of the owner of the asset. + owner_username = function(value) { + if (missing(value)) { + return(private$.owner_username) + } else { + ui_stop("Read-only.") + } + }, + #' @field type + #' type of the asset. Type of the asset, e.g. survey, question, block or template. + type = function(value) { + if (missing(value)) { + return(private$.type) + } else { + ui_stop("Read-only.") + } + } + ), + private = list( + .uid = NA, + .name = NA, + .asset_url = NA, + .data_url = NA, + .owner_username = NA, + .type = NA, + .kobo = NULL + ), + #' @param asset_list list. a list with the asset data, such as obtained through a call to assets/{id} + #' @param kobo Kobo instance. Instance of class Kobo used internally to make requests to the API. + public = list( + initialize = function(asset_list, kobo) { + # check that everything exists in list that we need + needed_names <- c("uid", "name", "url", "data", "owner__username", "asset_type") + if (!test_subset(needed_names, names(asset_list))) { + missing_elements <- setdiff(needed_names, names(asset_list)) + ui_stop( + sprintf("Argument asset_list is missing the following required elements: %s", toString(missing_elements)) + ) + } - private$.uid <- asset_list$uid - private$.name <- asset_list$name - private$.asset_url <- asset_list$url - private$.data_url <- asset_list$data - private$.owner_username <- asset_list$owner__username - private$.type <- asset_list$asset_type + private$.uid <- asset_list$uid + private$.name <- asset_list$name + private$.asset_url <- asset_list$url + private$.data_url <- asset_list$data + private$.owner_username <- asset_list$owner__username + private$.type <- asset_list$asset_type - # kobo instance - assert_class(kobo, c("R6", "Kobo")) - private$.kobo <- kobo - }, + # kobo instance + assert_class(kobo, c("R6", "Kobo")) + private$.kobo <- kobo + }, - #' get_submissions - #' @description get submissions to a survey/form - #' @return tibble. submissions as a tibble. if no submissions were made yet, the tibble will have no columns. - get_submissions = function() { - if (private$.type != "survey") { - ui_stop("Only valid for assets of type 'survey'. Current asset is of type '{private$.type}'.") - } - path <- sprintf("assets/%s/data/", private$.uid) - private$.kobo$get(path)$results %>% - tibble::as_tibble() - }, - #' to_list - #' @return list representation of asset - to_list = function() { - list( - uid = private$.uid, - name = private$.name, - asset_url = private$.asset_url, - data_url = private$.data_url, - owner_username = private$.owner_username, - type = private$.type - ) - } - ) + #' get_submissions + #' @description get submissions to a survey/form + #' @return tibble. submissions as a tibble. if no submissions were made yet, the tibble will have no columns. + get_submissions = function() { + if (private$.type != "survey") { + ui_stop("Only valid for assets of type 'survey'. Current asset is of type '{private$.type}'.") + } + path <- sprintf("assets/%s/data/", private$.uid) + private$.kobo$get(path)$results %>% + tibble::as_tibble() + }, + #' to_list + #' @return list representation of asset + to_list = function() { + list( + uid = private$.uid, + name = private$.name, + asset_url = private$.asset_url, + data_url = private$.data_url, + owner_username = private$.owner_username, + type = private$.type + ) + } + ) ) diff --git a/R/kobo-client.R b/R/kobo-client.R index 2c6a7d9..29c8bcc 100644 --- a/R/kobo-client.R +++ b/R/kobo-client.R @@ -4,83 +4,83 @@ #' @importFrom crul HttpClient #' @export KoboClient <- R6::R6Class("KoboClient", - inherit = crul::HttpClient, - private = list( - base_url = "", - kobo_token = "" - ), # + inherit = crul::HttpClient, + private = list( + base_url = "", + kobo_token = "" + ), # - public = list( - #' @description - #' Initialization method for class "KoboClient". - #' @param base_url character. The full base URL of the API. - #' @param kobo_token character. The API token. Defaults to requesting - #' the system environment variable `KBTBR_TOKEN`. - initialize = function(base_url, - kobo_token = Sys.getenv("KBTBR_TOKEN")) { - assert_string(base_url) - assert_string(kobo_token) + public = list( + #' @description + #' Initialization method for class "KoboClient". + #' @param base_url character. The full base URL of the API. + #' @param kobo_token character. The API token. Defaults to requesting + #' the system environment variable `KBTBR_TOKEN`. + initialize = function(base_url, + kobo_token = Sys.getenv("KBTBR_TOKEN")) { + assert_string(base_url) + assert_string(kobo_token) - if (kobo_token == "") { - ui_stop( - "No valid token detected. Set the KBTBR_TOKEN environment + if (kobo_token == "") { + ui_stop( + "No valid token detected. Set the KBTBR_TOKEN environment variable or pass the token directly to the function (not recommended)." - ) - } - private$kobo_token <- kobo_token - private$base_url <- base_url + ) + } + private$kobo_token <- kobo_token + private$base_url <- base_url - super$initialize( - url = base_url, - headers = list( - Authorization = paste0("Token ", kobo_token), - Accept = "application/json" - # "content-type" = "application/json" - ) - ) - }, - #' @description - #' Perform a GET request (with additional checks) - #' - #' @details - #' Extension of the `crul::HttpClient$get()` method that checks - #' the HttpResponse object on status, that it is of type - #' `application/json`, and parses the response text subsequently from - #' JSON to R list representation. - #' @param path character. Path component of the endpoint. - #' @param query list. A named list which is parsed to the query - #' component. The order is not hierarchical. - #' @param ... crul-options. Additional option arguments, see - #' [`crul::HttpClient`] for reference - #' @return the server response as a crul::HttpResponse object. - get = function(path, query = list(), ...) { - res <- super$get( - path = append_slash(path), - query = query, - ... - ) - return(res) - }, + super$initialize( + url = base_url, + headers = list( + Authorization = paste0("Token ", kobo_token), + Accept = "application/json" + # "content-type" = "application/json" + ) + ) + }, + #' @description + #' Perform a GET request (with additional checks) + #' + #' @details + #' Extension of the `crul::HttpClient$get()` method that checks + #' the HttpResponse object on status, that it is of type + #' `application/json`, and parses the response text subsequently from + #' JSON to R list representation. + #' @param path character. Path component of the endpoint. + #' @param query list. A named list which is parsed to the query + #' component. The order is not hierarchical. + #' @param ... crul-options. Additional option arguments, see + #' [`crul::HttpClient`] for reference + #' @return the server response as a crul::HttpResponse object. + get = function(path, query = list(), ...) { + res <- super$get( + path = append_slash(path), + query = query, + ... + ) + return(res) + }, - #' @description - #' Perform a POST request - #' - #' @details - #' Extension of the `crul::HttpClient$post()` method. - #' @param path character. Path component of the endpoint. - #' @param body R list. A data payload to be sent to the server. - #' @param ... crul-options. Additional option arguments, see - #' [`crul::HttpClient`] for reference - #' @return Returns an object of class `crul::HttpResponse`. - post = function(path, body, ...) { - assert_string(path) - assert_list(body) + #' @description + #' Perform a POST request + #' + #' @details + #' Extension of the `crul::HttpClient$post()` method. + #' @param path character. Path component of the endpoint. + #' @param body R list. A data payload to be sent to the server. + #' @param ... crul-options. Additional option arguments, see + #' [`crul::HttpClient`] for reference + #' @return Returns an object of class `crul::HttpResponse`. + post = function(path, body, ...) { + assert_string(path) + assert_list(body) - path <- append_slash(path) - res <- super$post(path = path, body = body, ...) - res$raise_for_status() - return(res) - } - ) # + path <- append_slash(path) + res <- super$post(path = path, body = body, ...) + res$raise_for_status() + return(res) + } + ) # ) diff --git a/R/kobo.R b/R/kobo.R index e909f7e..7233003 100644 --- a/R/kobo.R +++ b/R/kobo.R @@ -6,296 +6,296 @@ #' interactions with the various endpoints. #' @export Kobo <- R6::R6Class("Kobo", - # private = list( - # ), - public = list( - #' @field session_v2 [kbtbr::KoboClient] session for v2 of the API - session_v2 = NULL, - #' @field session_v1 `KoboClient` session for v1 of the API - session_v1 = NULL, + # private = list( + # ), + public = list( + #' @field session_v2 [kbtbr::KoboClient] session for v2 of the API + session_v2 = NULL, + #' @field session_v1 `KoboClient` session for v1 of the API + session_v1 = NULL, - #' @description - #' Initialization method for class "Kobo". - #' @param base_url_v2 character. The base URL of the API version 2 - #' (known as /api/v2). For example: https://kobo.correlaid.org. - #' @param base_url_v1 character. The base URL of the API of your KoBoCAT - #' API (also known as /api/v1). Defaults to NULL. - #' For example: https://kc.correlaid.org. - #' @param kobo_token character. The API token. Defaults to requesting - #' the systen environment `KBTBR_TOKEN`. - #' @param session_v2 [KoboClient] To pass directly - #' a [KoboClient] instance for the API version v2. - #' @param session_v1 [KoboClient] In addition to session_v2 one can pass - #' also a [KoboClient] instance for the API version v1. - initialize = function(base_url_v2 = NULL, base_url_v1 = NULL, - kobo_token = Sys.getenv("KBTBR_TOKEN"), - session_v2 = NULL, session_v1 = NULL) { + #' @description + #' Initialization method for class "Kobo". + #' @param base_url_v2 character. The base URL of the API version 2 + #' (known as /api/v2). For example: https://kobo.correlaid.org. + #' @param base_url_v1 character. The base URL of the API of your KoBoCAT + #' API (also known as /api/v1). Defaults to NULL. + #' For example: https://kc.correlaid.org. + #' @param kobo_token character. The API token. Defaults to requesting + #' the systen environment `KBTBR_TOKEN`. + #' @param session_v2 [KoboClient] To pass directly + #' a [KoboClient] instance for the API version v2. + #' @param session_v1 [KoboClient] In addition to session_v2 one can pass + #' also a [KoboClient] instance for the API version v1. + initialize = function(base_url_v2 = NULL, base_url_v1 = NULL, + kobo_token = Sys.getenv("KBTBR_TOKEN"), + session_v2 = NULL, session_v1 = NULL) { - # one has to pass at least base_url_v2 or session_v2 - if (!xor( - test_null(base_url_v2), - test_null(session_v2) - )) { - stop("Either base_url_v2 or session_v2 must be provided") - } + # one has to pass at least base_url_v2 or session_v2 + if (!xor( + test_null(base_url_v2), + test_null(session_v2) + )) { + stop("Either base_url_v2 or session_v2 must be provided") + } - if (!test_null(base_url_v2)) { - self$session_v2 <- KoboClient$new(base_url_v2, kobo_token) - } else { - self$session_v2 <- session_v2 - } + if (!test_null(base_url_v2)) { + self$session_v2 <- KoboClient$new(base_url_v2, kobo_token) + } else { + self$session_v2 <- session_v2 + } - if (!test_null(base_url_v1)) { - self$session_v1 <- KoboClient$new(base_url_v1, kobo_token) - } else if (!test_null(session_v1)) { - self$session_v1 <- session_v1 - } else { - # TODO: add to warning once we add functionality enabled by v1 only - # ui_info("You have not passed base_url_v1. You cannot use the following functions:") - } - }, - #' @description - #' Wrapper for the GET method of internal session objects. - #' @param path character. Path component of the endpoint. - #' @param query list. A named list which is parsed to the query - #' component. The order is not hierarchical. - #' @param version character. Indicates on which API version the request should be executed (available: `v1`, `v2`). Defaults to `v2`. - #' @param format character. the format to request from the server. either 'json' or 'csv'. defaults to 'json' - #' @param parse whether or not to parse the HTTP response. defaults to TRUE. - #' @return a list encoding of the json server reply if parse=TRUE. - #' Otherwise, it returns the server response as a crul::HttpResponse - #' object. - get = function(path, query = list(), version = "v2", format = "json", - parse = TRUE) { - assert_string(path) - assert_list(query) - assert_flag(parse) + if (!test_null(base_url_v1)) { + self$session_v1 <- KoboClient$new(base_url_v1, kobo_token) + } else if (!test_null(session_v1)) { + self$session_v1 <- session_v1 + } else { + # TODO: add to warning once we add functionality enabled by v1 only + # ui_info("You have not passed base_url_v1. You cannot use the following functions:") + } + }, + #' @description + #' Wrapper for the GET method of internal session objects. + #' @param path character. Path component of the endpoint. + #' @param query list. A named list which is parsed to the query + #' component. The order is not hierarchical. + #' @param version character. Indicates on which API version the request should be executed (available: `v1`, `v2`). Defaults to `v2`. + #' @param format character. the format to request from the server. either 'json' or 'csv'. defaults to 'json' + #' @param parse whether or not to parse the HTTP response. defaults to TRUE. + #' @return a list encoding of the json server reply if parse=TRUE. + #' Otherwise, it returns the server response as a crul::HttpResponse + #' object. + get = function(path, query = list(), version = "v2", format = "json", + parse = TRUE) { + assert_string(path) + assert_list(query) + assert_flag(parse) - if (!format %in% c("json", "csv")) { - ui_stop("Unsupported format. Only 'json' and 'csv' are supported") - } + if (!format %in% c("json", "csv")) { + ui_stop("Unsupported format. Only 'json' and 'csv' are supported") + } - query$format <- format - if (version == "v2") { - res <- self$session_v2$get( - path = paste0("api/v2/", path), - query = query - ) - } else if (version == "v1") { - if (test_null(self$session_v1)) { - ui_stop( - paste( - "Session for API v1 is not initalized.", - "Please re-initalize the Kobo client with the", - "base_url_v1 argument." - ) - ) - } - res <- self$session_v1$get( - path = paste0("api/v1/", path), - query = query - ) - } else { - ui_stop( - "Invalid version. Must be either v1 or v2. + query$format <- format + if (version == "v2") { + res <- self$session_v2$get( + path = paste0("api/v2/", path), + query = query + ) + } else if (version == "v1") { + if (test_null(self$session_v1)) { + ui_stop( + paste( + "Session for API v1 is not initalized.", + "Please re-initalize the Kobo client with the", + "base_url_v1 argument." + ) + ) + } + res <- self$session_v1$get( + path = paste0("api/v1/", path), + query = query + ) + } else { + ui_stop( + "Invalid version. Must be either v1 or v2. Come back in a couple of years." - ) - } + ) + } - res$raise_for_status() + res$raise_for_status() - if (format == "json" & parse) { - res$raise_for_ct_json() - return(res$parse("UTF-8") %>% jsonlite::fromJSON()) - } else if (format == "csv" & parse) { - ui_stop( - "TODO: Not supported yet" - ) - } else if (parse) { - ui_stop( - "TODO: Not supported yet" - ) - } - return(res) - }, + if (format == "json" & parse) { + res$raise_for_ct_json() + return(res$parse("UTF-8") %>% jsonlite::fromJSON()) + } else if (format == "csv" & parse) { + ui_stop( + "TODO: Not supported yet" + ) + } else if (parse) { + ui_stop( + "TODO: Not supported yet" + ) + } + return(res) + }, - #' @description - #' Wrapper for the POST method of internal session objects. - #' @param path character. Path component of the endpoint. - #' @param body R list. A data payload to be sent to the server. - #' @param version character. Indicates on which API version the request - #' should be executed (available: `v1`, `v2`). Defaults to `v2`. - #' @return Returns an object of class `crul::HttpResponse`. - post = function(path, body, version = "v2") { - assert_string(path) - assert_list(body) + #' @description + #' Wrapper for the POST method of internal session objects. + #' @param path character. Path component of the endpoint. + #' @param body R list. A data payload to be sent to the server. + #' @param version character. Indicates on which API version the request + #' should be executed (available: `v1`, `v2`). Defaults to `v2`. + #' @return Returns an object of class `crul::HttpResponse`. + post = function(path, body, version = "v2") { + assert_string(path) + assert_list(body) - if (version == "v2") { - if (path != "imports/") { - self$session_v2$post(path = paste0("api/v2/", path), body = body) - } else { - self$session_v2$post(path = path, body = body) - } - } else if (version == "v1") { - if (test_null(self$session_v1)) { - ui_stop("Session for API v1 is not initalized. + if (version == "v2") { + if (path != "imports/") { + self$session_v2$post(path = paste0("api/v2/", path), body = body) + } else { + self$session_v2$post(path = path, body = body) + } + } else if (version == "v1") { + if (test_null(self$session_v1)) { + ui_stop("Session for API v1 is not initalized. Please re-initalize the Kobo client with the base_url_v1 argument.") - } - self$session_v1$post(path = paste0("api/v1/", path), body = body) - } else { - ui_stop( - "Invalid version. Must be either v1 or v2. + } + self$session_v1$post(path = paste0("api/v1/", path), body = body) + } else { + ui_stop( + "Invalid version. Must be either v1 or v2. Come back in a couple of years." - ) - } - }, + ) + } + }, - #' @description - #' Returns a list of all assets available in the server as tibble - #' @importFrom tibble tibble - get_assets = function() { - return(tibble(self$get("assets/")$results)) - }, + #' @description + #' Returns a list of all assets available in the server as tibble + #' @importFrom tibble tibble + get_assets = function() { + return(tibble(self$get("assets/")$results)) + }, - #' @description - #' High-level GET request for `surveys` endpoints endpoint - #' @param show_all_cols if true returns all the columns available - #' for an asset - #' @return An user-friendly summary of the available surveys as a tibble - get_surveys = function(show_all_cols = FALSE) { - assert_flag(show_all_cols) + #' @description + #' High-level GET request for `surveys` endpoints endpoint + #' @param show_all_cols if true returns all the columns available + #' for an asset + #' @return An user-friendly summary of the available surveys as a tibble + get_surveys = function(show_all_cols = FALSE) { + assert_flag(show_all_cols) - assets_res <- self$get_assets() - fil <- assets_res$asset_type == "survey" - columns_of_interest <- c( - "name", "uid", "date_created", "date_modified", - "owner__username", "parent", "has_deployment", - "deployment__active", "deployment__submission_count" - ) - if (show_all_cols) { - return(assets_res[fil, ]) - } else { - return(assets_res[fil, columns_of_interest]) - } - }, + assets_res <- self$get_assets() + fil <- assets_res$asset_type == "survey" + columns_of_interest <- c( + "name", "uid", "date_created", "date_modified", + "owner__username", "parent", "has_deployment", + "deployment__active", "deployment__submission_count" + ) + if (show_all_cols) { + return(assets_res[fil, ]) + } else { + return(assets_res[fil, columns_of_interest]) + } + }, - #' @description - #' Get an asset given its id. - #' @param id character. ID of the asset within the Kobo API. - #' @return Asset. object of class [kbtbr::Asset] - get_asset = function(id) { - assert_string(id) + #' @description + #' Get an asset given its id. + #' @param id character. ID of the asset within the Kobo API. + #' @return Asset. object of class [kbtbr::Asset] + get_asset = function(id) { + assert_string(id) - res <- self$get(sprintf("assets/%s/", id)) - Asset$new(res, self) - }, + res <- self$get(sprintf("assets/%s/", id)) + Asset$new(res, self) + }, - #' @description - #' Get the submissions for a survey. - #' @param id character. ID of the survey asset within the Kobo API. - #' @return tibble. submissions as a tibble. if no submissions were made yet, the tibble will have no columns. - get_submissions = function(id) { - assert_string(id) + #' @description + #' Get the submissions for a survey. + #' @param id character. ID of the survey asset within the Kobo API. + #' @return tibble. submissions as a tibble. if no submissions were made yet, the tibble will have no columns. + get_submissions = function(id) { + assert_string(id) - asset <- self$get_asset(id) - asset$get_submissions() - }, - #' High-level POST request to clone an asset. `assets` endpoint - #' (due to default to `v2`, no further specification is needed). - #' @param clone_from character. UID of the asset to be cloned. - #' @param new_name character. Name of the new asset. - #' @param asset_type character. Type of the new asset. Can be - #' "block", "question", "survey", "template". - #' @return Returns an object of class `crul::HttpResponse`. - clone_asset = function(clone_from, new_name, asset_type) { - assert_string(clone_from) - assert_string(new_name) - assert_choice(asset_type, choices = c("block", "question", "survey", "template")) + asset <- self$get_asset(id) + asset$get_submissions() + }, + #' High-level POST request to clone an asset. `assets` endpoint + #' (due to default to `v2`, no further specification is needed). + #' @param clone_from character. UID of the asset to be cloned. + #' @param new_name character. Name of the new asset. + #' @param asset_type character. Type of the new asset. Can be + #' "block", "question", "survey", "template". + #' @return Returns an object of class `crul::HttpResponse`. + clone_asset = function(clone_from, new_name, asset_type) { + assert_string(clone_from) + assert_string(new_name) + assert_choice(asset_type, choices = c("block", "question", "survey", "template")) - body <- list( - "clone_from" = clone_from, - "name" = new_name, - "asset_type" = asset_type - ) - self$post("assets/", body = body) - }, + body <- list( + "clone_from" = clone_from, + "name" = new_name, + "asset_type" = asset_type + ) + self$post("assets/", body = body) + }, - #' @description - #' High-level POST request to deploy an asset. - #' `assets/{uid}/deployment/` endpoint (due to - #' default to `v2`, no further specification is needed). - #' @param uid character. UID of the asset to be deployed. - #' @return Returns an object of class `crul::HttpResponse`. - deploy_asset = function(uid) { - assert_string(uid) + #' @description + #' High-level POST request to deploy an asset. + #' `assets/{uid}/deployment/` endpoint (due to + #' default to `v2`, no further specification is needed). + #' @param uid character. UID of the asset to be deployed. + #' @return Returns an object of class `crul::HttpResponse`. + deploy_asset = function(uid) { + assert_string(uid) - body <- list("active" = "true") - endpoint <- sprintf("assets/%s/deployment/", uid) - self$post(endpoint, body = body) - }, + body <- list("active" = "true") + endpoint <- sprintf("assets/%s/deployment/", uid) + self$post(endpoint, body = body) + }, - #' @description - #' High-level POST request to import an XLS form. `imports` endpoint - #' (due to default to `v2`, no further specification is needed). - #' @param name character. Name of the new asset. - #' @param file_path character. The path to the XLS form file. - #' @return Returns an object of class `crul::HttpResponse`. - import_xls_form = function(name, file_path) { - assert_string(name) - assert_file_exists(file_path) + #' @description + #' High-level POST request to import an XLS form. `imports` endpoint + #' (due to default to `v2`, no further specification is needed). + #' @param name character. Name of the new asset. + #' @param file_path character. The path to the XLS form file. + #' @return Returns an object of class `crul::HttpResponse`. + import_xls_form = function(name, file_path) { + assert_string(name) + assert_file_exists(file_path) - body <- list( - "name" = name, - "library" = "false", - "file" = crul::upload(file_path) - ) - self$post("imports/", body = body) - }, + body <- list( + "name" = name, + "library" = "false", + "file" = crul::upload(file_path) + ) + self$post("imports/", body = body) + }, - #' @description - #' High-level POST request to create an empty asset. `assets/` endpoint - #' (due to default to `v2`, no further specification is needed). - #' @param name character. Name of the new asset. - #' @param description character. Optional. - #' @param sector A list with elements `label` and `value`. - #' Optional. Corresponding labels and values can be found - #' \href{https://github.com/kobotoolbox/kpi/blob/master/kobo/static_lists.py}{here}. - #' @param country A list with elements `label` and `value`. - #' Optional. Corresponding labels and values can be found - #' \href{https://github.com/kobotoolbox/kpi/blob/master/kobo/static_lists.py}{here}. - #' @param share_metadata boolean. Optional. - #' @param asset_type character. Type of the new asset. Can be - #' "block", "question", "survey", "template". - #' @return Returns an object of class `crul::HttpResponse`. - create_asset = function(name, - asset_type, - description = "", - sector = list(label = "", value = ""), - country = list(label = "", value = ""), - share_metadata = FALSE) { + #' @description + #' High-level POST request to create an empty asset. `assets/` endpoint + #' (due to default to `v2`, no further specification is needed). + #' @param name character. Name of the new asset. + #' @param description character. Optional. + #' @param sector A list with elements `label` and `value`. + #' Optional. Corresponding labels and values can be found + #' \href{https://github.com/kobotoolbox/kpi/blob/master/kobo/static_lists.py}{here}. + #' @param country A list with elements `label` and `value`. + #' Optional. Corresponding labels and values can be found + #' \href{https://github.com/kobotoolbox/kpi/blob/master/kobo/static_lists.py}{here}. + #' @param share_metadata boolean. Optional. + #' @param asset_type character. Type of the new asset. Can be + #' "block", "question", "survey", "template". + #' @return Returns an object of class `crul::HttpResponse`. + create_asset = function(name, + asset_type, + description = "", + sector = list(label = "", value = ""), + country = list(label = "", value = ""), + share_metadata = FALSE) { - # Input validation / assertions - assert_character(name) - assert_character(asset_type) - assert_logical(share_metadata) - assert_list(sector, names = "named") - assert_list(country, names = "named") - assert_set_equal(names(sector), c("label", "value")) - assert_set_equal(names(country), c("label", "value")) + # Input validation / assertions + assert_character(name) + assert_character(asset_type) + assert_logical(share_metadata) + assert_list(sector, names = "named") + assert_list(country, names = "named") + assert_set_equal(names(sector), c("label", "value")) + assert_set_equal(names(country), c("label", "value")) - body <- list( - "name" = name, - "asset_type" = asset_type, - "settings" = list_as_json_char( - list( - "description" = description, - "sector" = sector, - "country" = country, - "share-metadata" = share_metadata - ) - ) - ) - self$post("assets/", body = body) - } - ) # + body <- list( + "name" = name, + "asset_type" = asset_type, + "settings" = list_as_json_char( + list( + "description" = description, + "sector" = sector, + "country" = country, + "share-metadata" = share_metadata + ) + ) + ) + self$post("assets/", body = body) + } + ) # ) diff --git a/R/utils.R b/R/utils.R index a821ab7..e40b0aa 100644 --- a/R/utils.R +++ b/R/utils.R @@ -8,11 +8,11 @@ #' @return The path string with optionally an appended trailing slash. #' @noRd append_slash <- function(path) { - if (substr(path, nchar(path), nchar(path)) != "/") { - return(paste0(path, "/")) - } else { - return(path) - } + if (substr(path, nchar(path), nchar(path)) != "/") { + return(paste0(path, "/")) + } else { + return(path) + } } #' Helper function to convert R list to JSON-like string @@ -27,12 +27,12 @@ append_slash <- function(path) { #' @examples #' \dontrun{ #' example_body <- list_as_json_char(list( -#' "name" = "A survey object created via API/R", -#' "asset_type" = "survey" +#' "name" = "A survey object created via API/R", +#' "asset_type" = "survey" #' )) #' } #' list_as_json_char <- function(list) { - jsonlite::toJSON(x = list, pretty = TRUE, auto_unbox = TRUE) %>% - as.character() + jsonlite::toJSON(x = list, pretty = TRUE, auto_unbox = TRUE) %>% + as.character() } diff --git a/tests/testthat/setup-kbtbr.R b/tests/testthat/setup-kbtbr.R index 7903f3f..8d008ff 100644 --- a/tests/testthat/setup-kbtbr.R +++ b/tests/testthat/setup-kbtbr.R @@ -3,19 +3,19 @@ library("vcr") # *Required* as vcr is set up on loading vcr_dir <- vcr::vcr_test_path("fixtures") if (!nzchar(Sys.getenv("KBTBR_TOKEN"))) { - if (dir.exists(vcr_dir)) { - # Fake API token to fool our package - Sys.setenv("KBTBR_TOKEN" = "fakebearertoken") - } else { - # If there's no mock files nor API token, impossible to run tests - stop("No API key nor cassettes, tests cannot be run.", - call. = FALSE - ) - } + if (dir.exists(vcr_dir)) { + # Fake API token to fool our package + Sys.setenv("KBTBR_TOKEN" = "fakebearertoken") + } else { + # If there's no mock files nor API token, impossible to run tests + stop("No API key nor cassettes, tests cannot be run.", + call. = FALSE + ) + } } invisible(vcr::vcr_configure( - dir = vcr_dir, - filter_request_headers = list(Authorization = "fakebearertoken") + dir = vcr_dir, + filter_request_headers = list(Authorization = "fakebearertoken") )) vcr::check_cassette_names() diff --git a/tests/testthat/test-asset.R b/tests/testthat/test-asset.R index 1c22466..356d159 100644 --- a/tests/testthat/test-asset.R +++ b/tests/testthat/test-asset.R @@ -1,115 +1,115 @@ BASE_URL <- "https://kobo.correlaid.org" test_that("Asset only takes Kobo not Kobo Client", { - test_list <- list( - uid = "uid", - name = "a very cool testing survey", - url = "url", - data = "url", - owner__username = "user", - asset_type = "survey" - ) - kc <- KoboClient$new(BASE_URL) - expect_error(Asset$new(test_list, kc), regexp = "Assertion on 'kobo' failed: Must inherit from class 'Kobo', but has classes 'KoboClient','HttpClient','R6'.") + test_list <- list( + uid = "uid", + name = "a very cool testing survey", + url = "url", + data = "url", + owner__username = "user", + asset_type = "survey" + ) + kc <- KoboClient$new(BASE_URL) + expect_error(Asset$new(test_list, kc), regexp = "Assertion on 'kobo' failed: Must inherit from class 'Kobo', but has classes 'KoboClient','HttpClient','R6'.") }) test_that("Asset needs all necessary elements to be non-null", { - test_list <- list( - uid = "uid", - name = "a very cool testing survey", - url = "url", - data = "url" - ) - kobo <- Kobo$new(BASE_URL) - expect_error(Asset$new(test_list, kobo), regexp = "Argument asset_list is missing the following required elements: owner__username, asset_type") + test_list <- list( + uid = "uid", + name = "a very cool testing survey", + url = "url", + data = "url" + ) + kobo <- Kobo$new(BASE_URL) + expect_error(Asset$new(test_list, kobo), regexp = "Argument asset_list is missing the following required elements: owner__username, asset_type") }) test_that("asset objects can be created for all asset types", { - vcr::use_cassette("kobo-create-asset-objects", { - kobo <- Kobo$new(base_url_v2 = BASE_URL, kobo_token = Sys.getenv("KBTBR_TOKEN")) - assets <- kobo$get_assets() - }) - - # get one of each type to make sure it works for all asset types - survey <- assets %>% - dplyr::filter(asset_type == "survey") %>% - dplyr::slice(1) - question <- assets %>% - dplyr::filter(asset_type == "question") %>% - dplyr::slice(1) - block <- assets %>% - dplyr::filter(asset_type == "block") %>% - dplyr::slice(1) - template <- assets %>% - dplyr::filter(asset_type == "template") %>% - dplyr::slice(1) - - test_cases <- dplyr::bind_rows(survey, question, block, template) - - for (i in 1:nrow(test_cases)) { - asset_list <- test_cases[i, , drop = TRUE] - asset_obj <- Asset$new(asset_list, kobo) - expect_equal(asset_obj$uid, asset_list$uid) - expect_equal(asset_obj$name, asset_list$name) - expect_equal(asset_obj$asset_url, asset_list$url) - expect_equal(asset_obj$data_url, asset_list$data) - expect_equal(asset_obj$type, asset_list$asset_type) - expect_equal(asset_obj$owner_username, asset_list$owner__username) - } + vcr::use_cassette("kobo-create-asset-objects", { + kobo <- Kobo$new(base_url_v2 = BASE_URL, kobo_token = Sys.getenv("KBTBR_TOKEN")) + assets <- kobo$get_assets() + }) + + # get one of each type to make sure it works for all asset types + survey <- assets %>% + dplyr::filter(asset_type == "survey") %>% + dplyr::slice(1) + question <- assets %>% + dplyr::filter(asset_type == "question") %>% + dplyr::slice(1) + block <- assets %>% + dplyr::filter(asset_type == "block") %>% + dplyr::slice(1) + template <- assets %>% + dplyr::filter(asset_type == "template") %>% + dplyr::slice(1) + + test_cases <- dplyr::bind_rows(survey, question, block, template) + + for (i in 1:nrow(test_cases)) { + asset_list <- test_cases[i, , drop = TRUE] + asset_obj <- Asset$new(asset_list, kobo) + expect_equal(asset_obj$uid, asset_list$uid) + expect_equal(asset_obj$name, asset_list$name) + expect_equal(asset_obj$asset_url, asset_list$url) + expect_equal(asset_obj$data_url, asset_list$data) + expect_equal(asset_obj$type, asset_list$asset_type) + expect_equal(asset_obj$owner_username, asset_list$owner__username) + } }) test_that("get asset returns asset instance", { - vcr::use_cassette("kobo-get-asset-object", { - kobo <- Kobo$new(base_url_v2 = BASE_URL, kobo_token = Sys.getenv("KBTBR_TOKEN")) - asset_obj <- kobo$get_asset("aRo4wg5utWT7dwdnQQEAE7") - }) - - expect_equal(asset_obj$uid, "aRo4wg5utWT7dwdnQQEAE7") - expect_equal(asset_obj$name, "kbtbr Testing Survey") - expect_equal(asset_obj$asset_url, "https://kobo.correlaid.org/api/v2/assets/aRo4wg5utWT7dwdnQQEAE7/?format=json") - expect_equal(asset_obj$data_url, "https://kobo.correlaid.org/api/v2/assets/aRo4wg5utWT7dwdnQQEAE7/data/?format=json") - expect_equal(asset_obj$type, "survey") - expect_equal(asset_obj$owner_username, "api_user") - - # to list function - expect_equal(length(asset_obj$to_list()), 6) - expect_setequal(names(asset_obj$to_list()), c("uid", "name", "asset_url", "data_url", "type", "owner_username")) + vcr::use_cassette("kobo-get-asset-object", { + kobo <- Kobo$new(base_url_v2 = BASE_URL, kobo_token = Sys.getenv("KBTBR_TOKEN")) + asset_obj <- kobo$get_asset("aRo4wg5utWT7dwdnQQEAE7") + }) + + expect_equal(asset_obj$uid, "aRo4wg5utWT7dwdnQQEAE7") + expect_equal(asset_obj$name, "kbtbr Testing Survey") + expect_equal(asset_obj$asset_url, "https://kobo.correlaid.org/api/v2/assets/aRo4wg5utWT7dwdnQQEAE7/?format=json") + expect_equal(asset_obj$data_url, "https://kobo.correlaid.org/api/v2/assets/aRo4wg5utWT7dwdnQQEAE7/data/?format=json") + expect_equal(asset_obj$type, "survey") + expect_equal(asset_obj$owner_username, "api_user") + + # to list function + expect_equal(length(asset_obj$to_list()), 6) + expect_setequal(names(asset_obj$to_list()), c("uid", "name", "asset_url", "data_url", "type", "owner_username")) }) test_that("can get survey submissions from survey", { - vcr::use_cassette("kobo-asset-submissions-asset", { - kobo <- Kobo$new(base_url_v2 = BASE_URL, kobo_token = Sys.getenv("KBTBR_TOKEN")) - asset_obj <- kobo$get_asset("aRo4wg5utWT7dwdnQQEAE7") - }) - - vcr::use_cassette("kobo-asset-submissions-data", { - submissions_df <- asset_obj$get_submissions() - }) - expect_true(tibble::is_tibble(submissions_df)) - expect_equal(nrow(submissions_df), 6) - print(str(submissions_df)) + vcr::use_cassette("kobo-asset-submissions-asset", { + kobo <- Kobo$new(base_url_v2 = BASE_URL, kobo_token = Sys.getenv("KBTBR_TOKEN")) + asset_obj <- kobo$get_asset("aRo4wg5utWT7dwdnQQEAE7") + }) + + vcr::use_cassette("kobo-asset-submissions-data", { + submissions_df <- asset_obj$get_submissions() + }) + expect_true(tibble::is_tibble(submissions_df)) + expect_equal(nrow(submissions_df), 6) + print(str(submissions_df)) }) test_that("getting submissions works for survey without submissions so far", { - vcr::use_cassette("kobo-asset-submissions-asset-nosubs", { - kobo <- Kobo$new(base_url_v2 = BASE_URL, kobo_token = Sys.getenv("KBTBR_TOKEN")) - asset_obj <- kobo$get_asset("ajzghKK6NELaixPQqsm49e") - }) - - vcr::use_cassette("kobo-asset-submissions-data-nosubs", { - submissions_df <- asset_obj$get_submissions() - }) - expect_true(tibble::is_tibble(submissions_df)) - expect_equal(nrow(submissions_df), 0) - expect_equal(ncol(submissions_df), 0) + vcr::use_cassette("kobo-asset-submissions-asset-nosubs", { + kobo <- Kobo$new(base_url_v2 = BASE_URL, kobo_token = Sys.getenv("KBTBR_TOKEN")) + asset_obj <- kobo$get_asset("ajzghKK6NELaixPQqsm49e") + }) + + vcr::use_cassette("kobo-asset-submissions-data-nosubs", { + submissions_df <- asset_obj$get_submissions() + }) + expect_true(tibble::is_tibble(submissions_df)) + expect_equal(nrow(submissions_df), 0) + expect_equal(ncol(submissions_df), 0) }) test_that("get_submissions throws error for asset which is not a survey", { - vcr::use_cassette("kobo-asset-submissions-asset-notsurvey", { - kobo <- Kobo$new(base_url_v2 = BASE_URL, kobo_token = Sys.getenv("KBTBR_TOKEN")) - asset_obj <- kobo$get_asset("apxYrm7i4mGc3Wxqu2eZ2r") - }) + vcr::use_cassette("kobo-asset-submissions-asset-notsurvey", { + kobo <- Kobo$new(base_url_v2 = BASE_URL, kobo_token = Sys.getenv("KBTBR_TOKEN")) + asset_obj <- kobo$get_asset("apxYrm7i4mGc3Wxqu2eZ2r") + }) - expect_error(asset_obj$get_submissions(), regexp = "Only valid for assets of type 'survey'. Current asset is of type 'block'.") + expect_error(asset_obj$get_submissions(), regexp = "Only valid for assets of type 'survey'. Current asset is of type 'block'.") }) diff --git a/tests/testthat/test-kobo-client.R b/tests/testthat/test-kobo-client.R index 9f2770d..7bd43e8 100644 --- a/tests/testthat/test-kobo-client.R +++ b/tests/testthat/test-kobo-client.R @@ -3,37 +3,37 @@ BASE_URL <- "https://kobo.correlaid.org" #' Testing $get_* methods vcr::use_cassette("kobo-client-403", { - test_that("Requests with faulty token throw error", { - # Case: Faulty token is via envvar, get request fails - withr::with_envvar( - new = c("KBTBR_TOKEN" = "foo"), - code = { - kc <- KoboClient$new(base_url = BASE_URL) - expect_error(kc$get("api/v2/assets/"), regexp = "403") - } - ) - }) + test_that("Requests with faulty token throw error", { + # Case: Faulty token is via envvar, get request fails + withr::with_envvar( + new = c("KBTBR_TOKEN" = "foo"), + code = { + kc <- KoboClient$new(base_url = BASE_URL) + expect_error(kc$get("api/v2/assets/"), regexp = "403") + } + ) + }) }) test_that("Kobo Client can fetch assets", { - vcr::use_cassette("kobo-client-get-assets-simple-get", { - koboclient <- KoboClient$new(base_url = BASE_URL, kobo_token = Sys.getenv("KBTBR_TOKEN")) - res <- koboclient$get("api/v2/assets/", query = list(format = "json")) # trailing slash again! - }) + vcr::use_cassette("kobo-client-get-assets-simple-get", { + koboclient <- KoboClient$new(base_url = BASE_URL, kobo_token = Sys.getenv("KBTBR_TOKEN")) + res <- koboclient$get("api/v2/assets/", query = list(format = "json")) # trailing slash again! + }) - assets <- res$ - parse() %>% - jsonlite::fromJSON() - expect_setequal(names(assets), c("count", "next", "previous", "results")) - expect_true(all(c("url", "owner", "kind", "name", "asset_type") %in% colnames(assets$results))) - expect_equal(nrow(assets$results), 8) - expect_equal(assets$count, 8) + assets <- res$ + parse() %>% + jsonlite::fromJSON() + expect_setequal(names(assets), c("count", "next", "previous", "results")) + expect_true(all(c("url", "owner", "kind", "name", "asset_type") %in% colnames(assets$results))) + expect_equal(nrow(assets$results), 8) + expect_equal(assets$count, 8) }) vcr::use_cassette("kobo-client-get-404", { - test_that("non existing route throws 404 error", { - koboclient <- KoboClient$new(base_url = BASE_URL, kobo_token = Sys.getenv("KBTBR_TOKEN")) - expect_error(koboclient$get("api/v2/doesnotexist/")$raise_for_status(), regexp = "404") - }) + test_that("non existing route throws 404 error", { + koboclient <- KoboClient$new(base_url = BASE_URL, kobo_token = Sys.getenv("KBTBR_TOKEN")) + expect_error(koboclient$get("api/v2/doesnotexist/")$raise_for_status(), regexp = "404") + }) }) diff --git a/tests/testthat/test-kobo.R b/tests/testthat/test-kobo.R index a6632c4..aadeba2 100644 --- a/tests/testthat/test-kobo.R +++ b/tests/testthat/test-kobo.R @@ -1,479 +1,479 @@ BASE_URL <- "https://kobo.correlaid.org" ASSET_COLUMNS <- c( - "url", "date_modified", "date_created", "owner", "summary", "owner__username", - "parent", "uid", - "tag_string", "settings", - "kind", "name", - "asset_type", "version_id", - "has_deployment", "deployed_version_id", - "deployment__identifier", "deployment__active", - "deployment__submission_count", "permissions", - "downloads", "data" + "url", "date_modified", "date_created", "owner", "summary", "owner__username", + "parent", "uid", + "tag_string", "settings", + "kind", "name", + "asset_type", "version_id", + "has_deployment", "deployed_version_id", + "deployment__identifier", "deployment__active", + "deployment__submission_count", "permissions", + "downloads", "data" ) #' ----------------------------------------------------------------------------- #' Testing basic properties, construction test_that("the error from KoboClient is propagated correctly if we fail to provide a token", { - withr::with_envvar( - new = c("KBTBR_TOKEN" = ""), - code = { - expect_error( - object = Kobo$new(base_url_v2 = BASE_URL), - regexp = "No valid token detected." - ) - } - ) + withr::with_envvar( + new = c("KBTBR_TOKEN" = ""), + code = { + expect_error( + object = Kobo$new(base_url_v2 = BASE_URL), + regexp = "No valid token detected." + ) + } + ) }) test_that("Kobo is initialized correctly if we provide a kobo_token manually with empty envvar.", { - withr::with_envvar( - new = c("KBTBR_TOKEN" = ""), - code = { - kobo_obj <- Kobo$new(base_url_v2 = BASE_URL, kobo_token = "foo") - expect_identical( - class(kobo_obj), - c("Kobo", "R6") - ) - } - ) + withr::with_envvar( + new = c("KBTBR_TOKEN" = ""), + code = { + kobo_obj <- Kobo$new(base_url_v2 = BASE_URL, kobo_token = "foo") + expect_identical( + class(kobo_obj), + c("Kobo", "R6") + ) + } + ) }) test_that("Kobo is initialized correctly if we provide a KoboClient instance", { - withr::with_envvar( - new = c("KBTBR_TOKEN" = ""), - code = { - koboclient_instance <- KoboClient$new(BASE_URL, kobo_token = "foo") - kobo_obj <- Kobo$new(session_v2 = koboclient_instance) - expect_identical( - class(kobo_obj), - c("Kobo", "R6") - ) - } - ) + withr::with_envvar( + new = c("KBTBR_TOKEN" = ""), + code = { + koboclient_instance <- KoboClient$new(BASE_URL, kobo_token = "foo") + kobo_obj <- Kobo$new(session_v2 = koboclient_instance) + expect_identical( + class(kobo_obj), + c("Kobo", "R6") + ) + } + ) }) test_that("we get a message if we do not specify base_url_v1, but Kobo is initialized.", { testthat::skip("skipping because currently this message is not printed because no functionality depends on v1 API") - expect_message( - { - kobo_obj <- Kobo$new(base_url_v2 = BASE_URL, kobo_token = "foo") - }, - regexp = "You have not passed base_url_v1. This means you cannot use" - ) - expect_identical( - class(kobo_obj), - c("Kobo", "R6") - ) + expect_message( + { + kobo_obj <- Kobo$new(base_url_v2 = BASE_URL, kobo_token = "foo") + }, + regexp = "You have not passed base_url_v1. This means you cannot use" + ) + expect_identical( + class(kobo_obj), + c("Kobo", "R6") + ) }) #' ----------------------------------------------------------------------------- #' Testing $get_* methods test_that("Request to v1 throws error if v1 session is not initialized", { - kobo <- Kobo$new(base_url_v2 = BASE_URL) - expect_error(kobo$get("submissions/", version = "v1"), - regexp = "Session for API v1 is not initalized" - ) + kobo <- Kobo$new(base_url_v2 = BASE_URL) + expect_error(kobo$get("submissions/", version = "v1"), + regexp = "Session for API v1 is not initalized" + ) }) test_that("Kobo can fetch assets", { - # the use_cassette command looks into the fixtures directory and checks - # whether a "cassette" with the given name already exists. if yes, it loads it. if no, the - # code is run and the response is saved as a cassette. - vcr::use_cassette("kobo-get-assets", { - kobo <- Kobo$new(base_url_v2 = BASE_URL, kobo_token = Sys.getenv("KBTBR_TOKEN")) - assets <- kobo$get_assets() - }) - expect_setequal(names(assets), ASSET_COLUMNS) - expect_equal(nrow(assets), 8) + # the use_cassette command looks into the fixtures directory and checks + # whether a "cassette" with the given name already exists. if yes, it loads it. if no, the + # code is run and the response is saved as a cassette. + vcr::use_cassette("kobo-get-assets", { + kobo <- Kobo$new(base_url_v2 = BASE_URL, kobo_token = Sys.getenv("KBTBR_TOKEN")) + assets <- kobo$get_assets() + }) + expect_setequal(names(assets), ASSET_COLUMNS) + expect_equal(nrow(assets), 8) }) test_that("Kobo can fetch assets using simple get", { - vcr::use_cassette("kobo-get-assets-simple-get", { - kobo <- Kobo$new(base_url_v2 = BASE_URL, kobo_token = Sys.getenv("KBTBR_TOKEN")) - assets <- kobo$get("assets/", parse = TRUE) # trailing slash again! - }) - expect_setequal(names(assets), c("count", "next", "previous", "results")) - expect_true(all(c("url", "owner", "kind", "name", "asset_type") %in% colnames(assets$results))) - expect_equal(nrow(assets$results), 8) - expect_equal(assets$count, 8) + vcr::use_cassette("kobo-get-assets-simple-get", { + kobo <- Kobo$new(base_url_v2 = BASE_URL, kobo_token = Sys.getenv("KBTBR_TOKEN")) + assets <- kobo$get("assets/", parse = TRUE) # trailing slash again! + }) + expect_setequal(names(assets), c("count", "next", "previous", "results")) + expect_true(all(c("url", "owner", "kind", "name", "asset_type") %in% colnames(assets$results))) + expect_equal(nrow(assets$results), 8) + expect_equal(assets$count, 8) }) test_that("Kobo can get a single asset", { - vcr::use_cassette("kobo-get-single-asset", { - kobo <- Kobo$new(base_url_v2 = BASE_URL, kobo_token = Sys.getenv("KBTBR_TOKEN")) - asset <- kobo$get_asset("aRo4wg5utWT7dwdnQQEAE7") - }) - expect_identical( - class(asset), - c("Asset", "R6") - ) + vcr::use_cassette("kobo-get-single-asset", { + kobo <- Kobo$new(base_url_v2 = BASE_URL, kobo_token = Sys.getenv("KBTBR_TOKEN")) + asset <- kobo$get_asset("aRo4wg5utWT7dwdnQQEAE7") + }) + expect_identical( + class(asset), + c("Asset", "R6") + ) }) test_that("Kobo can get submissions for a survey", { - vcr::use_cassette("kobo-get-submissions", { - kobo <- Kobo$new(base_url_v2 = BASE_URL, kobo_token = Sys.getenv("KBTBR_TOKEN")) - response_df <- kobo$get_submissions("aRo4wg5utWT7dwdnQQEAE7") - }) - expect_true(tibble::is_tibble(response_df)) - expect_equal(nrow(response_df), 4) + vcr::use_cassette("kobo-get-submissions", { + kobo <- Kobo$new(base_url_v2 = BASE_URL, kobo_token = Sys.getenv("KBTBR_TOKEN")) + response_df <- kobo$get_submissions("aRo4wg5utWT7dwdnQQEAE7") + }) + expect_true(tibble::is_tibble(response_df)) + expect_equal(nrow(response_df), 4) }) # ERRORS ----------- vcr::use_cassette("kobo-get-404", { - test_that("non existing route throws 404 error", { - kobo <- Kobo$new(base_url_v2 = BASE_URL, kobo_token = Sys.getenv("KBTBR_TOKEN")) - expect_error(kobo$get("doesnotexist/"), regexp = "404") - }) + test_that("non existing route throws 404 error", { + kobo <- Kobo$new(base_url_v2 = BASE_URL, kobo_token = Sys.getenv("KBTBR_TOKEN")) + expect_error(kobo$get("doesnotexist/"), regexp = "404") + }) }) #' ----------------------------------------------------------------------------- #' Testing POST methods test_that("Kobo$post can clone assets", { - vcr::use_cassette("kobo-clone-assets-simple-post", { - kobo <- suppressMessages(Kobo$new( - base_url_v2 = BASE_URL, - kobo_token = Sys.getenv("KBTBR_TOKEN") - )) - - clone_asset <- kobo$post("assets/", - body = list( - "clone_from" = "a84jmwwdPEsZMhK7s2i4SL", - "name" = "vcr_test_name", - "asset_type" = "survey" - ) - ) - }) - expect_equal(clone_asset$url, "https://kobo.correlaid.org/api/v2/assets/") - expect_equal(clone_asset$method, "post") - expect_equal(clone_asset$status_code, 201) - expect_true(clone_asset$success()) - expect_equal(clone_asset$status_http()$message, "Created") - expect_equal(clone_asset$status_http()$explanation, "Document created, URL follows") + vcr::use_cassette("kobo-clone-assets-simple-post", { + kobo <- suppressMessages(Kobo$new( + base_url_v2 = BASE_URL, + kobo_token = Sys.getenv("KBTBR_TOKEN") + )) + + clone_asset <- kobo$post("assets/", + body = list( + "clone_from" = "a84jmwwdPEsZMhK7s2i4SL", + "name" = "vcr_test_name", + "asset_type" = "survey" + ) + ) + }) + expect_equal(clone_asset$url, "https://kobo.correlaid.org/api/v2/assets/") + expect_equal(clone_asset$method, "post") + expect_equal(clone_asset$status_code, 201) + expect_true(clone_asset$success()) + expect_equal(clone_asset$status_http()$message, "Created") + expect_equal(clone_asset$status_http()$explanation, "Document created, URL follows") }) vcr::use_cassette("Kobo$post-404", { - test_that("Kobo$post with non existing route throws 404 error", { - kobo <- suppressMessages(Kobo$new( - base_url_v2 = BASE_URL, - kobo_token = Sys.getenv("KBTBR_TOKEN") - )) - - expect_error(kobo$post("doesnotexist/", - body = list( - "clone_from" = "a5jjyWLUEmi49EHML6t9Nr", - "name" = "vcr_test_name", - "asset_type" = "survey" - ) - ), - regexp = "404" - ) - }) + test_that("Kobo$post with non existing route throws 404 error", { + kobo <- suppressMessages(Kobo$new( + base_url_v2 = BASE_URL, + kobo_token = Sys.getenv("KBTBR_TOKEN") + )) + + expect_error(kobo$post("doesnotexist/", + body = list( + "clone_from" = "a5jjyWLUEmi49EHML6t9Nr", + "name" = "vcr_test_name", + "asset_type" = "survey" + ) + ), + regexp = "404" + ) + }) }) #' Testing kobo$clone_asset test_that("kobo$clone_asset can clone assets", { - vcr::use_cassette("kobo-post-clone-asset", { - kobo <- suppressMessages(Kobo$new( - base_url_v2 = BASE_URL, - kobo_token = Sys.getenv("KBTBR_TOKEN") - )) - - clone_asset <- kobo$clone_asset( - clone_from = "a84jmwwdPEsZMhK7s2i4SL", - new_name = "vcr_test_name", - asset_type = "survey" - ) - }) - expect_equal(clone_asset$url, "https://kobo.correlaid.org/api/v2/assets/") - expect_equal(clone_asset$method, "post") - expect_equal(clone_asset$status_code, 201) - expect_true(clone_asset$success()) - expect_equal(clone_asset$status_http()$message, "Created") - expect_equal(clone_asset$status_http()$explanation, "Document created, URL follows") + vcr::use_cassette("kobo-post-clone-asset", { + kobo <- suppressMessages(Kobo$new( + base_url_v2 = BASE_URL, + kobo_token = Sys.getenv("KBTBR_TOKEN") + )) + + clone_asset <- kobo$clone_asset( + clone_from = "a84jmwwdPEsZMhK7s2i4SL", + new_name = "vcr_test_name", + asset_type = "survey" + ) + }) + expect_equal(clone_asset$url, "https://kobo.correlaid.org/api/v2/assets/") + expect_equal(clone_asset$method, "post") + expect_equal(clone_asset$status_code, 201) + expect_true(clone_asset$success()) + expect_equal(clone_asset$status_http()$message, "Created") + expect_equal(clone_asset$status_http()$explanation, "Document created, URL follows") }) test_that("kobo$clone_asset returns error for the attempt to clone non-existing asset", { - vcr::use_cassette("kobo-post-clone-asset-err1", { - kobo <- suppressMessages(Kobo$new( - base_url_v2 = BASE_URL, - kobo_token = Sys.getenv("KBTBR_TOKEN") - )) - expect_error(kobo$clone_asset( - clone_from = "smth_wrong", - new_name = "vcr_test_name", - asset_type = "survey" - ), regexp = "404") - }) + vcr::use_cassette("kobo-post-clone-asset-err1", { + kobo <- suppressMessages(Kobo$new( + base_url_v2 = BASE_URL, + kobo_token = Sys.getenv("KBTBR_TOKEN") + )) + expect_error(kobo$clone_asset( + clone_from = "smth_wrong", + new_name = "vcr_test_name", + asset_type = "survey" + ), regexp = "404") + }) }) test_that("kobo$clone_asset returns error when cloning question to block", { - vcr::use_cassette("kobo-post-clone-asset-err2", { - kobo <- suppressMessages(Kobo$new( - base_url_v2 = BASE_URL, - kobo_token = Sys.getenv("KBTBR_TOKEN") - )) - expect_error(kobo$clone_asset( - clone_from = "a7AV5JhRHKf8EWGBJLswwC", - new_name = "vcr_test_name", - asset_type = "block" - ), regexp = "500") - }) + vcr::use_cassette("kobo-post-clone-asset-err2", { + kobo <- suppressMessages(Kobo$new( + base_url_v2 = BASE_URL, + kobo_token = Sys.getenv("KBTBR_TOKEN") + )) + expect_error(kobo$clone_asset( + clone_from = "a7AV5JhRHKf8EWGBJLswwC", + new_name = "vcr_test_name", + asset_type = "block" + ), regexp = "500") + }) }) test_that("kobo$clone_asset returns error when cloning template to block", { - vcr::use_cassette("kobo-post-clone-asset-err3", { - kobo <- suppressMessages(Kobo$new( - base_url_v2 = BASE_URL, - kobo_token = Sys.getenv("KBTBR_TOKEN") - )) - expect_error(kobo$clone_asset( - clone_from = "anxTvsL3xZd7CSvpt63qAd", - new_name = "vcr_test_name", - asset_type = "block" - ), regexp = "500") - }) + vcr::use_cassette("kobo-post-clone-asset-err3", { + kobo <- suppressMessages(Kobo$new( + base_url_v2 = BASE_URL, + kobo_token = Sys.getenv("KBTBR_TOKEN") + )) + expect_error(kobo$clone_asset( + clone_from = "anxTvsL3xZd7CSvpt63qAd", + new_name = "vcr_test_name", + asset_type = "block" + ), regexp = "500") + }) }) test_that("kobo$clone_asset returns error when cloning template to question", { - vcr::use_cassette("kobo-post-clone-asset-err4", { - kobo <- suppressMessages(Kobo$new( - base_url_v2 = BASE_URL, - kobo_token = Sys.getenv("KBTBR_TOKEN") - )) - expect_error(kobo$clone_asset( - clone_from = "anxTvsL3xZd7CSvpt63qAd", - new_name = "vcr_test_name", - asset_type = "question" - ), regexp = "500") - }) -}) - -test_that("kobo$clone_asset returns error when asset id isn't provided", { + vcr::use_cassette("kobo-post-clone-asset-err4", { kobo <- suppressMessages(Kobo$new( - base_url_v2 = BASE_URL, - kobo_token = Sys.getenv("KBTBR_TOKEN") + base_url_v2 = BASE_URL, + kobo_token = Sys.getenv("KBTBR_TOKEN") )) expect_error(kobo$clone_asset( - new_name = "vcr_test_name", - asset_type = "survey" - ), regexp = "is missing") + clone_from = "anxTvsL3xZd7CSvpt63qAd", + new_name = "vcr_test_name", + asset_type = "question" + ), regexp = "500") + }) +}) + +test_that("kobo$clone_asset returns error when asset id isn't provided", { + kobo <- suppressMessages(Kobo$new( + base_url_v2 = BASE_URL, + kobo_token = Sys.getenv("KBTBR_TOKEN") + )) + expect_error(kobo$clone_asset( + new_name = "vcr_test_name", + asset_type = "survey" + ), regexp = "is missing") }) test_that("kobo$clone_asset returns error when asset name isn't provided", { - kobo <- suppressMessages(Kobo$new( - base_url_v2 = BASE_URL, - kobo_token = Sys.getenv("KBTBR_TOKEN") - )) - expect_error(kobo$clone_asset( - clone_from = "a84jmwwdPEsZMhK7s2i4SL", - asset_type = "survey" - ), regexp = "is missing") + kobo <- suppressMessages(Kobo$new( + base_url_v2 = BASE_URL, + kobo_token = Sys.getenv("KBTBR_TOKEN") + )) + expect_error(kobo$clone_asset( + clone_from = "a84jmwwdPEsZMhK7s2i4SL", + asset_type = "survey" + ), regexp = "is missing") }) test_that("kobo$clone_asset returns error when asset type isn't provided", { - kobo <- suppressMessages(Kobo$new( - base_url_v2 = BASE_URL, - kobo_token = Sys.getenv("KBTBR_TOKEN") - )) - expect_error(kobo$clone_asset( - clone_from = "a84jmwwdPEsZMhK7s2i4SL", - new_name = "vcr_test_name" - ), regexp = "is missing") + kobo <- suppressMessages(Kobo$new( + base_url_v2 = BASE_URL, + kobo_token = Sys.getenv("KBTBR_TOKEN") + )) + expect_error(kobo$clone_asset( + clone_from = "a84jmwwdPEsZMhK7s2i4SL", + new_name = "vcr_test_name" + ), regexp = "is missing") }) #' Testing kobo$deploy_asset test_that("kobo$deploy_asset can deploy assets", { - vcr::use_cassette("kobo-post-deploy-asset", { - kobo <- suppressMessages(Kobo$new( - base_url_v2 = BASE_URL, - kobo_token = Sys.getenv("KBTBR_TOKEN") - )) - - deploy_asset <- kobo$deploy_asset(uid = "aQVGH8G68EP737tDBABRwC") - }) - expect_equal( - deploy_asset$url, - "https://kobo.correlaid.org/api/v2/assets/aQVGH8G68EP737tDBABRwC/deployment/" - ) - expect_equal(deploy_asset$method, "post") - expect_equal(deploy_asset$status_code, 200) # i don't understand why not 201. - # but with 200 it successfully deployed - expect_true(deploy_asset$success()) - expect_equal(deploy_asset$status_http()$message, "OK") - expect_equal(deploy_asset$status_http()$explanation, "Request fulfilled, document follows") + vcr::use_cassette("kobo-post-deploy-asset", { + kobo <- suppressMessages(Kobo$new( + base_url_v2 = BASE_URL, + kobo_token = Sys.getenv("KBTBR_TOKEN") + )) + + deploy_asset <- kobo$deploy_asset(uid = "aQVGH8G68EP737tDBABRwC") + }) + expect_equal( + deploy_asset$url, + "https://kobo.correlaid.org/api/v2/assets/aQVGH8G68EP737tDBABRwC/deployment/" + ) + expect_equal(deploy_asset$method, "post") + expect_equal(deploy_asset$status_code, 200) # i don't understand why not 201. + # but with 200 it successfully deployed + expect_true(deploy_asset$success()) + expect_equal(deploy_asset$status_http()$message, "OK") + expect_equal(deploy_asset$status_http()$explanation, "Request fulfilled, document follows") }) test_that("kobo$deploy_asset returns error when asset doesn't exist", { - vcr::use_cassette("kobo-post-deploy-asset-err1", { - kobo <- suppressMessages(Kobo$new( - base_url_v2 = BASE_URL, - kobo_token = Sys.getenv("KBTBR_TOKEN") - )) - expect_error(kobo$deploy_asset(uid = "smth_wrong"), regexp = "404") - }) + vcr::use_cassette("kobo-post-deploy-asset-err1", { + kobo <- suppressMessages(Kobo$new( + base_url_v2 = BASE_URL, + kobo_token = Sys.getenv("KBTBR_TOKEN") + )) + expect_error(kobo$deploy_asset(uid = "smth_wrong"), regexp = "404") + }) }) test_that("kobo$deploy_asset returns error when asset has deployment", { - vcr::use_cassette("kobo-post-deploy-asset-err2", { - kobo <- suppressMessages(Kobo$new( - base_url_v2 = BASE_URL, - kobo_token = Sys.getenv("KBTBR_TOKEN") - )) - expect_error(kobo$deploy_asset(uid = "ajzghKK6NELaixPQqsm49e"), regexp = "405") - }) + vcr::use_cassette("kobo-post-deploy-asset-err2", { + kobo <- suppressMessages(Kobo$new( + base_url_v2 = BASE_URL, + kobo_token = Sys.getenv("KBTBR_TOKEN") + )) + expect_error(kobo$deploy_asset(uid = "ajzghKK6NELaixPQqsm49e"), regexp = "405") + }) }) test_that("kobo$deploy_asset returns error when asset is template", { - vcr::use_cassette("kobo-post-deploy-asset-err3", { - kobo <- suppressMessages(Kobo$new( - base_url_v2 = BASE_URL, - kobo_token = Sys.getenv("KBTBR_TOKEN") - )) - expect_error(kobo$deploy_asset(uid = "anxTvsL3xZd7CSvpt63qAd"), regexp = "500") - }) + vcr::use_cassette("kobo-post-deploy-asset-err3", { + kobo <- suppressMessages(Kobo$new( + base_url_v2 = BASE_URL, + kobo_token = Sys.getenv("KBTBR_TOKEN") + )) + expect_error(kobo$deploy_asset(uid = "anxTvsL3xZd7CSvpt63qAd"), regexp = "500") + }) }) test_that("kobo$deploy_asset returns error when asset is question", { - vcr::use_cassette("kobo-post-deploy-asset-err4", { - kobo <- suppressMessages(Kobo$new( - base_url_v2 = BASE_URL, - kobo_token = Sys.getenv("KBTBR_TOKEN") - )) - expect_error(kobo$deploy_asset(uid = "a7AV5JhRHKf8EWGBJLswwC"), regexp = "500") - }) + vcr::use_cassette("kobo-post-deploy-asset-err4", { + kobo <- suppressMessages(Kobo$new( + base_url_v2 = BASE_URL, + kobo_token = Sys.getenv("KBTBR_TOKEN") + )) + expect_error(kobo$deploy_asset(uid = "a7AV5JhRHKf8EWGBJLswwC"), regexp = "500") + }) }) test_that("kobo$deploy_asset returns error when asset is block", { - vcr::use_cassette("kobo-post-deploy-asset-err5", { - kobo <- suppressMessages(Kobo$new( - base_url_v2 = BASE_URL, - kobo_token = Sys.getenv("KBTBR_TOKEN") - )) - expect_error(kobo$deploy_asset(uid = "aYKJ5czzHiustZFpBBiWHk"), regexp = "500") - }) + vcr::use_cassette("kobo-post-deploy-asset-err5", { + kobo <- suppressMessages(Kobo$new( + base_url_v2 = BASE_URL, + kobo_token = Sys.getenv("KBTBR_TOKEN") + )) + expect_error(kobo$deploy_asset(uid = "aYKJ5czzHiustZFpBBiWHk"), regexp = "500") + }) }) test_that("kobo$deploy_asset returns error when asset id isn't provided", { - kobo <- suppressMessages(Kobo$new( - base_url_v2 = BASE_URL, - kobo_token = Sys.getenv("KBTBR_TOKEN") - )) - expect_error(kobo$deploy_asset(), regexp = "is missing") + kobo <- suppressMessages(Kobo$new( + base_url_v2 = BASE_URL, + kobo_token = Sys.getenv("KBTBR_TOKEN") + )) + expect_error(kobo$deploy_asset(), regexp = "is missing") }) #' Testing kobo$import_xls_form test_that("kobo$import_xls_form can import forms", { - vcr::use_cassette("kobo-post-import-xls-form", { - kobo <- suppressMessages(Kobo$new( - base_url_v2 = BASE_URL, - kobo_token = Sys.getenv("KBTBR_TOKEN") - )) - - import_xls_form <- kobo$import_xls_form( - name = "vcr_test_name", - file_path = "xls_form_via_post.xlsx" - ) - }) - expect_equal(import_xls_form$url, "https://kobo.correlaid.org/imports/") - expect_equal(import_xls_form$method, "post") - expect_equal(import_xls_form$status_code, 201) - expect_true(import_xls_form$success()) - expect_equal(import_xls_form$status_http()$message, "Created") - expect_equal( - import_xls_form$status_http()$explanation, - "Document created, URL follows" + vcr::use_cassette("kobo-post-import-xls-form", { + kobo <- suppressMessages(Kobo$new( + base_url_v2 = BASE_URL, + kobo_token = Sys.getenv("KBTBR_TOKEN") + )) + + import_xls_form <- kobo$import_xls_form( + name = "vcr_test_name", + file_path = "xls_form_via_post.xlsx" ) + }) + expect_equal(import_xls_form$url, "https://kobo.correlaid.org/imports/") + expect_equal(import_xls_form$method, "post") + expect_equal(import_xls_form$status_code, 201) + expect_true(import_xls_form$success()) + expect_equal(import_xls_form$status_http()$message, "Created") + expect_equal( + import_xls_form$status_http()$explanation, + "Document created, URL follows" + ) }) test_that("kobo$create_asset can create assets with settings as parameters", { - vcr::use_cassette("kobo-post-create-asset", { - kobo <- suppressMessages(Kobo$new( - base_url_v2 = BASE_URL, - kobo_token = Sys.getenv("KBTBR_TOKEN") - )) - - create_asset <- kobo$create_asset( - name = "vcr_test_name", - asset_type = "survey", - description = "description", - sector = list(label = "Environment", value = "ENV"), - country = list(label = "Angola", value = "AGO"), - share_metadata = FALSE - ) - }) - expect_equal(create_asset$url, "https://kobo.correlaid.org/api/v2/assets/") - expect_equal(create_asset$method, "post") - expect_equal(create_asset$status_code, 201) - expect_true(create_asset$success()) - expect_equal(create_asset$status_http()$message, "Created") - expect_equal(create_asset$status_http()$explanation, "Document created, URL follows") + vcr::use_cassette("kobo-post-create-asset", { + kobo <- suppressMessages(Kobo$new( + base_url_v2 = BASE_URL, + kobo_token = Sys.getenv("KBTBR_TOKEN") + )) + + create_asset <- kobo$create_asset( + name = "vcr_test_name", + asset_type = "survey", + description = "description", + sector = list(label = "Environment", value = "ENV"), + country = list(label = "Angola", value = "AGO"), + share_metadata = FALSE + ) + }) + expect_equal(create_asset$url, "https://kobo.correlaid.org/api/v2/assets/") + expect_equal(create_asset$method, "post") + expect_equal(create_asset$status_code, 201) + expect_true(create_asset$success()) + expect_equal(create_asset$status_http()$message, "Created") + expect_equal(create_asset$status_http()$explanation, "Document created, URL follows") }) test_that("kobo$create_asset can create assets with dafault settings", { - vcr::use_cassette("kobo-post-create-asset1", { - kobo <- suppressMessages(Kobo$new( - base_url_v2 = BASE_URL, - kobo_token = Sys.getenv("KBTBR_TOKEN") - )) - - create_asset <- kobo$create_asset( - name = "vcr_test_name", - asset_type = "survey" - ) - }) - expect_equal(create_asset$url, "https://kobo.correlaid.org/api/v2/assets/") - expect_equal(create_asset$method, "post") - expect_equal(create_asset$status_code, 201) - expect_true(create_asset$success()) - expect_equal(create_asset$status_http()$message, "Created") - expect_equal(create_asset$status_http()$explanation, "Document created, URL follows") + vcr::use_cassette("kobo-post-create-asset1", { + kobo <- suppressMessages(Kobo$new( + base_url_v2 = BASE_URL, + kobo_token = Sys.getenv("KBTBR_TOKEN") + )) + + create_asset <- kobo$create_asset( + name = "vcr_test_name", + asset_type = "survey" + ) + }) + expect_equal(create_asset$url, "https://kobo.correlaid.org/api/v2/assets/") + expect_equal(create_asset$method, "post") + expect_equal(create_asset$status_code, 201) + expect_true(create_asset$success()) + expect_equal(create_asset$status_http()$message, "Created") + expect_equal(create_asset$status_http()$explanation, "Document created, URL follows") }) test_that("kobo$create_asset returns error when name isn't provided", { - kobo <- suppressMessages(Kobo$new( - base_url_v2 = BASE_URL, - kobo_token = Sys.getenv("KBTBR_TOKEN") - )) - expect_error(kobo$create_asset(asset_type = "survey"), regexp = "is missing") + kobo <- suppressMessages(Kobo$new( + base_url_v2 = BASE_URL, + kobo_token = Sys.getenv("KBTBR_TOKEN") + )) + expect_error(kobo$create_asset(asset_type = "survey"), regexp = "is missing") }) test_that("kobo$create_asset returns error when asset_type isn't provided", { - kobo <- suppressMessages(Kobo$new( - base_url_v2 = BASE_URL, - kobo_token = Sys.getenv("KBTBR_TOKEN") - )) - expect_error(kobo$create_asset(name = "vcr_test_name"), regexp = "is missing") + kobo <- suppressMessages(Kobo$new( + base_url_v2 = BASE_URL, + kobo_token = Sys.getenv("KBTBR_TOKEN") + )) + expect_error(kobo$create_asset(name = "vcr_test_name"), regexp = "is missing") }) test_that("kobo$import_xls_form fails because of an incorrect path", { - kobo <- suppressMessages(Kobo$new( - base_url_v2 = BASE_URL, - kobo_token = Sys.getenv("KBTBR_TOKEN") - )) - expect_error(kobo$import_xls_form( - name = "vcr_test_name", - file_path = "smth_wrong.xlsx" - )) + kobo <- suppressMessages(Kobo$new( + base_url_v2 = BASE_URL, + kobo_token = Sys.getenv("KBTBR_TOKEN") + )) + expect_error(kobo$import_xls_form( + name = "vcr_test_name", + file_path = "smth_wrong.xlsx" + )) }) test_that("kobo$import_xls_form fails because of the missing path", { - kobo <- suppressMessages(Kobo$new( - base_url_v2 = BASE_URL, - kobo_token = Sys.getenv("KBTBR_TOKEN") - )) - expect_error(kobo$import_xls_form(file_path = "xls_form_via_post.xlsx"), - regexp = "is missing" - ) + kobo <- suppressMessages(Kobo$new( + base_url_v2 = BASE_URL, + kobo_token = Sys.getenv("KBTBR_TOKEN") + )) + expect_error(kobo$import_xls_form(file_path = "xls_form_via_post.xlsx"), + regexp = "is missing" + ) }) test_that("kobo$import_xls_form fails because of the missing name", { - kobo <- suppressMessages(Kobo$new( - base_url_v2 = BASE_URL, - kobo_token = Sys.getenv("KBTBR_TOKEN") - )) - expect_error(kobo$import_xls_form(name = "vcr_test_name"), - regexp = "is missing" - ) + kobo <- suppressMessages(Kobo$new( + base_url_v2 = BASE_URL, + kobo_token = Sys.getenv("KBTBR_TOKEN") + )) + expect_error(kobo$import_xls_form(name = "vcr_test_name"), + regexp = "is missing" + ) }) diff --git a/tests/testthat/test-utils.R b/tests/testthat/test-utils.R index 992a2f5..a5090e4 100644 --- a/tests/testthat/test-utils.R +++ b/tests/testthat/test-utils.R @@ -3,15 +3,15 @@ # Testing URL functions -------------------------------------------------------- test_that("Enforcing trailing slash to a string works", { - path_correct <- "this/is/my/url/" - path_wrong <- "this/is/my/url" - expect_equal( - append_slash(path_correct), - path_correct - ) + path_correct <- "this/is/my/url/" + path_wrong <- "this/is/my/url" + expect_equal( + append_slash(path_correct), + path_correct + ) - expect_equal( - append_slash(path_wrong), - path_correct - ) + expect_equal( + append_slash(path_wrong), + path_correct + ) }) From 2cee6fb28e3c5d8c8a9f5c6cac5d365b49eadf20 Mon Sep 17 00:00:00 2001 From: Malte Kyhos Date: Sat, 5 Feb 2022 13:07:57 +0100 Subject: [PATCH 46/57] Asset: restructure --- R/asset.R | 129 ++++++++++++++++++++++-------------------------------- R/utils.R | 20 +++++++++ 2 files changed, 72 insertions(+), 77 deletions(-) diff --git a/R/asset.R b/R/asset.R index 59c3830..9dc175d 100644 --- a/R/asset.R +++ b/R/asset.R @@ -1,77 +1,8 @@ #' Asset #' Class to hold an asset +#' @param asset_list list. a list with the asset data, such as obtained through a call to assets/{id} +#' @param kobo Kobo instance. Instance of class Kobo used internally to make requests to the API. Asset <- R6::R6Class("Asset", - active = list( - #' @field uid - #' uid of the asset. - uid = function(value) { - if (missing(value)) { - return(private$.uid) - } else { - ui_stop("Read-only.") - } - }, - #' @field name - #' name of the asset. - name = function(value) { - if (missing(value)) { - return(private$.name) - } else { - ui_stop("Read-only.") - } - }, - #' @field asset_url - #' asset_url of the asset. takes the form of assets/{uid}/ - #' Contains most of the information about an asset such as meta data, permissions, xls form content and - #' links to other related endpoints. - asset_url = function(value) { - if (missing(value)) { - return(private$.asset_url) - } else { - ui_stop("Read-only.") - } - }, - #' @field data_url - #' data_url of the asset. This can be used to get data related to the asset. - #' Most useful for the asset type `survey` where this URL - #' gives access to the submissions to the survey. - data_url = function(value) { - if (missing(value)) { - return(private$.data_url) - } else { - ui_stop("Read-only.") - } - }, - #' @field owner_username - #' username of the owner of the asset. - owner_username = function(value) { - if (missing(value)) { - return(private$.owner_username) - } else { - ui_stop("Read-only.") - } - }, - #' @field type - #' type of the asset. Type of the asset, e.g. survey, question, block or template. - type = function(value) { - if (missing(value)) { - return(private$.type) - } else { - ui_stop("Read-only.") - } - } - ), - private = list( - .uid = NA, - .name = NA, - .asset_url = NA, - .data_url = NA, - .owner_username = NA, - .type = NA, - .kobo = NULL - ), - #' @param asset_list list. a list with the asset data, such as obtained through a call to assets/{id} - #' @param kobo Kobo instance. Instance of class Kobo used internally to make requests to the API. public = list( initialize = function(asset_list, kobo) { # check that everything exists in list that we need @@ -84,15 +15,14 @@ Asset <- R6::R6Class("Asset", } private$.uid <- asset_list$uid - private$.name <- asset_list$name - private$.asset_url <- asset_list$url + private$.name <- assert_string(asset_list$name) + private$.asset_url <- assert_string(asset_list$url) private$.data_url <- asset_list$data - private$.owner_username <- asset_list$owner__username - private$.type <- asset_list$asset_type + private$.owner_username <- assert_string(asset_list$owner__username) + private$.type <- assert_string(asset_list$asset_type) # kobo instance - assert_class(kobo, c("R6", "Kobo")) - private$.kobo <- kobo + private$.kobo <- assert_class(kobo, c("R6", "Kobo")) }, #' get_submissions @@ -118,5 +48,50 @@ Asset <- R6::R6Class("Asset", type = private$.type ) } + ), + private = list( + .uid = NA, + .name = NA, + .asset_url = NA, + .data_url = NA, + .owner_username = NA, + .type = NA, + .kobo = NULL + ), + active = list( + #' @field uid + #' uid of the asset. + uid = function(value) { + read_only_active(private, ".uid", value) + }, + #' @field name + #' name of the asset. + name = function(value) { + read_only_active(private, ".name", value) + }, + #' @field asset_url + #' asset_url of the asset. takes the form of assets/{uid}/ + #' Contains most of the information about an asset such as meta data, permissions, xls form content and + #' links to other related endpoints. + asset_url = function(value) { + read_only_active(private, ".asset_url", value) + }, + #' @field data_url + #' data_url of the asset. This can be used to get data related to the asset. + #' Most useful for the asset type `survey` where this URL + #' gives access to the submissions to the survey. + data_url = function(value) { + read_only_active(private, ".data_url", value) + }, + #' @field owner_username + #' username of the owner of the asset. + owner_username = function(value) { + read_only_active(private, ".owner_username", value) + }, + #' @field type + #' type of the asset. Type of the asset, e.g. survey, question, block or template. + type = function(value) { + read_only_active(private, ".type", value) + } ) ) diff --git a/R/utils.R b/R/utils.R index e40b0aa..73a26c9 100644 --- a/R/utils.R +++ b/R/utils.R @@ -36,3 +36,23 @@ list_as_json_char <- function(list) { jsonlite::toJSON(x = list, pretty = TRUE, auto_unbox = TRUE) %>% as.character() } + + +#' @title Access Read-Only Active Bindings +#' +#' @description +#' Template function to create a read-only active binding. +#' @param private Pointer to the private env of an object +#' @param field character(1) the (private) field name used as a storage +#' for the active field +#' @param val The value passed to the active binding. If it is not missing, +#' the function will stop. +#' @return The value of the active binding-related storage field. +read_only_active <- function(private, field, val) { + assert_string(field) + if (!missing(val)) { + ui_stop("Field '%s' is read-only.", field) + } else { + return(private[[field]]) + } +} From e8284cdece2834ecbf3a6a39a4430d9bac828397 Mon Sep 17 00:00:00 2001 From: Malte Kyhos Date: Sat, 5 Feb 2022 13:08:35 +0100 Subject: [PATCH 47/57] KoboClient: bring R6 elements in order --- R/kobo-client.R | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/R/kobo-client.R b/R/kobo-client.R index 29c8bcc..7aea7de 100644 --- a/R/kobo-client.R +++ b/R/kobo-client.R @@ -5,11 +5,6 @@ #' @export KoboClient <- R6::R6Class("KoboClient", inherit = crul::HttpClient, - private = list( - base_url = "", - kobo_token = "" - ), # - public = list( #' @description #' Initialization method for class "KoboClient". @@ -82,5 +77,9 @@ KoboClient <- R6::R6Class("KoboClient", res$raise_for_status() return(res) } - ) # + ), # + private = list( + base_url = "", + kobo_token = "" + ) # ) From 181ad9a13fea426937585048c3289103b564e79f Mon Sep 17 00:00:00 2001 From: Malte Kyhos Date: Sat, 5 Feb 2022 13:10:53 +0100 Subject: [PATCH 48/57] Update docs --- DESCRIPTION | 2 +- NAMESPACE | 1 - man/list_as_json_char.Rd | 4 ++-- man/read_only_active.Rd | 23 +++++++++++++++++++++++ 4 files changed, 26 insertions(+), 4 deletions(-) create mode 100644 man/read_only_active.Rd diff --git a/DESCRIPTION b/DESCRIPTION index 6f871b9..a379bf2 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -36,5 +36,5 @@ Imports: jsonlite, tibble Roxygen: list(markdown = TRUE) -RoxygenNote: 7.1.1 +RoxygenNote: 7.1.2 VignetteBuilder: knitr diff --git a/NAMESPACE b/NAMESPACE index 2909137..3bf32fc 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -5,7 +5,6 @@ export(Kobo) export(KoboClient) import(checkmate) importFrom(crul,HttpClient) -importFrom(glue,glue) importFrom(magrittr,"%>%") importFrom(tibble,tibble) importFrom(usethis,ui_info) diff --git a/man/list_as_json_char.Rd b/man/list_as_json_char.Rd index 42fc4ac..283926f 100644 --- a/man/list_as_json_char.Rd +++ b/man/list_as_json_char.Rd @@ -17,8 +17,8 @@ Converts R lists to JSON-like strings for POST request's body. \examples{ \dontrun{ example_body <- list_as_json_char(list( - "name" = "A survey object created via API/R", - "asset_type" = "survey" + "name" = "A survey object created via API/R", + "asset_type" = "survey" )) } diff --git a/man/read_only_active.Rd b/man/read_only_active.Rd new file mode 100644 index 0000000..c53737a --- /dev/null +++ b/man/read_only_active.Rd @@ -0,0 +1,23 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/utils.R +\name{read_only_active} +\alias{read_only_active} +\title{Access Read-Only Active Bindings} +\usage{ +read_only_active(private, field, val) +} +\arguments{ +\item{private}{Pointer to the private env of an object} + +\item{field}{character(1) the (private) field name used as a storage +for the active field} + +\item{val}{The value passed to the active binding. If it is not missing, +the function will stop.} +} +\value{ +The value of the active binding-related storage field. +} +\description{ +Template function to create a read-only active binding. +} From fbea853612765c399d93b05f3d55790797deaa63 Mon Sep 17 00:00:00 2001 From: Malte Kyhos Date: Sat, 5 Feb 2022 13:19:04 +0100 Subject: [PATCH 49/57] Asset: fix the active binding access util --- R/asset.R | 12 ++++++------ R/utils.R | 9 +++++---- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/R/asset.R b/R/asset.R index 9dc175d..5ebf2a6 100644 --- a/R/asset.R +++ b/R/asset.R @@ -62,36 +62,36 @@ Asset <- R6::R6Class("Asset", #' @field uid #' uid of the asset. uid = function(value) { - read_only_active(private, ".uid", value) + read_only_active(private, "uid", value) }, #' @field name #' name of the asset. name = function(value) { - read_only_active(private, ".name", value) + read_only_active(private, "name", value) }, #' @field asset_url #' asset_url of the asset. takes the form of assets/{uid}/ #' Contains most of the information about an asset such as meta data, permissions, xls form content and #' links to other related endpoints. asset_url = function(value) { - read_only_active(private, ".asset_url", value) + read_only_active(private, "asset_url", value) }, #' @field data_url #' data_url of the asset. This can be used to get data related to the asset. #' Most useful for the asset type `survey` where this URL #' gives access to the submissions to the survey. data_url = function(value) { - read_only_active(private, ".data_url", value) + read_only_active(private, "data_url", value) }, #' @field owner_username #' username of the owner of the asset. owner_username = function(value) { - read_only_active(private, ".owner_username", value) + read_only_active(private, "owner_username", value) }, #' @field type #' type of the asset. Type of the asset, e.g. survey, question, block or template. type = function(value) { - read_only_active(private, ".type", value) + read_only_active(private, "type", value) } ) ) diff --git a/R/utils.R b/R/utils.R index 73a26c9..e678441 100644 --- a/R/utils.R +++ b/R/utils.R @@ -43,16 +43,17 @@ list_as_json_char <- function(list) { #' @description #' Template function to create a read-only active binding. #' @param private Pointer to the private env of an object -#' @param field character(1) the (private) field name used as a storage -#' for the active field +#' @param field character(1) the name of the active binding field. It is assumed +#' that a private field prefixed with a single dot exists, that servers as +#' storage. #' @param val The value passed to the active binding. If it is not missing, #' the function will stop. #' @return The value of the active binding-related storage field. read_only_active <- function(private, field, val) { assert_string(field) if (!missing(val)) { - ui_stop("Field '%s' is read-only.", field) + ui_stop(sprintf("Field '%s' is read-only.", field)) } else { - return(private[[field]]) + return(private[[paste0(".", field)]]) } } From fe35f7ceaa8b996d631628dba074754181ae211f Mon Sep 17 00:00:00 2001 From: Malte Kyhos Date: Sat, 5 Feb 2022 13:28:44 +0100 Subject: [PATCH 50/57] Add Section headers to R6 objects --- R/asset.R | 11 +++++++++++ R/kobo-client.R | 6 ++++++ R/kobo.R | 5 +++++ 3 files changed, 22 insertions(+) diff --git a/R/asset.R b/R/asset.R index 5ebf2a6..8361682 100644 --- a/R/asset.R +++ b/R/asset.R @@ -4,6 +4,9 @@ #' @param kobo Kobo instance. Instance of class Kobo used internally to make requests to the API. Asset <- R6::R6Class("Asset", public = list( + + # Public Methods =========================================================== + initialize = function(asset_list, kobo) { # check that everything exists in list that we need needed_names <- c("uid", "name", "url", "data", "owner__username", "asset_type") @@ -50,6 +53,11 @@ Asset <- R6::R6Class("Asset", } ), private = list( + + # Private Fields =========================================================== + + # Storage fields for Active Bindings --------------------------------------- + .uid = NA, .name = NA, .asset_url = NA, @@ -59,6 +67,9 @@ Asset <- R6::R6Class("Asset", .kobo = NULL ), active = list( + + # Active Bindings ========================================================== + #' @field uid #' uid of the asset. uid = function(value) { diff --git a/R/kobo-client.R b/R/kobo-client.R index 7aea7de..fef7620 100644 --- a/R/kobo-client.R +++ b/R/kobo-client.R @@ -6,6 +6,9 @@ KoboClient <- R6::R6Class("KoboClient", inherit = crul::HttpClient, public = list( + + # Public Methods =========================================================== + #' @description #' Initialization method for class "KoboClient". #' @param base_url character. The full base URL of the API. @@ -79,6 +82,9 @@ KoboClient <- R6::R6Class("KoboClient", } ), # private = list( + + # Private Fields =========================================================== + base_url = "", kobo_token = "" ) # diff --git a/R/kobo.R b/R/kobo.R index 7233003..2843652 100644 --- a/R/kobo.R +++ b/R/kobo.R @@ -9,11 +9,16 @@ Kobo <- R6::R6Class("Kobo", # private = list( # ), public = list( + + # Public Fields ============================================================ + #' @field session_v2 [kbtbr::KoboClient] session for v2 of the API session_v2 = NULL, #' @field session_v1 `KoboClient` session for v1 of the API session_v1 = NULL, + # Public Methods =========================================================== + #' @description #' Initialization method for class "Kobo". #' @param base_url_v2 character. The base URL of the API version 2 From bc30a2859216ce8be2d5a6117fdf18ea6cfe4ce5 Mon Sep 17 00:00:00 2001 From: Malte Kyhos Date: Sat, 5 Feb 2022 14:45:24 +0100 Subject: [PATCH 51/57] Apply new indent --- R/asset.R | 204 ++++----- R/kobo-client.R | 148 +++---- R/kobo-paginator.R | 118 ++--- R/kobo.R | 459 ++++++++++---------- R/list_as_json_char.R | 8 +- R/utils.R | 16 +- tests/testthat/setup-kbtbr.R | 22 +- tests/testthat/test-asset.R | 118 ++--- tests/testthat/test-kobo-client.R | 50 +-- tests/testthat/test-kobo.R | 690 +++++++++++++++--------------- tests/testthat/test-utils.R | 20 +- 11 files changed, 927 insertions(+), 926 deletions(-) diff --git a/R/asset.R b/R/asset.R index b82f180..b6877c2 100644 --- a/R/asset.R +++ b/R/asset.R @@ -1,108 +1,108 @@ #' Asset #' Class to hold an asset Asset <- R6::R6Class("Asset", - active = list( - #' @field uid - #' uid of the asset. - uid = function(value) { - if (missing(value)) { - return(private$.uid) - } else { - usethis::ui_stop("Read-only.") - } - }, - #' @field name - #' name of the asset. - name = function(value) { - if (missing(value)) { - return(private$.name) - } else { - usethis::ui_stop("Read-only.") - } - }, - #' @field asset_url - #' asset_url of the asset. takes the form of assets/{uid}/ - #' Contains most of the information about an asset such as meta data, permissions, xls form content and - #' links to other related endpoints. - asset_url = function(value) { - if (missing(value)) { - return(private$.asset_url) - } else { - usethis::ui_stop("Read-only.") - } - }, - #' @field data_url - #' data_url of the asset. This can be used to get data related to the asset. - #' Most useful for the asset type `survey` where this URL - #' gives access to the submissions to the survey. - data_url = function(value) { - if (missing(value)) { - return(private$.data_url) - } else { - usethis::ui_stop("Read-only.") - } - }, - #' @field owner_username - #' username of the owner of the asset. - owner_username = function(value) { - if (missing(value)) { - return(private$.owner_username) - } else { - usethis::ui_stop("Read-only.") - } - }, - #' @field type - #' type of the asset. Type of the asset, e.g. survey, question, block or template. - type = function(value) { - if (missing(value)) { - return(private$.type) - } else { - usethis::ui_stop("Read-only.") - } - } - ), - private = list( - .uid = NA, - .name = NA, - .asset_url = NA, - .data_url = NA, - .owner_username = NA, - .type = NA, - .kobo = NULL - ), - #' @param asset_list list. a list with the asset data, such as obtained through a call to assets/{id} - #' @param kobo Kobo instance. Instance of class Kobo used internally to make requests to the API. - public = list( - initialize = function(asset_list, kobo) { - # check that everything exists in list that we need - needed_names <- c("uid", "name", "url", "data", "owner__username", "asset_type") - if (!checkmate::test_subset(needed_names, names(asset_list))) { - missing_elements <- setdiff(needed_names, names(asset_list)) %>% paste(collapse = ", ") - usethis::ui_stop(glue::glue("Argument asset_list is missing the following required elements: {missing_elements}")) - } + active = list( + #' @field uid + #' uid of the asset. + uid = function(value) { + if (missing(value)) { + return(private$.uid) + } else { + usethis::ui_stop("Read-only.") + } + }, + #' @field name + #' name of the asset. + name = function(value) { + if (missing(value)) { + return(private$.name) + } else { + usethis::ui_stop("Read-only.") + } + }, + #' @field asset_url + #' asset_url of the asset. takes the form of assets/{uid}/ + #' Contains most of the information about an asset such as meta data, permissions, xls form content and + #' links to other related endpoints. + asset_url = function(value) { + if (missing(value)) { + return(private$.asset_url) + } else { + usethis::ui_stop("Read-only.") + } + }, + #' @field data_url + #' data_url of the asset. This can be used to get data related to the asset. + #' Most useful for the asset type `survey` where this URL + #' gives access to the submissions to the survey. + data_url = function(value) { + if (missing(value)) { + return(private$.data_url) + } else { + usethis::ui_stop("Read-only.") + } + }, + #' @field owner_username + #' username of the owner of the asset. + owner_username = function(value) { + if (missing(value)) { + return(private$.owner_username) + } else { + usethis::ui_stop("Read-only.") + } + }, + #' @field type + #' type of the asset. Type of the asset, e.g. survey, question, block or template. + type = function(value) { + if (missing(value)) { + return(private$.type) + } else { + usethis::ui_stop("Read-only.") + } + } + ), + private = list( + .uid = NA, + .name = NA, + .asset_url = NA, + .data_url = NA, + .owner_username = NA, + .type = NA, + .kobo = NULL + ), + #' @param asset_list list. a list with the asset data, such as obtained through a call to assets/{id} + #' @param kobo Kobo instance. Instance of class Kobo used internally to make requests to the API. + public = list( + initialize = function(asset_list, kobo) { + # check that everything exists in list that we need + needed_names <- c("uid", "name", "url", "data", "owner__username", "asset_type") + if (!checkmate::test_subset(needed_names, names(asset_list))) { + missing_elements <- setdiff(needed_names, names(asset_list)) %>% paste(collapse = ", ") + usethis::ui_stop(glue::glue("Argument asset_list is missing the following required elements: {missing_elements}")) + } - private$.uid <- asset_list$uid - private$.name <- asset_list$name - private$.asset_url <- asset_list$url - private$.data_url <- asset_list$data - private$.owner_username <- asset_list$owner__username - private$.type <- asset_list$asset_type + private$.uid <- asset_list$uid + private$.name <- asset_list$name + private$.asset_url <- asset_list$url + private$.data_url <- asset_list$data + private$.owner_username <- asset_list$owner__username + private$.type <- asset_list$asset_type - # kobo instance - checkmate::assert_class(kobo, c("R6", "Kobo")) - private$.kobo <- kobo - }, - #' to_list - #' @return list representation of asset - to_list = function() { - list( - uid = private$.uid, - name = private$.name, - asset_url = private$.asset_url, - data_url = private$.data_url, - owner_username = private$.owner_username, - type = private$.type - ) - } - ) + # kobo instance + checkmate::assert_class(kobo, c("R6", "Kobo")) + private$.kobo <- kobo + }, + #' to_list + #' @return list representation of asset + to_list = function() { + list( + uid = private$.uid, + name = private$.name, + asset_url = private$.asset_url, + data_url = private$.data_url, + owner_username = private$.owner_username, + type = private$.type + ) + } + ) ) diff --git a/R/kobo-client.R b/R/kobo-client.R index c4abc5e..5d51196 100644 --- a/R/kobo-client.R +++ b/R/kobo-client.R @@ -6,84 +6,84 @@ #' @importFrom usethis ui_stop #' @export KoboClient <- R6::R6Class("KoboClient", - inherit = crul::HttpClient, - private = list( - base_url = "", - kobo_token = "" - ), # + inherit = crul::HttpClient, + private = list( + base_url = "", + kobo_token = "" + ), # - public = list( - #' @description - #' Initialization method for class "KoboClient". - #' @param base_url character. The full base URL of the API. - #' @param kobo_token character. The API token. Defaults to requesting - #' the system environment variable `KBTBR_TOKEN`. - initialize = function(base_url, - kobo_token = Sys.getenv("KBTBR_TOKEN")) { + public = list( + #' @description + #' Initialization method for class "KoboClient". + #' @param base_url character. The full base URL of the API. + #' @param kobo_token character. The API token. Defaults to requesting + #' the system environment variable `KBTBR_TOKEN`. + initialize = function(base_url, + kobo_token = Sys.getenv("KBTBR_TOKEN")) { - # Check and set private fields - checkmate::assert_character(kobo_token) - if (kobo_token == "") { - usethis::ui_stop( - "No valid token detected. Set the KBTBR_TOKEN environment + # Check and set private fields + checkmate::assert_character(kobo_token) + if (kobo_token == "") { + usethis::ui_stop( + "No valid token detected. Set the KBTBR_TOKEN environment variable or pass the token directly to the function (not recommended)." - ) - } - private$kobo_token <- kobo_token - private$base_url <- base_url + ) + } + private$kobo_token <- kobo_token + private$base_url <- base_url - super$initialize( - url = base_url, - headers = list( - Authorization = paste0("Token ", kobo_token), - Accept = "application/json" - # "content-type" = "application/json" - ) - ) - }, - #' @description - #' Perform a GET request (with additional checks) - #' - #' @details - #' Extension of the `crul::HttpClient$get()` method that checks - #' the HttpResponse object on status, that it is of type - #' `application/json`, and parses the response text subsequently from - #' JSON to R list representation. - #' @param path character. Path component of the endpoint. - #' @param query list. A named list which is parsed to the query - #' component. The order is not hierarchical. - #' @param ... crul-options. Additional option arguments, see - #' [`crul::HttpClient`] for reference - #' @return the server response as a crul::HttpResponse object. - get = function(path, query = list(), ...) { - path <- check_repair_path(path) - res <- super$get(path = path, query = query, ...) - return(res) - }, + super$initialize( + url = base_url, + headers = list( + Authorization = paste0("Token ", kobo_token), + Accept = "application/json" + # "content-type" = "application/json" + ) + ) + }, + #' @description + #' Perform a GET request (with additional checks) + #' + #' @details + #' Extension of the `crul::HttpClient$get()` method that checks + #' the HttpResponse object on status, that it is of type + #' `application/json`, and parses the response text subsequently from + #' JSON to R list representation. + #' @param path character. Path component of the endpoint. + #' @param query list. A named list which is parsed to the query + #' component. The order is not hierarchical. + #' @param ... crul-options. Additional option arguments, see + #' [`crul::HttpClient`] for reference + #' @return the server response as a crul::HttpResponse object. + get = function(path, query = list(), ...) { + path <- check_repair_path(path) + res <- super$get(path = path, query = query, ...) + return(res) + }, - #' @description - #' Perform a POST request - #' - #' @details - #' Extension of the `crul::HttpClient$post()` method. - #' @param path character. Path component of the endpoint. - #' @param body R list. A data payload to be sent to the server. - #' @param ... crul-options. Additional option arguments, see - #' [`crul::HttpClient`] for reference - #' @return Returns an object of class `crul::HttpResponse`. - post = function(path, body, ...) { - path <- check_repair_path(path) - res <- super$post(path = path, body = body, ...) - res$raise_for_status() - return(res) - }, - # GETTERS and SETTERS (utils) --- - #' @description - #' Retrieve the private `base_url` field - #' @return A character vector of length one. - get_base_url = function() { - return(private$base_url) - } - ) # + #' @description + #' Perform a POST request + #' + #' @details + #' Extension of the `crul::HttpClient$post()` method. + #' @param path character. Path component of the endpoint. + #' @param body R list. A data payload to be sent to the server. + #' @param ... crul-options. Additional option arguments, see + #' [`crul::HttpClient`] for reference + #' @return Returns an object of class `crul::HttpResponse`. + post = function(path, body, ...) { + path <- check_repair_path(path) + res <- super$post(path = path, body = body, ...) + res$raise_for_status() + return(res) + }, + # GETTERS and SETTERS (utils) --- + #' @description + #' Retrieve the private `base_url` field + #' @return A character vector of length one. + get_base_url = function() { + return(private$base_url) + } + ) # ) diff --git a/R/kobo-paginator.R b/R/kobo-paginator.R index 73e7788..30c4c66 100644 --- a/R/kobo-paginator.R +++ b/R/kobo-paginator.R @@ -4,68 +4,68 @@ #' the Kobotoolbox API. #' @export KoboPaginator <- R6::R6Class( - public = list( - client = NULL, - #' @description - #' @param client KoboClient. An instance of a KoboClient that can - #' be used for the paginated requestes. - initialize = function(client) { - stopifnot("KoboClient" %in% class(client)) + public = list( + client = NULL, + #' @description + #' @param client KoboClient. An instance of a KoboClient that can + #' be used for the paginated requestes. + initialize = function(client) { + stopifnot("KoboClient" %in% class(client)) - private$client <- client - }, - #' @description - #' @param path - get = function(path, query, ...) { - private$page(method = "get") - }, - #' @description - #' Set the initial response - #' @details - #' Usually, the page method would revoke a first response in the - #' normal way, using its `next` element to walk over all subsequent - #' pages. In some settings, the user might provide this initial response - #' object already. - set_first_response = function(response) { - checkmate::assert_list(response) - private$resps <- response - }, - get_responses = function() { - return(private$resps) - } - ), - private = list( - resps = NULL, - page = function(path, query, sleep = 0, ...) { - checkmate::assert_choice(method, "get") - tmp <- list() - - # Retrieve initial response - tmp[[1]] <- private$resps %||% - self$client$get(path, query) - cnt <- 1 - next_link <- tmp[[cnt]][["next"]] + private$client <- client + }, + #' @description + #' @param path + get = function(path, query, ...) { + private$page(method = "get") + }, + #' @description + #' Set the initial response + #' @details + #' Usually, the page method would revoke a first response in the + #' normal way, using its `next` element to walk over all subsequent + #' pages. In some settings, the user might provide this initial response + #' object already. + set_first_response = function(response) { + checkmate::assert_list(response) + private$resps <- response + }, + get_responses = function() { + return(private$resps) + } + ), + private = list( + resps = NULL, + page = function(path, query, sleep = 0, ...) { + checkmate::assert_choice(method, "get") + tmp <- list() - while (!is.null(next_link)) { - tmp_path <- private$resolve_next(next_link) - cnt <- cnt + 1 - tmp[[cnt]] <- self$client$get(tmp_path, query) - tmp[[cnt]]$raise_for_status() + # Retrieve initial response + tmp[[1]] <- private$resps %||% + self$client$get(path, query) + cnt <- 1 + next_link <- tmp[[cnt]][["next"]] - next_link <- tmp[[cnt]][["next"]] - Sys.sleep(sleep) - } + while (!is.null(next_link)) { + tmp_path <- private$resolve_next(next_link) + cnt <- cnt + 1 + tmp[[cnt]] <- self$client$get(tmp_path, query) + tmp[[cnt]]$raise_for_status() - private$resps <- tmp - }, - resolve_next = function(link) { - # Subtract base path etc. from - resolved <- gsub( - pattern = paste0("^", self$client$get_base_url()), - replacement = "", - x = link) - return(resolved) - } + next_link <- tmp[[cnt]][["next"]] + Sys.sleep(sleep) + } - ) + private$resps <- tmp + }, + resolve_next = function(link) { + # Subtract base path etc. from + resolved <- gsub( + pattern = paste0("^", self$client$get_base_url()), + replacement = "", + x = link + ) + return(resolved) + } + ) ) diff --git a/R/kobo.R b/R/kobo.R index 2fecdfd..1802643 100644 --- a/R/kobo.R +++ b/R/kobo.R @@ -6,253 +6,254 @@ #' interactions with the various endpoints. #' @export Kobo <- R6::R6Class("Kobo", - private = list( - select_prep_client = function(path, version) { - checkmate::assert_choice(version, c("v1", "v2")) + private = list( + select_prep_client = function(path, version) { + checkmate::assert_choice(version, c("v1", "v2")) - if (version == "v2") { - obj <- list( - client = self$session_v2, - path = paste0("api/v2/", path)) - } else if (version == "v1") { - if (checkmate::test_null(self$session_v1)) { - usethis::ui_stop(paste( - "Session for API v1 is not initalized.", - "Please re-initalize the Kobo client with the", - "base_url_v1 argument.")) - } - obj <- list( - client = self$session_v1, - path = paste0("api/v1/", path)) - } - return(obj) + if (version == "v2") { + obj <- list( + client = self$session_v2, + path = paste0("api/v2/", path) + ) + } else if (version == "v1") { + if (checkmate::test_null(self$session_v1)) { + usethis::ui_stop(paste( + "Session for API v1 is not initalized.", + "Please re-initalize the Kobo client with the", + "base_url_v1 argument." + )) } - ), - public = list( - #' @field session_v2 KoboClient session for v2 of the API - session_v2 = NULL, - #' @field session_v1 KoboClient session for v1 of the API - session_v1 = NULL, + obj <- list( + client = self$session_v1, + path = paste0("api/v1/", path) + ) + } + return(obj) + } + ), + public = list( + #' @field session_v2 KoboClient session for v2 of the API + session_v2 = NULL, + #' @field session_v1 KoboClient session for v1 of the API + session_v1 = NULL, - #' @description - #' Initialization method for class "Kobo". - #' @param base_url_v2 character. The base URL of the API version 2 - #' (known as /api/v2). For example: https://kobo.correlaid.org. - #' @param base_url_v1 character. The base URL of the API of your KoBoCAT - #' API (also known as /api/v1). Defaults to NULL. - #' For example: https://kc.correlaid.org. - #' @param kobo_token character. The API token. Defaults to requesting - #' the systen environment `KBTBR_TOKEN`. - #' @param session_v2 KoboClient. Alternatively, pass directly - #' a KoboClient instance for the API version v2. - #' @param session_v1 KoboKlient. In addition to session_v2 one can pass - #' also a KoboClient instance for the API version v1. - initialize = function(base_url_v2 = NULL, base_url_v1 = NULL, - kobo_token = Sys.getenv("KBTBR_TOKEN"), - session_v2 = NULL, session_v1 = NULL) { + #' @description + #' Initialization method for class "Kobo". + #' @param base_url_v2 character. The base URL of the API version 2 + #' (known as /api/v2). For example: https://kobo.correlaid.org. + #' @param base_url_v1 character. The base URL of the API of your KoBoCAT + #' API (also known as /api/v1). Defaults to NULL. + #' For example: https://kc.correlaid.org. + #' @param kobo_token character. The API token. Defaults to requesting + #' the systen environment `KBTBR_TOKEN`. + #' @param session_v2 KoboClient. Alternatively, pass directly + #' a KoboClient instance for the API version v2. + #' @param session_v1 KoboKlient. In addition to session_v2 one can pass + #' also a KoboClient instance for the API version v1. + initialize = function(base_url_v2 = NULL, base_url_v1 = NULL, + kobo_token = Sys.getenv("KBTBR_TOKEN"), + session_v2 = NULL, session_v1 = NULL) { - # one has to pass at least base_url_v2 or session_v2 - if (!xor( - checkmate::test_null(base_url_v2), - checkmate::test_null(session_v2) - )) { - stop("Either base_url_v2 or session_v2 must be provided") - } + # one has to pass at least base_url_v2 or session_v2 + if (!xor( + checkmate::test_null(base_url_v2), + checkmate::test_null(session_v2) + )) { + stop("Either base_url_v2 or session_v2 must be provided") + } - if (!checkmate::test_null(base_url_v2)) { - self$session_v2 <- KoboClient$new(base_url_v2, kobo_token) - } else { - self$session_v2 <- session_v2 - } + if (!checkmate::test_null(base_url_v2)) { + self$session_v2 <- KoboClient$new(base_url_v2, kobo_token) + } else { + self$session_v2 <- session_v2 + } - if (!checkmate::test_null(base_url_v1)) { - self$session_v1 <- KoboClient$new(base_url_v1, kobo_token) - } else if (!checkmate::test_null(session_v1)) { - self$session_v1 <- session_v1 - } else { - # TODO: add to warning once we know what functnality is covered by v1. - usethis::ui_info("You have not passed base_url_v1. This means you cannot use the following functions:") - } - }, - #' @description - #' Wrapper for the GET method of internal session objects. - #' @param path character. Path component of the endpoint. - #' @param query list. A named list which is parsed to the query - #' component. The order is not hierarchical. - #' @param version character. Indicates on which API version the request should be executed (available: `v1`, `v2`). Defaults to `v2`. - #' @param format character. the format to request from the server. either 'json' or 'csv'. defaults to 'json' - #' @param parse whether or not to parse the HTTP response. defaults to TRUE. - #' @return a list encoding of the json server reply if parse=TRUE. - #' Otherwise, it returns the server response as a crul::HttpResponse - #' object. - get = function(path, query = list(), version = "v2", format = "json", - parse = TRUE) { - if (!format %in% c("json", "csv")) { - usethis::ui_stop("Unsupported format. Only 'json' and 'csv' are supported") - } - - query$format <- format - - # Select client - obj <- private$select_prep_client(path, version) - res <- obj$client$get(obj$path, query) - res$raise_for_status() + if (!checkmate::test_null(base_url_v1)) { + self$session_v1 <- KoboClient$new(base_url_v1, kobo_token) + } else if (!checkmate::test_null(session_v1)) { + self$session_v1 <- session_v1 + } else { + # TODO: add to warning once we know what functnality is covered by v1. + usethis::ui_info("You have not passed base_url_v1. This means you cannot use the following functions:") + } + }, + #' @description + #' Wrapper for the GET method of internal session objects. + #' @param path character. Path component of the endpoint. + #' @param query list. A named list which is parsed to the query + #' component. The order is not hierarchical. + #' @param version character. Indicates on which API version the request should be executed (available: `v1`, `v2`). Defaults to `v2`. + #' @param format character. the format to request from the server. either 'json' or 'csv'. defaults to 'json' + #' @param parse whether or not to parse the HTTP response. defaults to TRUE. + #' @return a list encoding of the json server reply if parse=TRUE. + #' Otherwise, it returns the server response as a crul::HttpResponse + #' object. + get = function(path, query = list(), version = "v2", format = "json", + parse = TRUE) { + if (!format %in% c("json", "csv")) { + usethis::ui_stop("Unsupported format. Only 'json' and 'csv' are supported") + } - if (parse && format == "json") { - res$raise_for_ct_json() - return(jsonlite::fromJSON(res$parse("UTF-8"))) - } else if (parse && format == "csv") { - usethis::ui_stop( - "TODO: Not supported yet" - ) - } else if (parse) { - usethis::ui_stop( - "TODO: Not supported yet" - ) - } - return(res) - }, + query$format <- format - get_paginated = function(path, query, version = "v2", - format = "json", - parse = TRUE) { + # Select client + obj <- private$select_prep_client(path, version) + res <- obj$client$get(obj$path, query) + res$raise_for_status() - obj <- private$select_prep_client(path, version) - paginator <- KoboPaginator$new(client = obj$client) - res <- paginator$get(path, query) - }, + if (parse && format == "json") { + res$raise_for_ct_json() + return(jsonlite::fromJSON(res$parse("UTF-8"))) + } else if (parse && format == "csv") { + usethis::ui_stop( + "TODO: Not supported yet" + ) + } else if (parse) { + usethis::ui_stop( + "TODO: Not supported yet" + ) + } + return(res) + }, + get_paginated = function(path, query, version = "v2", + format = "json", + parse = TRUE) { + obj <- private$select_prep_client(path, version) + paginator <- KoboPaginator$new(client = obj$client) + res <- paginator$get(path, query) + }, - #' @description - #' Wrapper for the POST method of internal session objects. - #' @param path character. Path component of the endpoint. - #' @param body R list. A data payload to be sent to the server. - #' @param version character. Indicates on which API version the request - #' should be executed (available: `v1`, `v2`). Defaults to `v2`. - #' @return Returns an object of class `crul::HttpResponse`. - post = function(path, body, version = "v2") { - if (version == "v2") { - if (path != "imports/") { - self$session_v2$post(path = paste0("api/v2/", path), body = body) - } else { - self$session_v2$post(path = path, body = body) - } - } else if (version == "v1") { - if (checkmate::test_null(self$session_v1)) { - usethis::ui_stop("Session for API v1 is not initalized. + #' @description + #' Wrapper for the POST method of internal session objects. + #' @param path character. Path component of the endpoint. + #' @param body R list. A data payload to be sent to the server. + #' @param version character. Indicates on which API version the request + #' should be executed (available: `v1`, `v2`). Defaults to `v2`. + #' @return Returns an object of class `crul::HttpResponse`. + post = function(path, body, version = "v2") { + if (version == "v2") { + if (path != "imports/") { + self$session_v2$post(path = paste0("api/v2/", path), body = body) + } else { + self$session_v2$post(path = path, body = body) + } + } else if (version == "v1") { + if (checkmate::test_null(self$session_v1)) { + usethis::ui_stop("Session for API v1 is not initalized. Please re-initalize the Kobo client with the base_url_v1 argument.") - } - self$session_v1$post(path = paste0("api/v1/", path), body = body) - } else { - usethis::ui_stop( - "Invalid version. Must be either v1 or v2. + } + self$session_v1$post(path = paste0("api/v1/", path), body = body) + } else { + usethis::ui_stop( + "Invalid version. Must be either v1 or v2. Come back in a couple of years." - ) - } - }, + ) + } + }, - #' @description - #' Example method to send a GET request to the `assets` endpoint - #' (due to default to `v2`, no further specification is needed). - get_assets = function() { - self$get("assets/") - }, + #' @description + #' Example method to send a GET request to the `assets` endpoint + #' (due to default to `v2`, no further specification is needed). + get_assets = function() { + self$get("assets/") + }, - #' @description - #' Get an asset given its id. - #' @param id character. ID of the asset within the Kobo API. - #' @return Asset. object of class [kbtbr::Asset] - get_asset = function(id) { - res <- self$get(glue::glue("assets/{id}/")) - Asset$new(res, self) - }, + #' @description + #' Get an asset given its id. + #' @param id character. ID of the asset within the Kobo API. + #' @return Asset. object of class [kbtbr::Asset] + get_asset = function(id) { + res <- self$get(glue::glue("assets/{id}/")) + Asset$new(res, self) + }, - #' High-level POST request to clone an asset. `assets` endpoint - #' (due to default to `v2`, no further specification is needed). - #' @param clone_from character. UID of the asset to be cloned. - #' @param new_name character. Name of the new asset. - #' @param asset_type character. Type of the new asset. Can be - #' "block", "question", "survey", "template". - #' @return Returns an object of class `crul::HttpResponse`. - clone_asset = function(clone_from, new_name, asset_type) { - body <- list( - "clone_from" = clone_from, - "name" = new_name, - "asset_type" = asset_type - ) - self$post("assets/", body = body) - }, + #' High-level POST request to clone an asset. `assets` endpoint + #' (due to default to `v2`, no further specification is needed). + #' @param clone_from character. UID of the asset to be cloned. + #' @param new_name character. Name of the new asset. + #' @param asset_type character. Type of the new asset. Can be + #' "block", "question", "survey", "template". + #' @return Returns an object of class `crul::HttpResponse`. + clone_asset = function(clone_from, new_name, asset_type) { + body <- list( + "clone_from" = clone_from, + "name" = new_name, + "asset_type" = asset_type + ) + self$post("assets/", body = body) + }, - #' @description - #' High-level POST request to deploy an asset. - #' `assets/{uid}/deployment/` endpoint (due to - #' default to `v2`, no further specification is needed). - #' @param uid character. UID of the asset to be deployed. - #' @return Returns an object of class `crul::HttpResponse`. - deploy_asset = function(uid) { - body <- list("active" = "true") - endpoint <- paste0("assets/", uid, "/deployment/") - self$post(endpoint, body = body) - }, + #' @description + #' High-level POST request to deploy an asset. + #' `assets/{uid}/deployment/` endpoint (due to + #' default to `v2`, no further specification is needed). + #' @param uid character. UID of the asset to be deployed. + #' @return Returns an object of class `crul::HttpResponse`. + deploy_asset = function(uid) { + body <- list("active" = "true") + endpoint <- paste0("assets/", uid, "/deployment/") + self$post(endpoint, body = body) + }, - #' @description - #' High-level POST request to import an XLS form. `imports` endpoint - #' (due to default to `v2`, no further specification is needed). - #' @param name character. Name of the new asset. - #' @param file_path character. The path to the XLS form file. - #' @return Returns an object of class `crul::HttpResponse`. - import_xls_form = function(name, file_path) { - body <- list( - "name" = name, - "library" = "false", - "file" = crul::upload(file_path) - ) - self$post("imports/", body = body) - }, + #' @description + #' High-level POST request to import an XLS form. `imports` endpoint + #' (due to default to `v2`, no further specification is needed). + #' @param name character. Name of the new asset. + #' @param file_path character. The path to the XLS form file. + #' @return Returns an object of class `crul::HttpResponse`. + import_xls_form = function(name, file_path) { + body <- list( + "name" = name, + "library" = "false", + "file" = crul::upload(file_path) + ) + self$post("imports/", body = body) + }, - #' @description - #' High-level POST request to create an empty asset. `assets/` endpoint - #' (due to default to `v2`, no further specification is needed). - #' @param name character. Name of the new asset. - #' @param description character. Optional. - #' @param sector A list with elements `label` and `value`. - #' Optional. Corresponding labels and values can be found - #' \href{https://github.com/kobotoolbox/kpi/blob/master/kobo/static_lists.py}{here}. - #' @param country A list with elements `label` and `value`. - #' Optional. Corresponding labels and values can be found - #' \href{https://github.com/kobotoolbox/kpi/blob/master/kobo/static_lists.py}{here}. - #' @param share_metadata boolean. Optional. - #' @param asset_type character. Type of the new asset. Can be - #' "block", "question", "survey", "template". - #' @return Returns an object of class `crul::HttpResponse`. - create_asset = function(name, - asset_type, - description = "", - sector = list(label = "", value = ""), - country = list(label = "", value = ""), - share_metadata = FALSE) { + #' @description + #' High-level POST request to create an empty asset. `assets/` endpoint + #' (due to default to `v2`, no further specification is needed). + #' @param name character. Name of the new asset. + #' @param description character. Optional. + #' @param sector A list with elements `label` and `value`. + #' Optional. Corresponding labels and values can be found + #' \href{https://github.com/kobotoolbox/kpi/blob/master/kobo/static_lists.py}{here}. + #' @param country A list with elements `label` and `value`. + #' Optional. Corresponding labels and values can be found + #' \href{https://github.com/kobotoolbox/kpi/blob/master/kobo/static_lists.py}{here}. + #' @param share_metadata boolean. Optional. + #' @param asset_type character. Type of the new asset. Can be + #' "block", "question", "survey", "template". + #' @return Returns an object of class `crul::HttpResponse`. + create_asset = function(name, + asset_type, + description = "", + sector = list(label = "", value = ""), + country = list(label = "", value = ""), + share_metadata = FALSE) { - # Input validation / assertions - checkmate::assert_character(name) - checkmate::assert_character(asset_type) - checkmate::assert_logical(share_metadata) - checkmate::assert_list(sector, names = "named") - checkmate::assert_list(country, names = "named") - checkmate::assertSetEqual(names(sector), c("label", "value")) - checkmate::assertSetEqual(names(country), c("label", "value")) + # Input validation / assertions + checkmate::assert_character(name) + checkmate::assert_character(asset_type) + checkmate::assert_logical(share_metadata) + checkmate::assert_list(sector, names = "named") + checkmate::assert_list(country, names = "named") + checkmate::assertSetEqual(names(sector), c("label", "value")) + checkmate::assertSetEqual(names(country), c("label", "value")) - body <- list( - "name" = name, - "asset_type" = asset_type, - "settings" = list_as_json_char( - list( - "description" = description, - "sector" = sector, - "country" = country, - "share-metadata" = share_metadata - ) - ) - ) - self$post("assets/", body = body) - } - ) # + body <- list( + "name" = name, + "asset_type" = asset_type, + "settings" = list_as_json_char( + list( + "description" = description, + "sector" = sector, + "country" = country, + "share-metadata" = share_metadata + ) + ) + ) + self$post("assets/", body = body) + } + ) # ) diff --git a/R/list_as_json_char.R b/R/list_as_json_char.R index 43361d9..62da1f7 100644 --- a/R/list_as_json_char.R +++ b/R/list_as_json_char.R @@ -10,12 +10,12 @@ #' @examples #' \dontrun{ #' example_body <- list_as_json_char(list( -#' "name" = "A survey object created via API/R", -#' "asset_type" = "survey" +#' "name" = "A survey object created via API/R", +#' "asset_type" = "survey" #' )) #' } #' list_as_json_char <- function(list) { - jsonlite::toJSON(x = list, pretty = TRUE, auto_unbox = TRUE) %>% - as.character() + jsonlite::toJSON(x = list, pretty = TRUE, auto_unbox = TRUE) %>% + as.character() } diff --git a/R/utils.R b/R/utils.R index 83ba87c..aed9b5c 100644 --- a/R/utils.R +++ b/R/utils.R @@ -6,7 +6,7 @@ #' @title Infix Coalesce Operator #' @describtion Makes coalesce chainable, as often used in #' tidyverse packages. -#' @noRd +#' @noRd `%||%` <- function(x, y) { if (is.null(x)) y else x } @@ -16,11 +16,11 @@ #' @return The path string with optionally an appended trailing slash. #' @noRd check_repair_path <- function(path) { - if (substr(path, nchar(path), nchar(path)) != "/") { - return(paste0(path, "/")) - } else { - return(path) - } + if (substr(path, nchar(path), nchar(path)) != "/") { + return(paste0(path, "/")) + } else { + return(path) + } } #' @description @@ -31,6 +31,6 @@ check_repair_path <- function(path) { #' @param list R list to be converted. #' @return JSON-like string list_as_json_char <- function(list) { - jsonlite::toJSON(x = list, pretty = TRUE, auto_unbox = TRUE) %>% - as.character() + jsonlite::toJSON(x = list, pretty = TRUE, auto_unbox = TRUE) %>% + as.character() } diff --git a/tests/testthat/setup-kbtbr.R b/tests/testthat/setup-kbtbr.R index 7903f3f..8d008ff 100644 --- a/tests/testthat/setup-kbtbr.R +++ b/tests/testthat/setup-kbtbr.R @@ -3,19 +3,19 @@ library("vcr") # *Required* as vcr is set up on loading vcr_dir <- vcr::vcr_test_path("fixtures") if (!nzchar(Sys.getenv("KBTBR_TOKEN"))) { - if (dir.exists(vcr_dir)) { - # Fake API token to fool our package - Sys.setenv("KBTBR_TOKEN" = "fakebearertoken") - } else { - # If there's no mock files nor API token, impossible to run tests - stop("No API key nor cassettes, tests cannot be run.", - call. = FALSE - ) - } + if (dir.exists(vcr_dir)) { + # Fake API token to fool our package + Sys.setenv("KBTBR_TOKEN" = "fakebearertoken") + } else { + # If there's no mock files nor API token, impossible to run tests + stop("No API key nor cassettes, tests cannot be run.", + call. = FALSE + ) + } } invisible(vcr::vcr_configure( - dir = vcr_dir, - filter_request_headers = list(Authorization = "fakebearertoken") + dir = vcr_dir, + filter_request_headers = list(Authorization = "fakebearertoken") )) vcr::check_cassette_names() diff --git a/tests/testthat/test-asset.R b/tests/testthat/test-asset.R index d063f69..5201b5e 100644 --- a/tests/testthat/test-asset.R +++ b/tests/testthat/test-asset.R @@ -1,78 +1,78 @@ BASE_URL <- "https://kobo.correlaid.org" test_that("Asset only takes Kobo not Kobo Client", { - test_list <- list( - uid = "uid", - name = "a very cool testing survey", - url = "url", - data = "url", - owner__username = "user", - asset_type = "survey" - ) - kc <- KoboClient$new(BASE_URL) - expect_error(Asset$new(test_list, kc), regexp = "Assertion on 'kobo' failed: Must inherit from class 'Kobo', but has classes 'KoboClient','HttpClient','R6'.") + test_list <- list( + uid = "uid", + name = "a very cool testing survey", + url = "url", + data = "url", + owner__username = "user", + asset_type = "survey" + ) + kc <- KoboClient$new(BASE_URL) + expect_error(Asset$new(test_list, kc), regexp = "Assertion on 'kobo' failed: Must inherit from class 'Kobo', but has classes 'KoboClient','HttpClient','R6'.") }) test_that("Asset needs all necessary elements to be non-null", { - test_list <- list( - uid = "uid", - name = "a very cool testing survey", - url = "url", - data = "url" - ) - kobo <- Kobo$new(BASE_URL) - expect_error(Asset$new(test_list, kobo), regexp = "Argument asset_list is missing the following required elements: owner__username, asset_type") + test_list <- list( + uid = "uid", + name = "a very cool testing survey", + url = "url", + data = "url" + ) + kobo <- Kobo$new(BASE_URL) + expect_error(Asset$new(test_list, kobo), regexp = "Argument asset_list is missing the following required elements: owner__username, asset_type") }) test_that("asset objects can be created for all asset types", { - vcr::use_cassette("kobo-create-asset-objects", { - kobo <- Kobo$new(base_url_v2 = BASE_URL, kobo_token = Sys.getenv("KBTBR_TOKEN")) - assets <- kobo$get_assets() - }) + vcr::use_cassette("kobo-create-asset-objects", { + kobo <- Kobo$new(base_url_v2 = BASE_URL, kobo_token = Sys.getenv("KBTBR_TOKEN")) + assets <- kobo$get_assets() + }) - # get one of each type to make sure it works for all asset types - survey <- assets$results %>% - dplyr::filter(asset_type == "survey") %>% - dplyr::slice(1) - question <- assets$results %>% - dplyr::filter(asset_type == "question") %>% - dplyr::slice(1) - block <- assets$results %>% - dplyr::filter(asset_type == "block") %>% - dplyr::slice(1) - template <- assets$results %>% - dplyr::filter(asset_type == "template") %>% - dplyr::slice(1) + # get one of each type to make sure it works for all asset types + survey <- assets$results %>% + dplyr::filter(asset_type == "survey") %>% + dplyr::slice(1) + question <- assets$results %>% + dplyr::filter(asset_type == "question") %>% + dplyr::slice(1) + block <- assets$results %>% + dplyr::filter(asset_type == "block") %>% + dplyr::slice(1) + template <- assets$results %>% + dplyr::filter(asset_type == "template") %>% + dplyr::slice(1) - test_cases <- dplyr::bind_rows(survey, question, block, template) + test_cases <- dplyr::bind_rows(survey, question, block, template) - for (i in 1:nrow(test_cases)) { - asset_list <- test_cases[i, , drop = TRUE] - asset_obj <- Asset$new(asset_list, kobo) - expect_equal(asset_obj$uid, asset_list$uid) - expect_equal(asset_obj$name, asset_list$name) - expect_equal(asset_obj$asset_url, asset_list$url) - expect_equal(asset_obj$data_url, asset_list$data) - expect_equal(asset_obj$type, asset_list$asset_type) - expect_equal(asset_obj$owner_username, asset_list$owner__username) - } + for (i in 1:nrow(test_cases)) { + asset_list <- test_cases[i, , drop = TRUE] + asset_obj <- Asset$new(asset_list, kobo) + expect_equal(asset_obj$uid, asset_list$uid) + expect_equal(asset_obj$name, asset_list$name) + expect_equal(asset_obj$asset_url, asset_list$url) + expect_equal(asset_obj$data_url, asset_list$data) + expect_equal(asset_obj$type, asset_list$asset_type) + expect_equal(asset_obj$owner_username, asset_list$owner__username) + } }) test_that("get asset returns asset instance", { - vcr::use_cassette("kobo-get-asset-object", { - kobo <- Kobo$new(base_url_v2 = BASE_URL, kobo_token = Sys.getenv("KBTBR_TOKEN")) - asset_obj <- kobo$get_asset("aRo4wg5utWT7dwdnQQEAE7") - }) + vcr::use_cassette("kobo-get-asset-object", { + kobo <- Kobo$new(base_url_v2 = BASE_URL, kobo_token = Sys.getenv("KBTBR_TOKEN")) + asset_obj <- kobo$get_asset("aRo4wg5utWT7dwdnQQEAE7") + }) - expect_equal(asset_obj$uid, "aRo4wg5utWT7dwdnQQEAE7") - expect_equal(asset_obj$name, "kbtbr Testing Survey") - expect_equal(asset_obj$asset_url, "https://kobo.correlaid.org/api/v2/assets/aRo4wg5utWT7dwdnQQEAE7/?format=json") - expect_equal(asset_obj$data_url, "https://kobo.correlaid.org/api/v2/assets/aRo4wg5utWT7dwdnQQEAE7/data/?format=json") - expect_equal(asset_obj$type, "survey") - expect_equal(asset_obj$owner_username, "api_user") + expect_equal(asset_obj$uid, "aRo4wg5utWT7dwdnQQEAE7") + expect_equal(asset_obj$name, "kbtbr Testing Survey") + expect_equal(asset_obj$asset_url, "https://kobo.correlaid.org/api/v2/assets/aRo4wg5utWT7dwdnQQEAE7/?format=json") + expect_equal(asset_obj$data_url, "https://kobo.correlaid.org/api/v2/assets/aRo4wg5utWT7dwdnQQEAE7/data/?format=json") + expect_equal(asset_obj$type, "survey") + expect_equal(asset_obj$owner_username, "api_user") - # to list function - expect_equal(length(asset_obj$to_list()), 6) - expect_setequal(names(asset_obj$to_list()), c("uid", "name", "asset_url", "data_url", "type", "owner_username")) + # to list function + expect_equal(length(asset_obj$to_list()), 6) + expect_setequal(names(asset_obj$to_list()), c("uid", "name", "asset_url", "data_url", "type", "owner_username")) }) diff --git a/tests/testthat/test-kobo-client.R b/tests/testthat/test-kobo-client.R index 9f2770d..7bd43e8 100644 --- a/tests/testthat/test-kobo-client.R +++ b/tests/testthat/test-kobo-client.R @@ -3,37 +3,37 @@ BASE_URL <- "https://kobo.correlaid.org" #' Testing $get_* methods vcr::use_cassette("kobo-client-403", { - test_that("Requests with faulty token throw error", { - # Case: Faulty token is via envvar, get request fails - withr::with_envvar( - new = c("KBTBR_TOKEN" = "foo"), - code = { - kc <- KoboClient$new(base_url = BASE_URL) - expect_error(kc$get("api/v2/assets/"), regexp = "403") - } - ) - }) + test_that("Requests with faulty token throw error", { + # Case: Faulty token is via envvar, get request fails + withr::with_envvar( + new = c("KBTBR_TOKEN" = "foo"), + code = { + kc <- KoboClient$new(base_url = BASE_URL) + expect_error(kc$get("api/v2/assets/"), regexp = "403") + } + ) + }) }) test_that("Kobo Client can fetch assets", { - vcr::use_cassette("kobo-client-get-assets-simple-get", { - koboclient <- KoboClient$new(base_url = BASE_URL, kobo_token = Sys.getenv("KBTBR_TOKEN")) - res <- koboclient$get("api/v2/assets/", query = list(format = "json")) # trailing slash again! - }) + vcr::use_cassette("kobo-client-get-assets-simple-get", { + koboclient <- KoboClient$new(base_url = BASE_URL, kobo_token = Sys.getenv("KBTBR_TOKEN")) + res <- koboclient$get("api/v2/assets/", query = list(format = "json")) # trailing slash again! + }) - assets <- res$ - parse() %>% - jsonlite::fromJSON() - expect_setequal(names(assets), c("count", "next", "previous", "results")) - expect_true(all(c("url", "owner", "kind", "name", "asset_type") %in% colnames(assets$results))) - expect_equal(nrow(assets$results), 8) - expect_equal(assets$count, 8) + assets <- res$ + parse() %>% + jsonlite::fromJSON() + expect_setequal(names(assets), c("count", "next", "previous", "results")) + expect_true(all(c("url", "owner", "kind", "name", "asset_type") %in% colnames(assets$results))) + expect_equal(nrow(assets$results), 8) + expect_equal(assets$count, 8) }) vcr::use_cassette("kobo-client-get-404", { - test_that("non existing route throws 404 error", { - koboclient <- KoboClient$new(base_url = BASE_URL, kobo_token = Sys.getenv("KBTBR_TOKEN")) - expect_error(koboclient$get("api/v2/doesnotexist/")$raise_for_status(), regexp = "404") - }) + test_that("non existing route throws 404 error", { + koboclient <- KoboClient$new(base_url = BASE_URL, kobo_token = Sys.getenv("KBTBR_TOKEN")) + expect_error(koboclient$get("api/v2/doesnotexist/")$raise_for_status(), regexp = "404") + }) }) diff --git a/tests/testthat/test-kobo.R b/tests/testthat/test-kobo.R index bfe42e6..3e7e98a 100644 --- a/tests/testthat/test-kobo.R +++ b/tests/testthat/test-kobo.R @@ -3,461 +3,461 @@ BASE_URL <- "https://kobo.correlaid.org" #' Testing basic properties, construction test_that("the error from KoboClient is propagated correctly if we fail to provide a token", { - withr::with_envvar( - new = c("KBTBR_TOKEN" = ""), - code = { - expect_error( - object = Kobo$new(base_url_v2 = BASE_URL), - regexp = "No valid token detected." - ) - } - ) + withr::with_envvar( + new = c("KBTBR_TOKEN" = ""), + code = { + expect_error( + object = Kobo$new(base_url_v2 = BASE_URL), + regexp = "No valid token detected." + ) + } + ) }) test_that("Kobo is initialized correctly if we provide a kobo_token manually with empty envvar.", { - withr::with_envvar( - new = c("KBTBR_TOKEN" = ""), - code = { - kobo_obj <- Kobo$new(base_url_v2 = BASE_URL, kobo_token = "foo") - expect_identical( - class(kobo_obj), - c("Kobo", "R6") - ) - } - ) + withr::with_envvar( + new = c("KBTBR_TOKEN" = ""), + code = { + kobo_obj <- Kobo$new(base_url_v2 = BASE_URL, kobo_token = "foo") + expect_identical( + class(kobo_obj), + c("Kobo", "R6") + ) + } + ) }) test_that("Kobo is initialized correctly if we provide a KoboClient instance", { - withr::with_envvar( - new = c("KBTBR_TOKEN" = ""), - code = { - koboclient_instance <- KoboClient$new(BASE_URL, kobo_token = "foo") - kobo_obj <- Kobo$new(session_v2 = koboclient_instance) - expect_identical( - class(kobo_obj), - c("Kobo", "R6") - ) - } - ) + withr::with_envvar( + new = c("KBTBR_TOKEN" = ""), + code = { + koboclient_instance <- KoboClient$new(BASE_URL, kobo_token = "foo") + kobo_obj <- Kobo$new(session_v2 = koboclient_instance) + expect_identical( + class(kobo_obj), + c("Kobo", "R6") + ) + } + ) }) test_that("we get a message if we do not specify base_url_v1, but Kobo is initialized.", { - expect_message( - { - kobo_obj <- Kobo$new(base_url_v2 = BASE_URL, kobo_token = "foo") - }, - regexp = "You have not passed base_url_v1. This means you cannot use" - ) - expect_identical( - class(kobo_obj), - c("Kobo", "R6") - ) + expect_message( + { + kobo_obj <- Kobo$new(base_url_v2 = BASE_URL, kobo_token = "foo") + }, + regexp = "You have not passed base_url_v1. This means you cannot use" + ) + expect_identical( + class(kobo_obj), + c("Kobo", "R6") + ) }) #' ----------------------------------------------------------------------------- #' Testing $get_* methods test_that("Request to v1 throws error if v1 session is not initialized", { - kobo <- Kobo$new(base_url_v2 = BASE_URL) - expect_error(kobo$get("submissions/", version = "v1"), - regexp = "Session for API v1 is not initalized" - ) + kobo <- Kobo$new(base_url_v2 = BASE_URL) + expect_error(kobo$get("submissions/", version = "v1"), + regexp = "Session for API v1 is not initalized" + ) }) test_that("Kobo can fetch assets", { - # the use_cassette command looks into the fixtures directory and checks - # whether a "cassette" with the given name already exists. if yes, it loads it. if no, the - # code is run and the response is saved as a cassette. - vcr::use_cassette("kobo-get-assets", { - kobo <- Kobo$new(base_url_v2 = BASE_URL, kobo_token = Sys.getenv("KBTBR_TOKEN")) - assets <- kobo$get_assets() - }) - expect_setequal(names(assets), c("count", "next", "previous", "results")) - expect_equal(nrow(assets$results), 8) + # the use_cassette command looks into the fixtures directory and checks + # whether a "cassette" with the given name already exists. if yes, it loads it. if no, the + # code is run and the response is saved as a cassette. + vcr::use_cassette("kobo-get-assets", { + kobo <- Kobo$new(base_url_v2 = BASE_URL, kobo_token = Sys.getenv("KBTBR_TOKEN")) + assets <- kobo$get_assets() + }) + expect_setequal(names(assets), c("count", "next", "previous", "results")) + expect_equal(nrow(assets$results), 8) }) test_that("Kobo can fetch assets using simple get", { - vcr::use_cassette("kobo-get-assets-simple-get", { - kobo <- Kobo$new(base_url_v2 = BASE_URL, kobo_token = Sys.getenv("KBTBR_TOKEN")) - assets <- kobo$get("assets/", parse = TRUE) # trailing slash again! - }) - expect_setequal(names(assets), c("count", "next", "previous", "results")) - expect_true(all(c("url", "owner", "kind", "name", "asset_type") %in% colnames(assets$results))) - expect_equal(nrow(assets$results), 8) - expect_equal(assets$count, 8) + vcr::use_cassette("kobo-get-assets-simple-get", { + kobo <- Kobo$new(base_url_v2 = BASE_URL, kobo_token = Sys.getenv("KBTBR_TOKEN")) + assets <- kobo$get("assets/", parse = TRUE) # trailing slash again! + }) + expect_setequal(names(assets), c("count", "next", "previous", "results")) + expect_true(all(c("url", "owner", "kind", "name", "asset_type") %in% colnames(assets$results))) + expect_equal(nrow(assets$results), 8) + expect_equal(assets$count, 8) }) test_that("Kobo can a single asset", { - vcr::use_cassette("kobo-get-single-asset", { - kobo <- Kobo$new(base_url_v2 = BASE_URL, kobo_token = Sys.getenv("KBTBR_TOKEN")) - asset <- kobo$get_asset("aRo4wg5utWT7dwdnQQEAE7") - }) - expect_identical( - class(asset), - c("Asset", "R6") - ) + vcr::use_cassette("kobo-get-single-asset", { + kobo <- Kobo$new(base_url_v2 = BASE_URL, kobo_token = Sys.getenv("KBTBR_TOKEN")) + asset <- kobo$get_asset("aRo4wg5utWT7dwdnQQEAE7") + }) + expect_identical( + class(asset), + c("Asset", "R6") + ) }) # ERRORS ----------- vcr::use_cassette("kobo-get-404", { - test_that("non existing route throws 404 error", { - kobo <- Kobo$new(base_url_v2 = BASE_URL, kobo_token = Sys.getenv("KBTBR_TOKEN")) - expect_error(kobo$get("doesnotexist/"), regexp = "404") - }) + test_that("non existing route throws 404 error", { + kobo <- Kobo$new(base_url_v2 = BASE_URL, kobo_token = Sys.getenv("KBTBR_TOKEN")) + expect_error(kobo$get("doesnotexist/"), regexp = "404") + }) }) test_that("non-existing kobo host throws error", { - kobo <- Kobo$new(base_url_v2 = "https://nokobohere.correlaid.org", kobo_token = Sys.getenv("KBTBR_TOKEN")) - expect_error(kobo$get("assets/"), regexp = "^SSL.+certificate.+") + kobo <- Kobo$new(base_url_v2 = "https://nokobohere.correlaid.org", kobo_token = Sys.getenv("KBTBR_TOKEN")) + expect_error(kobo$get("assets/"), regexp = "^SSL.+certificate.+") }) #' ----------------------------------------------------------------------------- #' Testing POST methods test_that("Kobo$post can clone assets", { - vcr::use_cassette("kobo-clone-assets-simple-post", { - kobo <- suppressMessages(Kobo$new( - base_url_v2 = BASE_URL, - kobo_token = Sys.getenv("KBTBR_TOKEN") - )) - - clone_asset <- kobo$post("assets/", - body = list( - "clone_from" = "a84jmwwdPEsZMhK7s2i4SL", - "name" = "vcr_test_name", - "asset_type" = "survey" - ) - ) - }) - expect_equal(clone_asset$url, "https://kobo.correlaid.org/api/v2/assets/") - expect_equal(clone_asset$method, "post") - expect_equal(clone_asset$status_code, 201) - expect_true(clone_asset$success()) - expect_equal(clone_asset$status_http()$message, "Created") - expect_equal(clone_asset$status_http()$explanation, "Document created, URL follows") + vcr::use_cassette("kobo-clone-assets-simple-post", { + kobo <- suppressMessages(Kobo$new( + base_url_v2 = BASE_URL, + kobo_token = Sys.getenv("KBTBR_TOKEN") + )) + + clone_asset <- kobo$post("assets/", + body = list( + "clone_from" = "a84jmwwdPEsZMhK7s2i4SL", + "name" = "vcr_test_name", + "asset_type" = "survey" + ) + ) + }) + expect_equal(clone_asset$url, "https://kobo.correlaid.org/api/v2/assets/") + expect_equal(clone_asset$method, "post") + expect_equal(clone_asset$status_code, 201) + expect_true(clone_asset$success()) + expect_equal(clone_asset$status_http()$message, "Created") + expect_equal(clone_asset$status_http()$explanation, "Document created, URL follows") }) vcr::use_cassette("Kobo$post-404", { - test_that("Kobo$post with non existing route throws 404 error", { - kobo <- suppressMessages(Kobo$new( - base_url_v2 = BASE_URL, - kobo_token = Sys.getenv("KBTBR_TOKEN") - )) - - expect_error(kobo$post("doesnotexist/", - body = list( - "clone_from" = "a5jjyWLUEmi49EHML6t9Nr", - "name" = "vcr_test_name", - "asset_type" = "survey" - ) - ), - regexp = "404" - ) - }) + test_that("Kobo$post with non existing route throws 404 error", { + kobo <- suppressMessages(Kobo$new( + base_url_v2 = BASE_URL, + kobo_token = Sys.getenv("KBTBR_TOKEN") + )) + + expect_error(kobo$post("doesnotexist/", + body = list( + "clone_from" = "a5jjyWLUEmi49EHML6t9Nr", + "name" = "vcr_test_name", + "asset_type" = "survey" + ) + ), + regexp = "404" + ) + }) }) #' Testing kobo$clone_asset test_that("kobo$clone_asset can clone assets", { - vcr::use_cassette("kobo-post-clone-asset", { - kobo <- suppressMessages(Kobo$new( - base_url_v2 = BASE_URL, - kobo_token = Sys.getenv("KBTBR_TOKEN") - )) - - clone_asset <- kobo$clone_asset( - clone_from = "a84jmwwdPEsZMhK7s2i4SL", - new_name = "vcr_test_name", - asset_type = "survey" - ) - }) - expect_equal(clone_asset$url, "https://kobo.correlaid.org/api/v2/assets/") - expect_equal(clone_asset$method, "post") - expect_equal(clone_asset$status_code, 201) - expect_true(clone_asset$success()) - expect_equal(clone_asset$status_http()$message, "Created") - expect_equal(clone_asset$status_http()$explanation, "Document created, URL follows") + vcr::use_cassette("kobo-post-clone-asset", { + kobo <- suppressMessages(Kobo$new( + base_url_v2 = BASE_URL, + kobo_token = Sys.getenv("KBTBR_TOKEN") + )) + + clone_asset <- kobo$clone_asset( + clone_from = "a84jmwwdPEsZMhK7s2i4SL", + new_name = "vcr_test_name", + asset_type = "survey" + ) + }) + expect_equal(clone_asset$url, "https://kobo.correlaid.org/api/v2/assets/") + expect_equal(clone_asset$method, "post") + expect_equal(clone_asset$status_code, 201) + expect_true(clone_asset$success()) + expect_equal(clone_asset$status_http()$message, "Created") + expect_equal(clone_asset$status_http()$explanation, "Document created, URL follows") }) test_that("kobo$clone_asset returns error for the attempt to clone non-existing asset", { - vcr::use_cassette("kobo-post-clone-asset-err1", { - kobo <- suppressMessages(Kobo$new( - base_url_v2 = BASE_URL, - kobo_token = Sys.getenv("KBTBR_TOKEN") - )) - expect_error(kobo$clone_asset( - clone_from = "smth_wrong", - new_name = "vcr_test_name", - asset_type = "survey" - ), regexp = "404") - }) + vcr::use_cassette("kobo-post-clone-asset-err1", { + kobo <- suppressMessages(Kobo$new( + base_url_v2 = BASE_URL, + kobo_token = Sys.getenv("KBTBR_TOKEN") + )) + expect_error(kobo$clone_asset( + clone_from = "smth_wrong", + new_name = "vcr_test_name", + asset_type = "survey" + ), regexp = "404") + }) }) test_that("kobo$clone_asset returns error when cloning question to block", { - vcr::use_cassette("kobo-post-clone-asset-err2", { - kobo <- suppressMessages(Kobo$new( - base_url_v2 = BASE_URL, - kobo_token = Sys.getenv("KBTBR_TOKEN") - )) - expect_error(kobo$clone_asset( - clone_from = "a7AV5JhRHKf8EWGBJLswwC", - new_name = "vcr_test_name", - asset_type = "block" - ), regexp = "500") - }) + vcr::use_cassette("kobo-post-clone-asset-err2", { + kobo <- suppressMessages(Kobo$new( + base_url_v2 = BASE_URL, + kobo_token = Sys.getenv("KBTBR_TOKEN") + )) + expect_error(kobo$clone_asset( + clone_from = "a7AV5JhRHKf8EWGBJLswwC", + new_name = "vcr_test_name", + asset_type = "block" + ), regexp = "500") + }) }) test_that("kobo$clone_asset returns error when cloning template to block", { - vcr::use_cassette("kobo-post-clone-asset-err3", { - kobo <- suppressMessages(Kobo$new( - base_url_v2 = BASE_URL, - kobo_token = Sys.getenv("KBTBR_TOKEN") - )) - expect_error(kobo$clone_asset( - clone_from = "anxTvsL3xZd7CSvpt63qAd", - new_name = "vcr_test_name", - asset_type = "block" - ), regexp = "500") - }) + vcr::use_cassette("kobo-post-clone-asset-err3", { + kobo <- suppressMessages(Kobo$new( + base_url_v2 = BASE_URL, + kobo_token = Sys.getenv("KBTBR_TOKEN") + )) + expect_error(kobo$clone_asset( + clone_from = "anxTvsL3xZd7CSvpt63qAd", + new_name = "vcr_test_name", + asset_type = "block" + ), regexp = "500") + }) }) test_that("kobo$clone_asset returns error when cloning template to question", { - vcr::use_cassette("kobo-post-clone-asset-err4", { - kobo <- suppressMessages(Kobo$new( - base_url_v2 = BASE_URL, - kobo_token = Sys.getenv("KBTBR_TOKEN") - )) - expect_error(kobo$clone_asset( - clone_from = "anxTvsL3xZd7CSvpt63qAd", - new_name = "vcr_test_name", - asset_type = "question" - ), regexp = "500") - }) -}) - -test_that("kobo$clone_asset returns error when asset id isn't provided", { + vcr::use_cassette("kobo-post-clone-asset-err4", { kobo <- suppressMessages(Kobo$new( - base_url_v2 = BASE_URL, - kobo_token = Sys.getenv("KBTBR_TOKEN") + base_url_v2 = BASE_URL, + kobo_token = Sys.getenv("KBTBR_TOKEN") )) expect_error(kobo$clone_asset( - new_name = "vcr_test_name", - asset_type = "survey" - ), regexp = "is missing") + clone_from = "anxTvsL3xZd7CSvpt63qAd", + new_name = "vcr_test_name", + asset_type = "question" + ), regexp = "500") + }) +}) + +test_that("kobo$clone_asset returns error when asset id isn't provided", { + kobo <- suppressMessages(Kobo$new( + base_url_v2 = BASE_URL, + kobo_token = Sys.getenv("KBTBR_TOKEN") + )) + expect_error(kobo$clone_asset( + new_name = "vcr_test_name", + asset_type = "survey" + ), regexp = "is missing") }) test_that("kobo$clone_asset returns error when asset name isn't provided", { - kobo <- suppressMessages(Kobo$new( - base_url_v2 = BASE_URL, - kobo_token = Sys.getenv("KBTBR_TOKEN") - )) - expect_error(kobo$clone_asset( - clone_from = "a84jmwwdPEsZMhK7s2i4SL", - asset_type = "survey" - ), regexp = "is missing") + kobo <- suppressMessages(Kobo$new( + base_url_v2 = BASE_URL, + kobo_token = Sys.getenv("KBTBR_TOKEN") + )) + expect_error(kobo$clone_asset( + clone_from = "a84jmwwdPEsZMhK7s2i4SL", + asset_type = "survey" + ), regexp = "is missing") }) test_that("kobo$clone_asset returns error when asset type isn't provided", { - kobo <- suppressMessages(Kobo$new( - base_url_v2 = BASE_URL, - kobo_token = Sys.getenv("KBTBR_TOKEN") - )) - expect_error(kobo$clone_asset( - clone_from = "a84jmwwdPEsZMhK7s2i4SL", - new_name = "vcr_test_name" - ), regexp = "is missing") + kobo <- suppressMessages(Kobo$new( + base_url_v2 = BASE_URL, + kobo_token = Sys.getenv("KBTBR_TOKEN") + )) + expect_error(kobo$clone_asset( + clone_from = "a84jmwwdPEsZMhK7s2i4SL", + new_name = "vcr_test_name" + ), regexp = "is missing") }) #' Testing kobo$deploy_asset test_that("kobo$deploy_asset can deploy assets", { - vcr::use_cassette("kobo-post-deploy-asset", { - kobo <- suppressMessages(Kobo$new( - base_url_v2 = BASE_URL, - kobo_token = Sys.getenv("KBTBR_TOKEN") - )) - - deploy_asset <- kobo$deploy_asset(uid = "aQVGH8G68EP737tDBABRwC") - }) - expect_equal( - deploy_asset$url, - "https://kobo.correlaid.org/api/v2/assets/aQVGH8G68EP737tDBABRwC/deployment/" - ) - expect_equal(deploy_asset$method, "post") - expect_equal(deploy_asset$status_code, 200) # i don't understand why not 201. - # but with 200 it successfully deployed - expect_true(deploy_asset$success()) - expect_equal(deploy_asset$status_http()$message, "OK") - expect_equal(deploy_asset$status_http()$explanation, "Request fulfilled, document follows") + vcr::use_cassette("kobo-post-deploy-asset", { + kobo <- suppressMessages(Kobo$new( + base_url_v2 = BASE_URL, + kobo_token = Sys.getenv("KBTBR_TOKEN") + )) + + deploy_asset <- kobo$deploy_asset(uid = "aQVGH8G68EP737tDBABRwC") + }) + expect_equal( + deploy_asset$url, + "https://kobo.correlaid.org/api/v2/assets/aQVGH8G68EP737tDBABRwC/deployment/" + ) + expect_equal(deploy_asset$method, "post") + expect_equal(deploy_asset$status_code, 200) # i don't understand why not 201. + # but with 200 it successfully deployed + expect_true(deploy_asset$success()) + expect_equal(deploy_asset$status_http()$message, "OK") + expect_equal(deploy_asset$status_http()$explanation, "Request fulfilled, document follows") }) test_that("kobo$deploy_asset returns error when asset doesn't exist", { - vcr::use_cassette("kobo-post-deploy-asset-err1", { - kobo <- suppressMessages(Kobo$new( - base_url_v2 = BASE_URL, - kobo_token = Sys.getenv("KBTBR_TOKEN") - )) - expect_error(kobo$deploy_asset(uid = "smth_wrong"), regexp = "404") - }) + vcr::use_cassette("kobo-post-deploy-asset-err1", { + kobo <- suppressMessages(Kobo$new( + base_url_v2 = BASE_URL, + kobo_token = Sys.getenv("KBTBR_TOKEN") + )) + expect_error(kobo$deploy_asset(uid = "smth_wrong"), regexp = "404") + }) }) test_that("kobo$deploy_asset returns error when asset has deployment", { - vcr::use_cassette("kobo-post-deploy-asset-err2", { - kobo <- suppressMessages(Kobo$new( - base_url_v2 = BASE_URL, - kobo_token = Sys.getenv("KBTBR_TOKEN") - )) - expect_error(kobo$deploy_asset(uid = "ajzghKK6NELaixPQqsm49e"), regexp = "405") - }) + vcr::use_cassette("kobo-post-deploy-asset-err2", { + kobo <- suppressMessages(Kobo$new( + base_url_v2 = BASE_URL, + kobo_token = Sys.getenv("KBTBR_TOKEN") + )) + expect_error(kobo$deploy_asset(uid = "ajzghKK6NELaixPQqsm49e"), regexp = "405") + }) }) test_that("kobo$deploy_asset returns error when asset is template", { - vcr::use_cassette("kobo-post-deploy-asset-err3", { - kobo <- suppressMessages(Kobo$new( - base_url_v2 = BASE_URL, - kobo_token = Sys.getenv("KBTBR_TOKEN") - )) - expect_error(kobo$deploy_asset(uid = "anxTvsL3xZd7CSvpt63qAd"), regexp = "500") - }) + vcr::use_cassette("kobo-post-deploy-asset-err3", { + kobo <- suppressMessages(Kobo$new( + base_url_v2 = BASE_URL, + kobo_token = Sys.getenv("KBTBR_TOKEN") + )) + expect_error(kobo$deploy_asset(uid = "anxTvsL3xZd7CSvpt63qAd"), regexp = "500") + }) }) test_that("kobo$deploy_asset returns error when asset is question", { - vcr::use_cassette("kobo-post-deploy-asset-err4", { - kobo <- suppressMessages(Kobo$new( - base_url_v2 = BASE_URL, - kobo_token = Sys.getenv("KBTBR_TOKEN") - )) - expect_error(kobo$deploy_asset(uid = "a7AV5JhRHKf8EWGBJLswwC"), regexp = "500") - }) + vcr::use_cassette("kobo-post-deploy-asset-err4", { + kobo <- suppressMessages(Kobo$new( + base_url_v2 = BASE_URL, + kobo_token = Sys.getenv("KBTBR_TOKEN") + )) + expect_error(kobo$deploy_asset(uid = "a7AV5JhRHKf8EWGBJLswwC"), regexp = "500") + }) }) test_that("kobo$deploy_asset returns error when asset is block", { - vcr::use_cassette("kobo-post-deploy-asset-err5", { - kobo <- suppressMessages(Kobo$new( - base_url_v2 = BASE_URL, - kobo_token = Sys.getenv("KBTBR_TOKEN") - )) - expect_error(kobo$deploy_asset(uid = "aYKJ5czzHiustZFpBBiWHk"), regexp = "500") - }) + vcr::use_cassette("kobo-post-deploy-asset-err5", { + kobo <- suppressMessages(Kobo$new( + base_url_v2 = BASE_URL, + kobo_token = Sys.getenv("KBTBR_TOKEN") + )) + expect_error(kobo$deploy_asset(uid = "aYKJ5czzHiustZFpBBiWHk"), regexp = "500") + }) }) test_that("kobo$deploy_asset returns error when asset id isn't provided", { - kobo <- suppressMessages(Kobo$new( - base_url_v2 = BASE_URL, - kobo_token = Sys.getenv("KBTBR_TOKEN") - )) - expect_error(kobo$deploy_asset(), regexp = "is missing") + kobo <- suppressMessages(Kobo$new( + base_url_v2 = BASE_URL, + kobo_token = Sys.getenv("KBTBR_TOKEN") + )) + expect_error(kobo$deploy_asset(), regexp = "is missing") }) #' Testing kobo$import_xls_form test_that("kobo$import_xls_form can import forms", { - vcr::use_cassette("kobo-post-import-xls-form", { - kobo <- suppressMessages(Kobo$new( - base_url_v2 = BASE_URL, - kobo_token = Sys.getenv("KBTBR_TOKEN") - )) - - import_xls_form <- kobo$import_xls_form( - name = "vcr_test_name", - file_path = "xls_form_via_post.xlsx" - ) - }) - expect_equal(import_xls_form$url, "https://kobo.correlaid.org/imports/") - expect_equal(import_xls_form$method, "post") - expect_equal(import_xls_form$status_code, 201) - expect_true(import_xls_form$success()) - expect_equal(import_xls_form$status_http()$message, "Created") - expect_equal( - import_xls_form$status_http()$explanation, - "Document created, URL follows" + vcr::use_cassette("kobo-post-import-xls-form", { + kobo <- suppressMessages(Kobo$new( + base_url_v2 = BASE_URL, + kobo_token = Sys.getenv("KBTBR_TOKEN") + )) + + import_xls_form <- kobo$import_xls_form( + name = "vcr_test_name", + file_path = "xls_form_via_post.xlsx" ) + }) + expect_equal(import_xls_form$url, "https://kobo.correlaid.org/imports/") + expect_equal(import_xls_form$method, "post") + expect_equal(import_xls_form$status_code, 201) + expect_true(import_xls_form$success()) + expect_equal(import_xls_form$status_http()$message, "Created") + expect_equal( + import_xls_form$status_http()$explanation, + "Document created, URL follows" + ) }) test_that("kobo$create_asset can create assets with settings as parameters", { - vcr::use_cassette("kobo-post-create-asset", { - kobo <- suppressMessages(Kobo$new( - base_url_v2 = BASE_URL, - kobo_token = Sys.getenv("KBTBR_TOKEN") - )) - - create_asset <- kobo$create_asset( - name = "vcr_test_name", - asset_type = "survey", - description = "description", - sector = list(label = "Environment", value = "ENV"), - country = list(label = "Angola", value = "AGO"), - share_metadata = FALSE - ) - }) - expect_equal(create_asset$url, "https://kobo.correlaid.org/api/v2/assets/") - expect_equal(create_asset$method, "post") - expect_equal(create_asset$status_code, 201) - expect_true(create_asset$success()) - expect_equal(create_asset$status_http()$message, "Created") - expect_equal(create_asset$status_http()$explanation, "Document created, URL follows") + vcr::use_cassette("kobo-post-create-asset", { + kobo <- suppressMessages(Kobo$new( + base_url_v2 = BASE_URL, + kobo_token = Sys.getenv("KBTBR_TOKEN") + )) + + create_asset <- kobo$create_asset( + name = "vcr_test_name", + asset_type = "survey", + description = "description", + sector = list(label = "Environment", value = "ENV"), + country = list(label = "Angola", value = "AGO"), + share_metadata = FALSE + ) + }) + expect_equal(create_asset$url, "https://kobo.correlaid.org/api/v2/assets/") + expect_equal(create_asset$method, "post") + expect_equal(create_asset$status_code, 201) + expect_true(create_asset$success()) + expect_equal(create_asset$status_http()$message, "Created") + expect_equal(create_asset$status_http()$explanation, "Document created, URL follows") }) test_that("kobo$create_asset can create assets with dafault settings", { - vcr::use_cassette("kobo-post-create-asset1", { - kobo <- suppressMessages(Kobo$new( - base_url_v2 = BASE_URL, - kobo_token = Sys.getenv("KBTBR_TOKEN") - )) - - create_asset <- kobo$create_asset( - name = "vcr_test_name", - asset_type = "survey" - ) - }) - expect_equal(create_asset$url, "https://kobo.correlaid.org/api/v2/assets/") - expect_equal(create_asset$method, "post") - expect_equal(create_asset$status_code, 201) - expect_true(create_asset$success()) - expect_equal(create_asset$status_http()$message, "Created") - expect_equal(create_asset$status_http()$explanation, "Document created, URL follows") + vcr::use_cassette("kobo-post-create-asset1", { + kobo <- suppressMessages(Kobo$new( + base_url_v2 = BASE_URL, + kobo_token = Sys.getenv("KBTBR_TOKEN") + )) + + create_asset <- kobo$create_asset( + name = "vcr_test_name", + asset_type = "survey" + ) + }) + expect_equal(create_asset$url, "https://kobo.correlaid.org/api/v2/assets/") + expect_equal(create_asset$method, "post") + expect_equal(create_asset$status_code, 201) + expect_true(create_asset$success()) + expect_equal(create_asset$status_http()$message, "Created") + expect_equal(create_asset$status_http()$explanation, "Document created, URL follows") }) test_that("kobo$create_asset returns error when name isn't provided", { - kobo <- suppressMessages(Kobo$new( - base_url_v2 = BASE_URL, - kobo_token = Sys.getenv("KBTBR_TOKEN") - )) - expect_error(kobo$create_asset(asset_type = "survey"), regexp = "is missing") + kobo <- suppressMessages(Kobo$new( + base_url_v2 = BASE_URL, + kobo_token = Sys.getenv("KBTBR_TOKEN") + )) + expect_error(kobo$create_asset(asset_type = "survey"), regexp = "is missing") }) test_that("kobo$create_asset returns error when asset_type isn't provided", { - kobo <- suppressMessages(Kobo$new( - base_url_v2 = BASE_URL, - kobo_token = Sys.getenv("KBTBR_TOKEN") - )) - expect_error(kobo$create_asset(name = "vcr_test_name"), regexp = "is missing") + kobo <- suppressMessages(Kobo$new( + base_url_v2 = BASE_URL, + kobo_token = Sys.getenv("KBTBR_TOKEN") + )) + expect_error(kobo$create_asset(name = "vcr_test_name"), regexp = "is missing") }) test_that("kobo$import_xls_form fails because of an incorrect path", { - kobo <- suppressMessages(Kobo$new( - base_url_v2 = BASE_URL, - kobo_token = Sys.getenv("KBTBR_TOKEN") - )) - expect_error(kobo$import_xls_form( - name = "vcr_test_name", - file_path = "smth_wrong.xlsx" - )) + kobo <- suppressMessages(Kobo$new( + base_url_v2 = BASE_URL, + kobo_token = Sys.getenv("KBTBR_TOKEN") + )) + expect_error(kobo$import_xls_form( + name = "vcr_test_name", + file_path = "smth_wrong.xlsx" + )) }) test_that("kobo$import_xls_form fails because of the missing path", { - kobo <- suppressMessages(Kobo$new( - base_url_v2 = BASE_URL, - kobo_token = Sys.getenv("KBTBR_TOKEN") - )) - expect_error(kobo$import_xls_form(file_path = "xls_form_via_post.xlsx"), - regexp = "is missing" - ) + kobo <- suppressMessages(Kobo$new( + base_url_v2 = BASE_URL, + kobo_token = Sys.getenv("KBTBR_TOKEN") + )) + expect_error(kobo$import_xls_form(file_path = "xls_form_via_post.xlsx"), + regexp = "is missing" + ) }) test_that("kobo$import_xls_form fails because of the missing name", { - kobo <- suppressMessages(Kobo$new( - base_url_v2 = BASE_URL, - kobo_token = Sys.getenv("KBTBR_TOKEN") - )) - expect_error(kobo$import_xls_form(name = "vcr_test_name"), - regexp = "is missing" - ) - }) + kobo <- suppressMessages(Kobo$new( + base_url_v2 = BASE_URL, + kobo_token = Sys.getenv("KBTBR_TOKEN") + )) + expect_error(kobo$import_xls_form(name = "vcr_test_name"), + regexp = "is missing" + ) +}) diff --git a/tests/testthat/test-utils.R b/tests/testthat/test-utils.R index eed858e..f9d0755 100644 --- a/tests/testthat/test-utils.R +++ b/tests/testthat/test-utils.R @@ -3,15 +3,15 @@ # Testing URL functions -------------------------------------------------------- test_that("Enforcing trailing slash to a string works", { - path_correct <- "this/is/my/url/" - path_wrong <- "this/is/my/url" - expect_equal( - check_repair_path(path_correct), - path_correct - ) + path_correct <- "this/is/my/url/" + path_wrong <- "this/is/my/url" + expect_equal( + check_repair_path(path_correct), + path_correct + ) - expect_equal( - check_repair_path(path_wrong), - path_correct - ) + expect_equal( + check_repair_path(path_wrong), + path_correct + ) }) From 9ff416cb8087c63fc8bcddfc5316733fb95b0d2c Mon Sep 17 00:00:00 2001 From: Malte Kyhos Date: Sat, 5 Feb 2022 15:10:02 +0100 Subject: [PATCH 52/57] Kobo: reorder private/public --- R/kobo.R | 57 ++++++++++++++++++++++++++++++-------------------------- 1 file changed, 31 insertions(+), 26 deletions(-) diff --git a/R/kobo.R b/R/kobo.R index a66fa97..bf49322 100644 --- a/R/kobo.R +++ b/R/kobo.R @@ -6,31 +6,6 @@ #' interactions with the various endpoints. #' @export Kobo <- R6::R6Class("Kobo", - private = list( - select_prep_client = function(path, version) { - checkmate::assert_choice(version, c("v1", "v2")) - - if (version == "v2") { - obj <- list( - client = self$session_v2, - path = paste0("api/v2/", path) - ) - } else if (version == "v1") { - if (checkmate::test_null(self$session_v1)) { - usethis::ui_stop(paste( - "Session for API v1 is not initalized.", - "Please re-initalize the Kobo client with the", - "base_url_v1 argument." - )) - } - obj <- list( - client = self$session_v1, - path = paste0("api/v1/", path) - ) - } - return(obj) - } - ), public = list( # Public Fields ============================================================ @@ -310,5 +285,35 @@ Kobo <- R6::R6Class("Kobo", ) self$post("assets/", body = body) } - ) # + ), # + private = list( + + # Private Methods ========================================================== + + #' @description + #' Logic to select and prepare a client + select_prep_client = function(path, version) { + checkmate::assert_choice(version, c("v1", "v2")) + + if (version == "v2") { + obj <- list( + client = self$session_v2, + path = paste0("api/v2/", path) + ) + } else if (version == "v1") { + if (checkmate::test_null(self$session_v1)) { + usethis::ui_stop(paste( + "Session for API v1 is not initalized.", + "Please re-initalize the Kobo client with the", + "base_url_v1 argument." + )) + } + obj <- list( + client = self$session_v1, + path = paste0("api/v1/", path) + ) + } + return(obj) + } + ) ) From 30318ff4ca1b9d7cc2ffb731c8915700e3ed2b91 Mon Sep 17 00:00:00 2001 From: Malte Kyhos Date: Sat, 5 Feb 2022 15:18:27 +0100 Subject: [PATCH 53/57] Remove remaining merge marks --- tests/testthat/test-asset.R | 3 --- tests/testthat/test-kobo.R | 12 ------------ 2 files changed, 15 deletions(-) diff --git a/tests/testthat/test-asset.R b/tests/testthat/test-asset.R index fc19ea1..356d159 100644 --- a/tests/testthat/test-asset.R +++ b/tests/testthat/test-asset.R @@ -75,8 +75,6 @@ test_that("get asset returns asset instance", { # to list function expect_equal(length(asset_obj$to_list()), 6) expect_setequal(names(asset_obj$to_list()), c("uid", "name", "asset_url", "data_url", "type", "owner_username")) -<<<<<<< HEAD -======= }) test_that("can get survey submissions from survey", { @@ -114,5 +112,4 @@ test_that("get_submissions throws error for asset which is not a survey", { }) expect_error(asset_obj$get_submissions(), regexp = "Only valid for assets of type 'survey'. Current asset is of type 'block'.") ->>>>>>> dev }) diff --git a/tests/testthat/test-kobo.R b/tests/testthat/test-kobo.R index 4e7b181..d73e1f6 100644 --- a/tests/testthat/test-kobo.R +++ b/tests/testthat/test-kobo.R @@ -54,10 +54,7 @@ test_that("Kobo is initialized correctly if we provide a KoboClient instance", { }) test_that("we get a message if we do not specify base_url_v1, but Kobo is initialized.", { -<<<<<<< HEAD -======= testthat::skip("skipping because currently this message is not printed because no functionality depends on v1 API") ->>>>>>> dev expect_message( { kobo_obj <- Kobo$new(base_url_v2 = BASE_URL, kobo_token = "foo") @@ -87,13 +84,8 @@ test_that("Kobo can fetch assets", { kobo <- Kobo$new(base_url_v2 = BASE_URL, kobo_token = Sys.getenv("KBTBR_TOKEN")) assets <- kobo$get_assets() }) -<<<<<<< HEAD - expect_setequal(names(assets), c("count", "next", "previous", "results")) - expect_equal(nrow(assets$results), 8) -======= expect_setequal(names(assets), ASSET_COLUMNS) expect_equal(nrow(assets), 8) ->>>>>>> dev }) test_that("Kobo can fetch assets using simple get", { @@ -107,11 +99,7 @@ test_that("Kobo can fetch assets using simple get", { expect_equal(assets$count, 8) }) -<<<<<<< HEAD -test_that("Kobo can a single asset", { -======= test_that("Kobo can get a single asset", { ->>>>>>> dev vcr::use_cassette("kobo-get-single-asset", { kobo <- Kobo$new(base_url_v2 = BASE_URL, kobo_token = Sys.getenv("KBTBR_TOKEN")) asset <- kobo$get_asset("aRo4wg5utWT7dwdnQQEAE7") From abafdc950c93b957df39b628232f4998838008cd Mon Sep 17 00:00:00 2001 From: Malte Kyhos Date: Sat, 5 Feb 2022 15:24:02 +0100 Subject: [PATCH 54/57] Asset: fix description of init --- R/asset.R | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/R/asset.R b/R/asset.R index 8361682..265a04f 100644 --- a/R/asset.R +++ b/R/asset.R @@ -1,12 +1,14 @@ #' Asset #' Class to hold an asset -#' @param asset_list list. a list with the asset data, such as obtained through a call to assets/{id} -#' @param kobo Kobo instance. Instance of class Kobo used internally to make requests to the API. Asset <- R6::R6Class("Asset", public = list( # Public Methods =========================================================== + #' @description + #' Constructs a new instance of class [Asset]. + #' @param asset_list list. a list with the asset data, such as obtained through a call to assets/{id} + #' @param kobo Kobo instance. Instance of class Kobo used internally to make requests to the API. initialize = function(asset_list, kobo) { # check that everything exists in list that we need needed_names <- c("uid", "name", "url", "data", "owner__username", "asset_type") From 227efd899d3f57a7d3955a2b1ca1e754d4ef25b7 Mon Sep 17 00:00:00 2001 From: Malte Kyhos Date: Sat, 5 Feb 2022 15:25:07 +0100 Subject: [PATCH 55/57] Format & add some docs --- NAMESPACE | 1 + R/asset.R | 2 +- R/kobo-client.R | 2 + man/Asset.Rd | 1 + man/Kobo.Rd | 18 +++++++-- man/KoboPaginator.Rd | 89 +++++++++++++++++++++++++++++++++++++++++ man/read_only_active.Rd | 5 ++- 7 files changed, 111 insertions(+), 7 deletions(-) create mode 100644 man/KoboPaginator.Rd diff --git a/NAMESPACE b/NAMESPACE index 3bf32fc..49dbd1b 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -3,6 +3,7 @@ export("%>%") export(Kobo) export(KoboClient) +export(KoboPaginator) import(checkmate) importFrom(crul,HttpClient) importFrom(magrittr,"%>%") diff --git a/R/asset.R b/R/asset.R index 265a04f..495fb98 100644 --- a/R/asset.R +++ b/R/asset.R @@ -59,7 +59,7 @@ Asset <- R6::R6Class("Asset", # Private Fields =========================================================== # Storage fields for Active Bindings --------------------------------------- - + # .uid = NA, .name = NA, .asset_url = NA, diff --git a/R/kobo-client.R b/R/kobo-client.R index fef7620..001facd 100644 --- a/R/kobo-client.R +++ b/R/kobo-client.R @@ -85,7 +85,9 @@ KoboClient <- R6::R6Class("KoboClient", # Private Fields =========================================================== + # @field base_url (`character(1)`) base_url = "", + # @field kobo_token (`character(1)`) kobo_token = "" ) # ) diff --git a/man/Asset.Rd b/man/Asset.Rd index 3ce0ec8..d18c011 100644 --- a/man/Asset.Rd +++ b/man/Asset.Rd @@ -45,6 +45,7 @@ gives access to the submissions to the survey.} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-new}{}}} \subsection{Method \code{new()}}{ +Constructs a new instance of class \link{Asset}. \subsection{Usage}{ \if{html}{\out{
}}\preformatted{Asset$new(asset_list, kobo)}\if{html}{\out{
}} } diff --git a/man/Kobo.Rd b/man/Kobo.Rd index 306440a..443acf1 100644 --- a/man/Kobo.Rd +++ b/man/Kobo.Rd @@ -14,7 +14,7 @@ interactions with the various endpoints. \describe{ \item{\code{session_v2}}{\link{KoboClient} session for v2 of the API} -\item{\code{session_v1}}{\code{KoboClient} session for v1 of the API} +\item{\code{session_v1}}{\link{KoboClient} session for v1 of the API} } \if{html}{\out{}} } @@ -23,6 +23,7 @@ interactions with the various endpoints. \itemize{ \item \href{#method-new}{\code{Kobo$new()}} \item \href{#method-get}{\code{Kobo$get()}} +\item \href{#method-get_paginated}{\code{Kobo$get_paginated()}} \item \href{#method-post}{\code{Kobo$post()}} \item \href{#method-get_assets}{\code{Kobo$get_assets()}} \item \href{#method-get_surveys}{\code{Kobo$get_surveys()}} @@ -63,10 +64,10 @@ For example: https://kc.correlaid.org.} \item{\code{kobo_token}}{character. The API token. Defaults to requesting the systen environment \code{KBTBR_TOKEN}.} -\item{\code{session_v2}}{\link{KoboClient} To pass directly +\item{\code{session_v2}}{\link{KoboClient}. Alternatively, pass directly a \link{KoboClient} instance for the API version v2.} -\item{\code{session_v1}}{\link{KoboClient} In addition to session_v2 one can pass +\item{\code{session_v1}}{KoboKlient. In addition to session_v2 one can pass also a \link{KoboClient} instance for the API version v1.} } \if{html}{\out{}} @@ -99,9 +100,18 @@ component. The order is not hierarchical.} } \subsection{Returns}{ a list encoding of the json server reply if parse=TRUE. -Otherwise, it returns the server response as a crul::HttpResponse +Otherwise, it returns the server response as a \link[crul:HttpResponse]{crul::HttpResponse} object. } +} +\if{html}{\out{
}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-get_paginated}{}}} +\subsection{Method \code{get_paginated()}}{ +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{Kobo$get_paginated(path, query, version = "v2", format = "json", parse = TRUE)}\if{html}{\out{
}} +} + } \if{html}{\out{
}} \if{html}{\out{}} diff --git a/man/KoboPaginator.Rd b/man/KoboPaginator.Rd new file mode 100644 index 0000000..2903e4d --- /dev/null +++ b/man/KoboPaginator.Rd @@ -0,0 +1,89 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/kobo-paginator.R +\name{KoboPaginator} +\alias{KoboPaginator} +\title{KoboPaginator} +\description{ +A class that implements link-header style pagination, as is used in +the Kobotoolbox API. +} +\section{Methods}{ +\subsection{Public methods}{ +\itemize{ +\item \href{#method-new}{\code{KoboPaginator$new()}} +\item \href{#method-get}{\code{KoboPaginator$get()}} +\item \href{#method-set_first_response}{\code{KoboPaginator$set_first_response()}} +\item \href{#method-get_responses}{\code{KoboPaginator$get_responses()}} +\item \href{#method-clone}{\code{KoboPaginator$clone()}} +} +} +\if{html}{\out{
}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-new}{}}} +\subsection{Method \code{new()}}{ +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{KoboPaginator$new(client)}\if{html}{\out{
}} +} + +\subsection{Arguments}{ +\if{html}{\out{
}} +\describe{ +\item{\code{client}}{KoboClient. An instance of a KoboClient that can +be used for the paginated requestes.} +} +\if{html}{\out{
}} +} +} +\if{html}{\out{
}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-get}{}}} +\subsection{Method \code{get()}}{ +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{KoboPaginator$get(path, query, ...)}\if{html}{\out{
}} +} + +} +\if{html}{\out{
}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-set_first_response}{}}} +\subsection{Method \code{set_first_response()}}{ +Set the initial response +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{KoboPaginator$set_first_response(response)}\if{html}{\out{
}} +} + +\subsection{Details}{ +Usually, the page method would revoke a first response in the +normal way, using its \code{next} element to walk over all subsequent +pages. In some settings, the user might provide this initial response +object already. +} + +} +\if{html}{\out{
}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-get_responses}{}}} +\subsection{Method \code{get_responses()}}{ +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{KoboPaginator$get_responses()}\if{html}{\out{
}} +} + +} +\if{html}{\out{
}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-clone}{}}} +\subsection{Method \code{clone()}}{ +The objects of this class are cloneable with this method. +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{KoboPaginator$clone(deep = FALSE)}\if{html}{\out{
}} +} + +\subsection{Arguments}{ +\if{html}{\out{
}} +\describe{ +\item{\code{deep}}{Whether to make a deep clone.} +} +\if{html}{\out{
}} +} +} +} diff --git a/man/read_only_active.Rd b/man/read_only_active.Rd index c53737a..f8fc6d4 100644 --- a/man/read_only_active.Rd +++ b/man/read_only_active.Rd @@ -9,8 +9,9 @@ read_only_active(private, field, val) \arguments{ \item{private}{Pointer to the private env of an object} -\item{field}{character(1) the (private) field name used as a storage -for the active field} +\item{field}{character(1) the name of the active binding field. It is assumed +that a private field prefixed with a single dot exists, that servers as +storage.} \item{val}{The value passed to the active binding. If it is not missing, the function will stop.} From ad6b5daaae6bde36e64f5a31746a9a61e768e638 Mon Sep 17 00:00:00 2001 From: Malte Kyhos Date: Fri, 2 Dec 2022 22:00:18 +0100 Subject: [PATCH 56/57] First houskeeping after long time... --- R/kobo-paginator.R | 46 +++++++++++++++++++++++++++++----------------- R/kobo.R | 2 +- 2 files changed, 30 insertions(+), 18 deletions(-) diff --git a/R/kobo-paginator.R b/R/kobo-paginator.R index 30c4c66..c8d082c 100644 --- a/R/kobo-paginator.R +++ b/R/kobo-paginator.R @@ -10,14 +10,17 @@ KoboPaginator <- R6::R6Class( #' @param client KoboClient. An instance of a KoboClient that can #' be used for the paginated requestes. initialize = function(client) { - stopifnot("KoboClient" %in% class(client)) - - private$client <- client + private$client <- assert_class(client, "KoboClient") }, #' @description #' @param path + #' @param query + #' @param ... Additional parameters passed to internally + #' called `KoboClient$get()`. get = function(path, query, ...) { - private$page(method = "get") + assert_string(path) + assert_string(query) + private$page(path, query, ...) }, #' @description #' Set the initial response @@ -26,9 +29,12 @@ KoboPaginator <- R6::R6Class( #' normal way, using its `next` element to walk over all subsequent #' pages. In some settings, the user might provide this initial response #' object already. - set_first_response = function(response) { - checkmate::assert_list(response) - private$resps <- response + set_first_response = function(response, force_reset = FALSE) { + assert_list(response) + if (!(force_reset || is.null(private$resps))) { + stop("There are already existing responses. Use 'force_reset = TRUE' to reset/delete them.") + } + private$resps <- list(response) }, get_responses = function() { return(private$resps) @@ -36,24 +42,30 @@ KoboPaginator <- R6::R6Class( ), private = list( resps = NULL, - page = function(path, query, sleep = 0, ...) { - checkmate::assert_choice(method, "get") + page = function(path, query, sleep = 0.5, ...) { tmp <- list() # Retrieve initial response - tmp[[1]] <- private$resps %||% - self$client$get(path, query) + + # Initialize Pagination + tmp[[1]] <- private$resps[[1]] %||% self$client$get(path, query, ...) + next_link <- tmp[[1]][["next"]] cnt <- 1 - next_link <- tmp[[cnt]][["next"]] - while (!is.null(next_link)) { - tmp_path <- private$resolve_next(next_link) + repeat { + if (is.null(next_link)) { + message(sprintf("Iterated over %s pages.", cnt)) + break + } + + # New iteration + Sys.sleep(sleep) cnt <- cnt + 1 - tmp[[cnt]] <- self$client$get(tmp_path, query) - tmp[[cnt]]$raise_for_status() + tmp_path <- private$resolve_next(next_link) + tmp[[cnt]] <- self$client$get(tmp_path, query, ...) + tmp[[cnt]]$raise_for_status() next_link <- tmp[[cnt]][["next"]] - Sys.sleep(sleep) } private$resps <- tmp diff --git a/R/kobo.R b/R/kobo.R index 4eb9c59..d6b292d 100644 --- a/R/kobo.R +++ b/R/kobo.R @@ -28,7 +28,7 @@ Kobo <- R6::R6Class("Kobo", #' the systen environment `KBTBR_TOKEN`. #' @param session_v2 [KoboClient]. Alternatively, pass directly #' a [KoboClient] instance for the API version v2. - #' @param session_v1 KoboKlient. In addition to session_v2 one can pass + #' @param session_v1 KoboClient. In addition to session_v2 one can pass #' also a [KoboClient] instance for the API version v1. initialize = function(base_url_v2 = NULL, base_url_v1 = NULL, kobo_token = Sys.getenv("KBTBR_TOKEN"), From 98324259937bc3345a508179ceb6ac83895f67db Mon Sep 17 00:00:00 2001 From: Malte Kyhos Date: Fri, 2 Dec 2022 22:08:59 +0100 Subject: [PATCH 57/57] Increment version number --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 00c31b4..ff2a36a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: kbtbr Type: Package Title: A Wrapper for the KoBoToolbox API -Version: 0.1.0.9000 +Version: 0.1.0.9002 Authors@R: c(person("Dimitri", "Marinelli", role = c("aut")), person("Lada", "Rudnitckaia", role = "aut"), person("Malte", "Kyhos", role = "aut"),