Tag Archives: REST API

Before that Pizza-as-a-Service diagram there was Pizza Party

Look, I’m not even going to reproduce the diagram here. I know you’ve seen it. Everybody’s seen it. Goodness knows my tweet stream has been full of it for the best part of the last month.

Just in case you haven’t seen it: http://lmgtfy.com/?q=pizza-as-a-service

In doing my prep for my upcoming talk at TechEd Australia I came across this gem from April 2004 (yep, that’s over 10 years ago folks!) that shows how a public API can have a positive upside to any business, even if the usage is not strictly that which was intended.

The back story is that some guys worked out how to directly call Domino’s online ordering backend web service at the time without needing to drive it all through a web interface.

This small example really demonstrates the power of a public API and how people will take it and use it in ways you had not intended, but in ways which will have a positive impact on your business.

What’s the bet that CompSci dorm rooms all over America in 2004 were happily ordering their delivered pizzas from a Linux command prompt?!

Enjoy.

Check out the sourcecode up on Github!

https://github.com/coryarcangel/Pizza-Party-0.1.b

Tagged , ,

Retrieve Work Item Discussion History using Visual Studio Online’s REST API

At TechEd North America Microsoft announced the availability of a preview REST API for Visual Studio Online.  Anyone who has spent time around Team Foundation Server will know that it’s always had a strongly-typed C# SDK which can be used to extract and manipulate work items held in TFS.  This REST API is new and will eventually be available for the on-premise hosted version of TFS.

In a lucky coincidence I’m doing some work that requires me to extract work item information for other purposes so I decided to give the API a whirl.  As you can see it went pretty well!

*Strictly* speaking, it isn’t a complete Work Item as by default Attachments and History are both excluded.  Interestingly both of these tend to be pain points for other traditional tools to deal with too :).

Luckily the new REST API offers support for retrieval of “Updates” which represent the set of fields changed on each update to the Work Item.  This can be any combination of fields or comments directly added to the history by users.

The demo code below shows how you can build out the history so it displays “Discussion Only” items and excludes all others.  As it’s early days for the API maybe we’ll see the sort of logic covered here wrapped in an API call so you don’t need to parse these objects locally.

Once the entire solution is ready I’ll post the source up on Github.  Note you’ll need to enable the “Alternate Credentials” on your user profile to get this code working.

Tagged , , , , ,