The Silver Lining

Lessons & Learnings from a salesforce certified technical architect.

Archive for the ‘web services’ Category

Salesforce & LinkedIn Developer API: 401 – Unauthorized

with 3 comments

Image representing LinkedIn as depicted in Cru...

Image via CrunchBase

I’m not going to get into the boilerplate code you’ll need in order to get OAuth up and running as it’s pretty straight forward, but I did run into a peculiar issue which took me some time to narrow down. To reproduce these steps you’ll need to:

  1. Correctly setup OAuth between the Force.com Platform and LinkedIn
  2. Authorise access to your LinkedIn account
  3. Attempt to fetch a resource using an API endpoint such as: http://api.linkedin.com/v1/people/~/network/updates?scope=self

When attempting to make the call out in step 3 you’ll get a “401 – Unauthorized” error. So to be clear OAuth is working perfectly but a call like this one will still result in the error.

After some troubleshooting I noticed that some API endpoints didn’t result in the error e.g. http://api.linkedin.com/v1/people/id=abcdefg/network/updates?scope=self. At this point I realised the issue was probably the tilde (‘~’) character in the URI.

Grasping at straws I manually replaced the tilde with it’s URL friendly equivalent ‘%7E’ and the callout worked perfectly. Now this is strange because I am, in the course of making the callout, URL encoding all parts of the endpoint URL. It seems that for some reason the LinkedIn OAuth services needs to have the tilde encoded twice when signing the request :/

Announcing the Salesforce Handbook

with 6 comments

Recently, Jeff Douglas and I saw the potential for a beginner’s book – aimed at business owners, analysts and developers, that comprehensively documents Salesforce and Force.com. There is a tonne of documentation out there and we thought “Wouldn’t it be nice to have a handbook that lightly summarised the most important areas of the platforms as well as offering some best practise advice”. We mulled it over for a time, and today we’d like to announce that we’re currently writing:

The Salesforce Handbook

A newcomer’s guide to building applications on Salesforce.com and the Force.com Platform.

Hand-in-hand with the book we’ll be publishing content from the book on a WordPress site. Here you can expect to find excerpts from the book, but also content that supplements the book e.g. areas that’ll serve as best-practice hubs with links to official documentation, blog posts that rock the party, and even superb discussion forum threads.

We’d love to get your feedback on the book as it progresses, but for now you can checkout the announcement and let us know what you think of the idea.