I am developing a web-based application in ASP MVC 5 that uses MS SQL Server for data storage.
The application needs to allow data collection in areas without internet connectivity using the mobile app called Kobo. When the data collector returns to an area with internet connectivity, the collected data should automatically synchronize and upload to the database.
I'm looking to utilize the Kobotoolbox API for integration with C#. I've attempted to grasp the API documentation provided on their website https://kobo.humanitarianresponse.info/api/v2/assets/ but haven't been successful.
How can I effectively synchronize the data collected using the Kobotoolbox API with C#? a simple example would be apprciated.
Thanks
using System;
using System.Net.Http;
using System.Threading.Tasks;
class Program
{
private static readonly HttpClient client = new HttpClient();
static async Task Main(string[] args)
{
await ProcessRepositories();
}
private static async Task ProcessRepositories()
{
client.DefaultRequestHeaders.Add("Authorization", "3f1f2ed9eba34798e32b8f6e118a6901a9da06bb");
var assetId = "aLZ3Xeom8dYcMv2uBEaYzq";
var stringTask = client.GetStringAsync($"https://kf.kobotoolbox.org/api/v2/assets/{assetId}/data/");
var msg = await stringTask;
Console.Write(msg);
}
}