As some have suggested, RestSharp is pretty easy to use with the HighRise API . At least one person suggested using xsd.exe
, which I highly recommend, which will complicate things too much. Instead, create a POCO type using only the elements you want to get / set. Like this:
namespace Highrise.Model { public class Person { [XmlElement("author-id")] public string AuthorId { get; set; } [XmlElement("background")] public string Background { get; set; } [XmlElement("first-name")] public string FirstName { get; set; } [XmlElement("last-name")] public string LastName { get; set; } [XmlElement("id")] public string Id { get; set; } } public class People : List<Person>{} }
Then just use the RestSharp library as follows:
// Setup our client: var client = new RestClient("https://yourhighrisename.highrisehq.com"); client.Authenticator = new HttpBasicAuthenticator("YOUR_API_KEY_HERE", "X"); // Create our request: var request = new RestRequest("/people.xml", Method.GET); // Execute our request with our client: RestResponse<People> response = (RestResponse<People>) client.Execute<People>(request);
source share