I am looking for a .NET (c#) wrapper for the 37signals Highrise REST API. Sadly enough, I could not find anything really suitable. Has anyone developed something like this or has links to share?
Use RestSharp - http://restsharp.org/
As some have suggested, RestSharp is pretty easy to use with the HighRise API. At least one person suggested using xsd.exe
which I strongly suggest against -- this will complicate things too much. Instead, create a POCO type with just the items 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 do a get using the RestSharp library like this:
// 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);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With