Apex REST API webinar on July 19th | Salesforce Developers Blog

In my humble (and admittedly somewhat biased) opinion, one of the biggest strengths of the Force.com platform is its suite of APIs. These APIs allow you to integrate/mashup/enhance/mobilize applications built on the Force.com platform and the best part is that the Force.com API suite is like the US Federal debt – its constantly growing! Recently, we’ve added a Chatter RESTĀ API (excellent webinar recording available here), a Streaming API (make sure to register for the webinar on 7/7 here) and an Apex REST API.

Apex REST is a new Pilot feature in Summer 11, and we demoed it in the Summer 11 preview webinar that Dave Carroll and I did a couple of months back. The feature is important enough though to deserve its own turn in the spotlight and so Alex Toussaint (Product Manager for the API) and I will be hosting a webinar on 7/19 to review this new feature. Apex REST gives you the ability to expose any custom Apex code as a RESTful service that external clients (such as mobile devices) can invoke and consume. In other words, you can develop your own custom REST API using Apex and the full power of the Force.com platform. You can find some additional details about this feature in this blog post.

Here’s a small snippet from that blog entry to give you an idea of what an Apex REST class might look like:

@RestResource(urlMapping='/CaseManagement/*')
global with sharing class CaseManagementRESTSvc {

    @HttpGet
    global static Case getCaseRecord(RestRequest req, RestResponse res) {
        String caseNum = req.requestURI.substring(req.requestURI.lastIndexOf('/')+1);
        Case c = CustomCaseMgmt.getCase(caseNum);
        return c;
    }
}

As you can see, using some special new Apex annotations (@RestResource, @HttpGet etc.), you can expose custom Apex logic to clients that prefer to use the more lightweight REST/JSON protocols (instead of the SOAP/XML formats that is supported by another somewhat similar Force.com feature – Apex SOAP services).

Please join us on 7/19 by registering for either the 7am PDT or 10am PDT slot and find out more about the use cases, code samples and best practices for using Apex REST. Hope to see you then.

Stay up to date with the latest news from the Salesforce Developers Blog

Subscribe