--
You received this message because you are subscribed to the Google Groups "Kobo Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kobo-users+...@googlegroups.com.
To post to this group, send email to kobo-...@googlegroups.com.
Visit this group at http://groups.google.com/group/kobo-users.
For more options, visit https://groups.google.com/d/optout.
var client = new RestClient("https://kc.kobotoolbox.org/api/v1/forms/{pk}/csv_import");
client.Authenticator = new HttpBasicAuthenticator("user_name", "password");
client.AddDefaultUrlSegment("pk", "31045");
string file_path = Server.MapPath("~/myform.csv");
var request = new RestRequest(Method.POST);
request.AddFile("csv_file", file_path);
IRestResponse response = client.Execute(request);
but I still find it difficult with either JSON or XML. I think the main challenge is figuring out how exactly the XML file should be structured or how the JSON should be structured.
Thanks!
Hi Hussein,
For importing XML, did you try using the exact format of XML created by KoBoCollect? The default format is
<?xml version='1.0' ?>
<your_form_id id="your_form_id">
<formhub><uuid>xxxxxxxxxxxxxxxxxxxxxxx</uuid></formhub><q1>some text</q1><q2>some text</q2><meta><instanceID>uuid:yyyyyyyyy</instanceID></meta>
</your_form_id>
Best,
Tino
Visit this group at https://groups.google.com/group/kobo-users.