Deserialization of JSON

Hello Team!
I am working on an integeration between HubSpot and Navsion, to forward contacts from HubSpot to Navison (Dynamics).
I where to get the contacts from HubSpot contacts API as a String.
I want to deserialize this string to a JSON object in c#.

I where not able to find what data types are the elements.

My Question:
Is there c# Class for Contacts to see what data types are the elements? How is the class structured?

Any support is appriciated :slightly_smiling_face:

Hi @ZZaim

Throwing some c# folks in here :grinning_face:

@JokersWild , @gotmike ,@odowdbrendan can you all help here?

Hey @dennisedson!
I was able to find a solution for this problem.
This is The Solution, it might help other intrested people.
I am basicly calling the HubSpot contacts API with an HTTP Client and recieving the contacts as a string. I deserialized the JSON Object to access the diffrent elements and properties.
c# Code:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Net.Http;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;

namespace HubSpot_API
{
class Program
{
HttpClient client = new HttpClient();

static async Task Main(string[] args)
{
Program program = new Program();
await program.GetContacts();
}

private async Task GetContacts()
{
string response = await client.GetStringAsync("https://api.hubapi.com/crm/v3/objects/contacts/?limit=6&archived=false&hapikey="Your API Key"&properties=salutation&properties=email&properties=firstname&properties=lastname&properties=phone_no&properties=country_region_code&properties=position&properties=address");
//Console.WriteLine(response);
var rootObj = JsonConvert.DeserializeObject<Root>(response);
{
foreach (var element in rootObj.results)
{
Console.WriteLine(element.id);

}
}

}

}

public class Properties
{
public string address { get; set; }
public string country_region_code { get; set; }
public DateTime createdate { get; set; }
public string email { get; set; }
public string firstname { get; set; }
public string hs_object_id { get; set; }
public DateTime lastmodifieddate { get; set; }
public string lastname { get; set; }
public string phone_no { get; set; }
public string position { get; set; }
public string salutation { get; set; }
}

public class Result
{
public string id { get; set; }
public Properties properties { get; set; }
public DateTime createdAt { get; set; }
public DateTime updatedAt { get; set; }
public bool archived { get; set; }
}

public class Root
{
public List<Result> results { get; set; }
}

}