I'm doing a program and i need to interact with airtables api to get the registred members from there.
But my code is not working, says that class.Id.get returned null
.
Code:
public class TraderData
{
public string Id { get; set; }
public string Fields { get; set; }
public string Users { get; set; }
public string Macaddress_value { get; set; }
public string Email_value { get; set; }
public string Createdtime { get; set; }
}
static void GetUserData()
{
WebClient web = new WebClient();
web.Headers.Set(HttpRequestHeader.Authorization, "Bearer keycxCsSzHzvAquck");
string json = web.DownloadString("https://api.airtable.com/v0/appO1mkBuYFHD0tH5/users_control");
var data = JsonConvert.DeserializeObject<TraderData>(json);
Console.WriteLine(data.Id.ToString());
}
API:
{"records":[{"id":"reczOujwG3H1DuhR7","fields":{"Users":"user_juseh","macaddress_value":"123456789","email_value":"juseh@hotmail.com"}, "createdTime":"2018-04-21T22:36:48.000Z"}]}