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?
-
4The Highrise API is implemented as XML responses. It ought to be simple enough to create some C# classes against that XML with XSD.EXE. – Robert Harvey Apr 13 '11 at 14:57
-
yes, I know. I was just wondering if there already was something usable "out of the box". Thanks anyway! – twomm Feb 07 '12 at 15:27
-
xsd.exe will make things too complicated in this case -- just create a POCO type. – Dan Esparza Apr 29 '12 at 03:07
5 Answers
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);

- 1
- 1

- 28,047
- 29
- 99
- 127
-
-
I don't, but you might want to look at this question and answer for hints: http://stackoverflow.com/questions/11400879/how-to-post-request-using-restsharp – Dan Esparza Mar 14 '13 at 18:13
-
1
I know I'm resurrecting an old question, but in the event this helps someone who gets here from Google (I found this thread myself when looking for the same thing), I've created a new Github repository for a .NET Highrise API wrapper.

- 13,735
- 20
- 94
- 152
Just to clarify, while you may find some Highrise-specific REST API wrapper libraries out there, you are likely to have just as easy a time using a general purpose REST API wrapper (such as RestSharp noted above).
I propose another project, which I am currently using to access Highrise via the REST API.
The library is called Hammock, and is found here on github: https://github.com/danielcrenna/hammock

- 2,384
- 5
- 24
- 39