6

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?

Stephen Kennedy
  • 20,585
  • 22
  • 95
  • 108
twomm
  • 551
  • 5
  • 16
  • 4
    The 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 Answers5

4

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);
Community
  • 1
  • 1
Dan Esparza
  • 28,047
  • 29
  • 99
  • 127
4

Use RestSharp - http://restsharp.org/

Matt Roberts
  • 26,371
  • 31
  • 103
  • 180
2

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.

Scott
  • 13,735
  • 20
  • 94
  • 152
1

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

qxotk
  • 2,384
  • 5
  • 24
  • 39
0

I think you should try this:

http://sdk.welovehighrise.com/

It works perfectly in our applications

Peter
  • 9
  • 1