Framework Madness!

And other adventures C# and asp.net …

Posts Tagged ‘rest api

Of OAuth and REST Api’s …

leave a comment »

I recently was working on a project that was leveraging a popular on line service’s api’, and by way of that an introduction into OAuth. I have to admit it was more than a frustrating experience. The two biggest pain points where that 1) the documentation was cluttered with OAuth references and syntax, and 2) no working client API’s could be found for the .net platform. (Note: I did find a .net api linked on their forums, but it was broken because the on line service reserves the right to make arbitrary changes to their contract that renders client API useless.)

So after getting past my initial “I cannot belive they’ve done this” thoughts and digging around I found the OAuth web site and it does feature a C# script for the library implementation. (click here). That made things a bit easier. This script will get you most of the way towards making OAuth method calls with ease. Here are a few pointers:

1) Watch out for token usage. Some method calls will require a login token key to be provided in addition the  consumer key. You’ll want to run this as a separate request before making the method hash and subsequent call.

2) Be careful to make sure you have your http method correct as it is part of the signature.

3) You’ll need to append the hash result as a url parameter after calling ‘GenerateSignatureBase’.

That’s it for now.

Written by Lynn Eriksen

January 12, 2009 at 1:55 pm

Posted in Uncategorized

Tagged with , ,