Wednesday, May 10, 2017

Rest Web Service Apex Code Sample (Web Method contains parameters).

Below is a simple example of a rest web service (RestWSSampleWithParam) with a web method (getRestSampleResponse)contains parameters.

/**
 * Rest Web Service Example.
 **/
 @RestResource(urlMapping='/RestWSSampleParamExmpl/*')
global with sharing class RestWSSampleWithParam
{
  @HttpPost
  global static String getRestSampleResponse(String firstName, String lastName)
  {
    return 'Hello! ' + firstName + ' ' + lastName;
  }
}

Salesforce REST API: Upload a Files to a Record Attachments | Step-by-Step Guide

Uploading a file to a Salesforce record using the REST API is a straightforward process. In this tutorial, I'll walk you through the com...