Teach Me Salesforce

A community approach to learning salesforce.com

Video Tutorial – Developing with Apex REST Services

with 3 comments

I’ve had this video queued up for a few days now as I was waiting for the Apex REST API webinar. I didn’t want to steal Sandeep Bhanot’s and Alex Toussaint’s thunder. Their webinar was very informative and packed full of code! It should be available here any day now for your viewing pleasure.

Over at CloudSpokes we’ve been running development challenges with Apex REST services for quite awhile now. To facilitate future challenges I put together a video showing everything (yes, everything) you need to know to get started building applications with Apex REST services. The tutorial below walks you through the entire process of building our Members service. It shows you how to structure your services, how to use the new REST classes, and how to use the Apigee Console for Salesforce.com to test your services. The Apigee console even handles the OAuth for you!! Why write your own Java or Rails client app to test your classes? I’ve even published the entire code for the Members service so you can use it as a template. You can find the code here at github.

So here’s how to get started:

  1. Sign up for a new developer org at developer.force.com. All new orgs are now enabled with the Apex REST services so you can get started right away without waiting for the feature to get enabled.
  2. Take a peek at the Force.com REST API site for tutorials, code snippets, webinars and documentation. You can even post questions to the message boards for quick answers to your problems.
  3. Watch this awesome video by our friends at Apigee entitled RESTful API Design: Teach a Dog to REST. We love the design principles.
  4. Watch the video above for a quick tutorial services and then check out the code.
  5. Use the Apigee Console for Salesforce.com as your client application and start writing some code!
If you want some real-world experience using Apex REST services, hop on over to CloudSpokes and participate in some of our challenges to rebuild our site using Apex REST services. Prizes range from $500 – $1000 and we have a large number of challenges available!
Advertisements

Written by Jeff Douglas

July 21, 2011 at 8:55 am

Posted in CloudSpokes, REST

Tagged with

3 Responses

Subscribe to comments with RSS.

  1. Really nice post Jeff!, Great that you can create multiple actions with one call using the REST Services

    Chris O Davies

    July 21, 2011 at 10:30 am

  2. Great post Jeff !!!.. I had one query regarding native ipad application to be integrated with REST webservices in Salesforce. In case, if I need to support this, then does it mean for using Oauth protocol , I would have to host my ipad source code on some server as I need callback URL for Oauth mechanism. Let me know if this is mandatory or else should I go with session Id stuff ??

    Sunny

    July 23, 2011 at 1:35 pm

  3. Hi Jeff – nice post, with an awesome video. One minor point – you seem to show the REST service returning a 200 HTTP status code even in the case of error. You can let exceptions propagate (resulting in a 400 status code) or explicitly set the status code via the statusCode field on RestResponse – 200 (the default) for success, 201 for member created and whatever 4xx code seems appropriate for an error.

    Pat Patterson

    July 24, 2011 at 5:50 pm


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: