SlideShare a Scribd company logo
1 of 36
Download to read offline
Exposing Salesforce REST Services
using Swagger
Visualizing your REST Services
Thys Michels, Lending Club, Software Engineer
@thysmichels
Agenda
▪ Objective
▪ Introduction and defining REST endpoints
▪ Force.com REST APIs
▪ Demo REST API
▪ Spring MVC with Swagger Annotations
▪ Demo Spring MVC with Swagger
▪ Resources
▪ Q&A
Objective
• Review the basics of REST
• Showcase a Force.com REST API implementation
• Compare different Force.com REST APIs
• Develop a Force.com RESTful Service using Swagger
What is REST
• REpresentational State Transfer
• An architecture style for designing distributed systems
• Not a standard, rather a set of patterns:
• Client/Server, Stateless, Uniform interface, etc.

• Not tied to HTTP, but associated most commonly with it.
HTTP’s Uniform Interface
• URI’s identify resources
• HTTP verbs describe a limited set of operations that can be
used to manipulate a resource
• GET
• DELETE
• PUT
• POST

• Headers help describe the messages
Defining a REST Endpoint
What does this endpoint mean to a developer, tester or any
consumer:
/accounts
What does the endpoint tell us?
Defining a REST Endpoint (2)
Endpoint Description:
Operation
Descriptions

/account

Operations:
GET
POST
PUT
DELETE
Error Codes:
Validation

Input:
Parameter Values
Form Values
JSON Format
Header information

Return formats
Salesforce REST APIs
• https://github.com/jesperfj/force-rest-https://github.com/jesperfj/force-restapi
• Developer: Jesper Joergensen
• Lightweight library for building Force.com apps with OAuth authentication
and data access through the Force.com REST API.
• https://github.com/ryanbrainard/force-rest-https://github.
com/ryanbrainard/force-rest-api
• Developer: Ryan Brainard
• Forked version of Jasper Joergensen project
• Caching enhancements
• Available in Maven Central
Force.com REST API Maven dependency
<repositories>
<repository>
<id>force-rest-api</id>
<name>force-rest-api repository on GitHub</name>
<url>http://jesperfj.github.com/force-rest-api/repository/</url>
</repository>
</repositories>
<dependency>
<groupId>com.force.api</groupId>
<artifactId>force-rest-api</artifactId>
<version>0.0.19</version>
</dependency>
Authenticating to Salesforce
• Using Username and Password
•

For backend application where only server authentication is needed:

ForceApi api = new ForceApi(new ApiConfig()
.setUsername("user@domain.com")
.setPassword("password+token"));

• Using OAuth Username and Password
•

Front end application where user authentication is needed:

ForceApi api = new ForceApi(new ApiConfig()
.setUsername("user@domain.com")
.setPassword("password")
.setClientId("longclientidalphanumstring")
.setClientSecret("notsolongnumeric"));
OAuth Web Server Flow
String url = Auth.startOAuthWebServerFlow(new AuthorizationRequest()
.apiConfig(new ApiConfig()
.setClientId("longclientidalphanumstring")
.setRedirectURI("https://myapp.mydomain.com/oauth"))
.state("mystate"));
ApiSession s = Auth.completeOAuthWebServerFlow(new AuthorizationResponse()
.apiConfig(new ApiConfig()
.setClientId("longclientidalphanumstring")
.setClientSecret("notsolongnumeric")
.setRedirectURI("https://myapp.mydomain.com/oauth"))
.code("alphanumericstringpassedbackinbrowserrequest"));
ForceApi api = new ForceApi(s.getApiConfig(),s);
Defining your Salesforce POJO Object (Model)
import org.codehaus.jackson.annotate.JsonIgnoreProperties;
import org.codehaus.jackson.annotate.JsonProperty;
@JsonIgnoreProperties(ignoreUnknown=true)
public class Account {
@JsonProperty(value="Id")
String id;
@JsonProperty(value="Name")
String name;
}
REST API Operations
• POST/GET: Query a List of SObjects
•

QueryResult<Account> res = api.query("SELECT id FROM Account
WHERE name LIKE 'Test account%'", Account.class);

• POST/GET: Get an SObject
•

Account res = api.getSObject("Account", "001D000000INjVe").as
(Account.class);

• POST: Create a new SObject
•

Account a = new Account();
a.setName("Test account");
String id = api.createSObject("account", a);
REST API Operations
• POST/PUT: Update an SObject when already exist
• api.createOrUpdateSObject("account",
existingAccount);

• DELETE: Delete an existing SObject
• api.deleteSObject("account”, “001D000000INjVe”);
Putting it all together
import com.force.api.ApiConfig;
import com.force.api.ForceApi;
import com.thysmichels.swagger4forcedotcom.models.Account;
public class Main {
private static final String USERNAME = ”username@email.com";
private static final String PASSWORDTOKEN = ”password+token”;
public static void main(String[] args) {
ForceApi api = new ForceApi(new ApiConfig().setUsername(USERNAME).setPassword(PASSWORDTOKEN));
Account a = new Account();
a.setName("Test account");
String id = api.createSObject("account", a);
a.setName("Updated Test Account");
api.updateSObject("account", id, a);
Account res = api.getSObject("Account",id).as(Account.class);
api.deleteSObject("account", res.getId());
}
}
Demo Salesforce REST API

Demo
Spring MVC vs Visualforce
• The Spring Web model-view-controller (MVC) framework is designed
around a DispatcherServlet that dispatches requests to:
• Model (POJO)
• View (JSP)
• Controller (@Controller and @RequestMapping annotation classes)
• Visualforce MVC
• Model (SObject, Apex Classes)
• View resolution (Pages/Components)
• Controller (Standard or Custom Apex classes)
Spring MVC Architecture
Spring MVC OAuth Login Service
• XML AnnotationConfiguration for setting up Salesforce OAuth:
<fss:oauth>
<fss:oauthInfo endpoint="http://login.salesforce.com"
oauth-key="#{systemEnvironment['OAUTH_CLIENT_KEY']}"
oauth-secret="#{systemEnvironment['OAUTH_CLIENT_SECRET']}"/>
</fss:oauth>
• Windows:
•

Set OAUTH_CLIENT_KEY=3MVM3_GuVCQ3gmEE5al72RmBfiAWhBX5O2wYc9zTZ8

•

Set OAUTH_CLIENT_SECRET=1319558946720906100

• Unix/Linux
•

Export OAUTH_CLIENT_KEY=3MVM3_GuVCQ3gmEE5al72RmBfiAWhBX5O2wYc9zTZ8

•

Export OAUTH_CLIENT_SECRET=1319558946720906100
Salesforce API Spring MVC Controller
@Controller
@RequestMapping(value = "/api/v1/account")
public class AccountController {
//Login to salesforce
@Autowired
LoginService loginService;
@RequestMapping(value = "/", method = RequestMethod.
GET, produces = "application/json")
public @ResponseBody List<Account> showAllAccounts() {
QueryResult<Account> res = loginService.getForceApi().query("SELECT Name FROM Account",
Account.class);
return res.getRecords();
}
}
Some Spring MVC Annotations
• @Controller - The @Controller annotation indicates that a particular class serves the
role of a controller.
• @RequestMapping - You use the @RequestMapping annotation to map URLs such as
/account onto an entire class or a particular handler method.
• @PathVariable - Access to URI template variables.
• @RequestParam - Access to specific Servlet request parameters.
Intro to Swagger
• Swagger is a specification and complete framework
implementation for describing, producing, consuming, and
visualizing RESTful web services.
• Company: http://Company: http://helloreverb.comCompany:
http://helloreverb.com/
• Link: httpsLink: https://developers.helloreverb.
com/swaggerLink: https://developers.helloreverb.
com/swagger/
• We will use Swagger to describe, produce, consume and
visualize our Force.com REST services.
Swagger Maven Dependency
• http://mvnrepository.com/artifact/com.
knappsack/swagger4spring-web/http://mvnrepository.
com/artifact/com.knappsack/swagger4spring-web/0.2.0
• Include Maven dependency to you project:
<dependency>
<groupId>com.knappsack</groupId>
<artifactId>swagger4spring-web</artifactId>
<version>0.2.0</version>
</dependency>
Swagger Base Controller
@Controller
@RequestMapping(value = "/api")
public class ApiController extends ApiDocumentationController {
public ApiController() {
setBaseControllerPackage("com.thysmichels.swagger4forcedotcom.controllers.api");
setBaseModelPackage("com.thysmichels.swagger4forcedotcom.model");
setApiVersion("v1");
}
@RequestMapping(value = "/", method = RequestMethod. ET)
G
public String documentation() {
return "api";
}
}
Swagger Base Annotations
• @basePath - optional - the base URL of your web application, for example http:
//localhost/swagger4spring-web-example
• @baseControllerPackage - optional - this is the package you want swagger4spring-web
to scan to look for classes annotated with @Controller.
• @baseModelPackage - optional - this is the package you want to scan if all your model
objects are in a specific directory.
• @apiVersion - required - this is the version of your API
Swagger Annotations
@Api – describe a RESTful API on a high level
@Api(value = "Account operations", listingClass =
"AccountController", basePath = "/api/v1/account", description =
"All operations for accounts")
Swagger Annotations
@ApiOperation – define a RESTful operation
•@ApiOperation(value = ”Get all accounts", notes = ”Get all account
(max: 200) ", httpMethod = "GET", responseClass = "Account",
multiValueResponse = true)
Swagger Annotations
@ApiError – define one error code
•@ApiError(code = 500, reason = "Process error")

@ApiErrors – define multiple error codes
•@ApiErrors(value = { @ApiError(code = 400, reason = "Invalid Id supplied"), @ApiError
(code = 404, reason = "Account not found") })
Swagger Annotations
@ApiParam– define path variables
•public @ResponseBody Account findAccountById
(@ApiParam(internalDescription = "java.lang.string",
name = "accountId", required = true, value = "string”)) {}
Putting it all together
@Controller
@RequestMapping(value = "/api/v1/account")
@Api(value = "Account operations", listingClass = "AccountController", basePath = "/api/v1/account",
description = "All operations for accounts")
public class AccountController {
@Autowired
AccountService accountService;
@ApiOperation(value = "Find all accounts", notes = "Get all account currently available",
httpMethod = "GET", responseClass = "Account", multiValueResponse = true)
@ApiError(code = 500, reason = "Process error")
@RequestMapping(value = "/", method = RequestMethod.
GET, produces = "application/json")
public @ResponseBody List<Account> showAllAccounts() {
return accountService.listAccounts();
}
}
Swagger JavaScript
function displaySwaggerDocuments() {
var url = '<c:url value="/api/resourceList"/>';
window.swaggerUi = new SwaggerUi({
discoveryUrl: url,
dom_id: "swagger-ui-container",
supportHeaderParams: false,
supportedSubmitMethods: ['get', 'post', 'put', 'delete'],
apiKey: "",
…
}
Invoking REST Endpoint
• Using curl
•

curl -H "Accept: application/json" -H "Content-type: application/json" -X POST -d
'{"name": "New Account Name"}' http://localhost:8080/api/v1/account

• Using Java
HttpClient client = new DefaultHttpClient();
HttpPost post = new HttpPost("http://localhost:8080/api/v1/account");
post.setEntity(new StringEntity("{"name": "New Account"}"));
post.setHeader("Accept", "application/json");
post.setHeader("Content-Type", "application/json");
HttpResponse response = client.execute(post);
Force.com REST Services with Swagger

Demo
Resources
• Heroku: Force.com Services using Swagger
• https://force-com-rest-swagger.herokuapp.com/

• GitHub: Repository
• https://github.com/thysmichels/force.com-swagger-rest-spring-mvcheroku

• Swagger Sample Projects
• https://https://github.comhttps://github.com/https://github.
com/wordnikhttps://github.com/wordnik/swaggercore/tree/master/samples
Thys Michels
Software Engineer,
@thysmichels
Exposing Salesforce REST Services Using Swagger

More Related Content

What's hot

The Architecture of an API Platform
The Architecture of an API PlatformThe Architecture of an API Platform
The Architecture of an API PlatformJohannes Ridderstedt
 
AWS Batch: Simplifying Batch Computing in the Cloud
AWS Batch: Simplifying Batch Computing in the CloudAWS Batch: Simplifying Batch Computing in the Cloud
AWS Batch: Simplifying Batch Computing in the CloudAmazon Web Services
 
Kong API Gateway
Kong API Gateway Kong API Gateway
Kong API Gateway Chris Mague
 
Api gateway : To be or not to be
Api gateway : To be or not to beApi gateway : To be or not to be
Api gateway : To be or not to beJaewoo Ahn
 
[REPEAT 1] Elastic Load Balancing: Deep Dive and Best Practices (NET404-R1) -...
[REPEAT 1] Elastic Load Balancing: Deep Dive and Best Practices (NET404-R1) -...[REPEAT 1] Elastic Load Balancing: Deep Dive and Best Practices (NET404-R1) -...
[REPEAT 1] Elastic Load Balancing: Deep Dive and Best Practices (NET404-R1) -...Amazon Web Services
 
Event-Driven Architecture (EDA)
Event-Driven Architecture (EDA)Event-Driven Architecture (EDA)
Event-Driven Architecture (EDA)WSO2
 
ASP.NET MVC Presentation
ASP.NET MVC PresentationASP.NET MVC Presentation
ASP.NET MVC PresentationVolkan Uzun
 
Advance C# Programming Part 1.pptx
Advance C# Programming Part 1.pptxAdvance C# Programming Part 1.pptx
Advance C# Programming Part 1.pptxpercivalfernandez3
 
Hybrid application development
Hybrid application developmentHybrid application development
Hybrid application developmentKnoldus Inc.
 
Salesforce Release Management - Best Practices and Tools for Deployment
Salesforce Release Management - Best Practices and Tools for DeploymentSalesforce Release Management - Best Practices and Tools for Deployment
Salesforce Release Management - Best Practices and Tools for DeploymentSalesforce Developers
 
Introduction to power apps
Introduction to power appsIntroduction to power apps
Introduction to power appsRezaDorrani1
 
ASP.NET MVC Presentation
ASP.NET MVC PresentationASP.NET MVC Presentation
ASP.NET MVC Presentationivpol
 
APIsecure 2023 - API orchestration: to build resilient applications, Cherish ...
APIsecure 2023 - API orchestration: to build resilient applications, Cherish ...APIsecure 2023 - API orchestration: to build resilient applications, Cherish ...
APIsecure 2023 - API orchestration: to build resilient applications, Cherish ...apidays
 
Module 5: AWS Elasticity and Management Tools - AWSome Day Online Conference
Module 5: AWS Elasticity and Management Tools - AWSome Day Online Conference Module 5: AWS Elasticity and Management Tools - AWSome Day Online Conference
Module 5: AWS Elasticity and Management Tools - AWSome Day Online Conference Amazon Web Services
 
Introducing ASP.NET Core 2.0
Introducing ASP.NET Core 2.0Introducing ASP.NET Core 2.0
Introducing ASP.NET Core 2.0Steven Smith
 
The People's Innovation Platform - Microsoft Power Platform
    The People's Innovation Platform - Microsoft Power Platform    The People's Innovation Platform - Microsoft Power Platform
The People's Innovation Platform - Microsoft Power PlatformKorcomptenz Inc
 
Hexagonal architecture with Spring Boot [EPAM Java online conference]
Hexagonal architecture with Spring Boot [EPAM Java online conference]Hexagonal architecture with Spring Boot [EPAM Java online conference]
Hexagonal architecture with Spring Boot [EPAM Java online conference]Mikalai Alimenkou
 
Oracle Apex Intoduction.pptx
Oracle Apex Intoduction.pptxOracle Apex Intoduction.pptx
Oracle Apex Intoduction.pptxAbhishekJha401
 
apidays Paris 2022 - Sustainable API Green Score, Yannick Tremblais (Groupe R...
apidays Paris 2022 - Sustainable API Green Score, Yannick Tremblais (Groupe R...apidays Paris 2022 - Sustainable API Green Score, Yannick Tremblais (Groupe R...
apidays Paris 2022 - Sustainable API Green Score, Yannick Tremblais (Groupe R...apidays
 

What's hot (20)

The Architecture of an API Platform
The Architecture of an API PlatformThe Architecture of an API Platform
The Architecture of an API Platform
 
AWS Batch: Simplifying Batch Computing in the Cloud
AWS Batch: Simplifying Batch Computing in the CloudAWS Batch: Simplifying Batch Computing in the Cloud
AWS Batch: Simplifying Batch Computing in the Cloud
 
Kong API Gateway
Kong API Gateway Kong API Gateway
Kong API Gateway
 
Api gateway : To be or not to be
Api gateway : To be or not to beApi gateway : To be or not to be
Api gateway : To be or not to be
 
[REPEAT 1] Elastic Load Balancing: Deep Dive and Best Practices (NET404-R1) -...
[REPEAT 1] Elastic Load Balancing: Deep Dive and Best Practices (NET404-R1) -...[REPEAT 1] Elastic Load Balancing: Deep Dive and Best Practices (NET404-R1) -...
[REPEAT 1] Elastic Load Balancing: Deep Dive and Best Practices (NET404-R1) -...
 
Event-Driven Architecture (EDA)
Event-Driven Architecture (EDA)Event-Driven Architecture (EDA)
Event-Driven Architecture (EDA)
 
ASP.NET MVC Presentation
ASP.NET MVC PresentationASP.NET MVC Presentation
ASP.NET MVC Presentation
 
Advance C# Programming Part 1.pptx
Advance C# Programming Part 1.pptxAdvance C# Programming Part 1.pptx
Advance C# Programming Part 1.pptx
 
Hybrid application development
Hybrid application developmentHybrid application development
Hybrid application development
 
Salesforce Release Management - Best Practices and Tools for Deployment
Salesforce Release Management - Best Practices and Tools for DeploymentSalesforce Release Management - Best Practices and Tools for Deployment
Salesforce Release Management - Best Practices and Tools for Deployment
 
Introduction to power apps
Introduction to power appsIntroduction to power apps
Introduction to power apps
 
ASP.NET MVC Presentation
ASP.NET MVC PresentationASP.NET MVC Presentation
ASP.NET MVC Presentation
 
APIsecure 2023 - API orchestration: to build resilient applications, Cherish ...
APIsecure 2023 - API orchestration: to build resilient applications, Cherish ...APIsecure 2023 - API orchestration: to build resilient applications, Cherish ...
APIsecure 2023 - API orchestration: to build resilient applications, Cherish ...
 
Module 5: AWS Elasticity and Management Tools - AWSome Day Online Conference
Module 5: AWS Elasticity and Management Tools - AWSome Day Online Conference Module 5: AWS Elasticity and Management Tools - AWSome Day Online Conference
Module 5: AWS Elasticity and Management Tools - AWSome Day Online Conference
 
Introducing ASP.NET Core 2.0
Introducing ASP.NET Core 2.0Introducing ASP.NET Core 2.0
Introducing ASP.NET Core 2.0
 
The People's Innovation Platform - Microsoft Power Platform
    The People's Innovation Platform - Microsoft Power Platform    The People's Innovation Platform - Microsoft Power Platform
The People's Innovation Platform - Microsoft Power Platform
 
Hexagonal architecture with Spring Boot [EPAM Java online conference]
Hexagonal architecture with Spring Boot [EPAM Java online conference]Hexagonal architecture with Spring Boot [EPAM Java online conference]
Hexagonal architecture with Spring Boot [EPAM Java online conference]
 
C sharp
C sharpC sharp
C sharp
 
Oracle Apex Intoduction.pptx
Oracle Apex Intoduction.pptxOracle Apex Intoduction.pptx
Oracle Apex Intoduction.pptx
 
apidays Paris 2022 - Sustainable API Green Score, Yannick Tremblais (Groupe R...
apidays Paris 2022 - Sustainable API Green Score, Yannick Tremblais (Groupe R...apidays Paris 2022 - Sustainable API Green Score, Yannick Tremblais (Groupe R...
apidays Paris 2022 - Sustainable API Green Score, Yannick Tremblais (Groupe R...
 

Viewers also liked

Building a Modular Server Platform with OSGi - Harshana Eranga Martin, Dileep...
Building a Modular Server Platform with OSGi - Harshana Eranga Martin, Dileep...Building a Modular Server Platform with OSGi - Harshana Eranga Martin, Dileep...
Building a Modular Server Platform with OSGi - Harshana Eranga Martin, Dileep...mfrancis
 
Continuous Integration, TDD & Living Documentation - Odoo Experience 2015
Continuous Integration, TDD & Living Documentation - Odoo Experience 2015Continuous Integration, TDD & Living Documentation - Odoo Experience 2015
Continuous Integration, TDD & Living Documentation - Odoo Experience 2015Colin Wren
 
Tour of Heroku + Salesforce Integration Methods
Tour of Heroku + Salesforce Integration MethodsTour of Heroku + Salesforce Integration Methods
Tour of Heroku + Salesforce Integration MethodsSalesforce Developers
 
Introduction to Building E-Commerce Solutions on Heroku and Salesforce
Introduction to Building E-Commerce Solutions on Heroku and SalesforceIntroduction to Building E-Commerce Solutions on Heroku and Salesforce
Introduction to Building E-Commerce Solutions on Heroku and SalesforceSalesforce Developers
 
AIL Platform APIDays Mediterranea
AIL Platform APIDays MediterraneaAIL Platform APIDays Mediterranea
AIL Platform APIDays MediterraneaJoan Protasio
 
Apex triggers, force_ide_and_deployment
Apex triggers, force_ide_and_deploymentApex triggers, force_ide_and_deployment
Apex triggers, force_ide_and_deploymentsubhajit0209
 
Introduction to Analytics Cloud
Introduction to Analytics CloudIntroduction to Analytics Cloud
Introduction to Analytics CloudMohith Shrivastava
 
Developing Salesforce Console Apps with Visualforce & the Integration Toolkit
Developing Salesforce Console Apps with Visualforce & the Integration ToolkitDeveloping Salesforce Console Apps with Visualforce & the Integration Toolkit
Developing Salesforce Console Apps with Visualforce & the Integration ToolkitAndrew Mahood
 
Customizing the Salesforce Console With the Integration Toolkit
Customizing the Salesforce Console With the Integration ToolkitCustomizing the Salesforce Console With the Integration Toolkit
Customizing the Salesforce Console With the Integration ToolkitSalesforce Developers
 
Salesforce API: Salesforce Console Deep Dive
Salesforce API: Salesforce Console Deep DiveSalesforce API: Salesforce Console Deep Dive
Salesforce API: Salesforce Console Deep DiveSalesforce Developers
 
A Tour of Swagger for APIs
A Tour of Swagger for APIsA Tour of Swagger for APIs
A Tour of Swagger for APIsAllen Dean
 
Salesforce Application Lifecycle Management presented to EA Forum by Sam Garf...
Salesforce Application Lifecycle Management presented to EA Forum by Sam Garf...Salesforce Application Lifecycle Management presented to EA Forum by Sam Garf...
Salesforce Application Lifecycle Management presented to EA Forum by Sam Garf...Sam Garforth
 
Triggers and order of execution1
Triggers and order of execution1Triggers and order of execution1
Triggers and order of execution1Prabhakar Sharma
 
Salesforce.com API Series: Service Cloud Console Deep Dive
Salesforce.com API Series: Service Cloud Console Deep DiveSalesforce.com API Series: Service Cloud Console Deep Dive
Salesforce.com API Series: Service Cloud Console Deep DiveSalesforce Developers
 
Best Practices for Team Development in a Single Org
Best Practices for Team Development in a Single OrgBest Practices for Team Development in a Single Org
Best Practices for Team Development in a Single OrgSalesforce Developers
 
Hybrid IT: The Importance of Integration to Salesforce Success
Hybrid IT: The Importance of Integration to Salesforce SuccessHybrid IT: The Importance of Integration to Salesforce Success
Hybrid IT: The Importance of Integration to Salesforce SuccessDarren Cunningham
 
APIs.JSON: Bootstrapping The Web of APIs
APIs.JSON: Bootstrapping The Web of APIsAPIs.JSON: Bootstrapping The Web of APIs
APIs.JSON: Bootstrapping The Web of APIs3scale
 
Salesforce implementation best practices
Salesforce implementation best practicesSalesforce implementation best practices
Salesforce implementation best practicesCloud for Good
 
The Ideal Salesforce Development Lifecycle
The Ideal Salesforce Development LifecycleThe Ideal Salesforce Development Lifecycle
The Ideal Salesforce Development LifecycleJoshua Hoskins
 
DF13 Salesforce Fundamentals: Strategy for Campaign and Lead Management
DF13 Salesforce Fundamentals: Strategy for Campaign and Lead ManagementDF13 Salesforce Fundamentals: Strategy for Campaign and Lead Management
DF13 Salesforce Fundamentals: Strategy for Campaign and Lead ManagementDeepa Patel
 

Viewers also liked (20)

Building a Modular Server Platform with OSGi - Harshana Eranga Martin, Dileep...
Building a Modular Server Platform with OSGi - Harshana Eranga Martin, Dileep...Building a Modular Server Platform with OSGi - Harshana Eranga Martin, Dileep...
Building a Modular Server Platform with OSGi - Harshana Eranga Martin, Dileep...
 
Continuous Integration, TDD & Living Documentation - Odoo Experience 2015
Continuous Integration, TDD & Living Documentation - Odoo Experience 2015Continuous Integration, TDD & Living Documentation - Odoo Experience 2015
Continuous Integration, TDD & Living Documentation - Odoo Experience 2015
 
Tour of Heroku + Salesforce Integration Methods
Tour of Heroku + Salesforce Integration MethodsTour of Heroku + Salesforce Integration Methods
Tour of Heroku + Salesforce Integration Methods
 
Introduction to Building E-Commerce Solutions on Heroku and Salesforce
Introduction to Building E-Commerce Solutions on Heroku and SalesforceIntroduction to Building E-Commerce Solutions on Heroku and Salesforce
Introduction to Building E-Commerce Solutions on Heroku and Salesforce
 
AIL Platform APIDays Mediterranea
AIL Platform APIDays MediterraneaAIL Platform APIDays Mediterranea
AIL Platform APIDays Mediterranea
 
Apex triggers, force_ide_and_deployment
Apex triggers, force_ide_and_deploymentApex triggers, force_ide_and_deployment
Apex triggers, force_ide_and_deployment
 
Introduction to Analytics Cloud
Introduction to Analytics CloudIntroduction to Analytics Cloud
Introduction to Analytics Cloud
 
Developing Salesforce Console Apps with Visualforce & the Integration Toolkit
Developing Salesforce Console Apps with Visualforce & the Integration ToolkitDeveloping Salesforce Console Apps with Visualforce & the Integration Toolkit
Developing Salesforce Console Apps with Visualforce & the Integration Toolkit
 
Customizing the Salesforce Console With the Integration Toolkit
Customizing the Salesforce Console With the Integration ToolkitCustomizing the Salesforce Console With the Integration Toolkit
Customizing the Salesforce Console With the Integration Toolkit
 
Salesforce API: Salesforce Console Deep Dive
Salesforce API: Salesforce Console Deep DiveSalesforce API: Salesforce Console Deep Dive
Salesforce API: Salesforce Console Deep Dive
 
A Tour of Swagger for APIs
A Tour of Swagger for APIsA Tour of Swagger for APIs
A Tour of Swagger for APIs
 
Salesforce Application Lifecycle Management presented to EA Forum by Sam Garf...
Salesforce Application Lifecycle Management presented to EA Forum by Sam Garf...Salesforce Application Lifecycle Management presented to EA Forum by Sam Garf...
Salesforce Application Lifecycle Management presented to EA Forum by Sam Garf...
 
Triggers and order of execution1
Triggers and order of execution1Triggers and order of execution1
Triggers and order of execution1
 
Salesforce.com API Series: Service Cloud Console Deep Dive
Salesforce.com API Series: Service Cloud Console Deep DiveSalesforce.com API Series: Service Cloud Console Deep Dive
Salesforce.com API Series: Service Cloud Console Deep Dive
 
Best Practices for Team Development in a Single Org
Best Practices for Team Development in a Single OrgBest Practices for Team Development in a Single Org
Best Practices for Team Development in a Single Org
 
Hybrid IT: The Importance of Integration to Salesforce Success
Hybrid IT: The Importance of Integration to Salesforce SuccessHybrid IT: The Importance of Integration to Salesforce Success
Hybrid IT: The Importance of Integration to Salesforce Success
 
APIs.JSON: Bootstrapping The Web of APIs
APIs.JSON: Bootstrapping The Web of APIsAPIs.JSON: Bootstrapping The Web of APIs
APIs.JSON: Bootstrapping The Web of APIs
 
Salesforce implementation best practices
Salesforce implementation best practicesSalesforce implementation best practices
Salesforce implementation best practices
 
The Ideal Salesforce Development Lifecycle
The Ideal Salesforce Development LifecycleThe Ideal Salesforce Development Lifecycle
The Ideal Salesforce Development Lifecycle
 
DF13 Salesforce Fundamentals: Strategy for Campaign and Lead Management
DF13 Salesforce Fundamentals: Strategy for Campaign and Lead ManagementDF13 Salesforce Fundamentals: Strategy for Campaign and Lead Management
DF13 Salesforce Fundamentals: Strategy for Campaign and Lead Management
 

Similar to Exposing Salesforce REST Services Using Swagger

Using Apache as an Application Server
Using Apache as an Application ServerUsing Apache as an Application Server
Using Apache as an Application ServerPhil Windley
 
Design Summit - RESTful API Overview - John Hardy
Design Summit - RESTful API Overview - John HardyDesign Summit - RESTful API Overview - John Hardy
Design Summit - RESTful API Overview - John HardyManageIQ
 
Software as a Service workshop / Unlocked: the Hybrid Cloud 12th May 2014
Software as a Service workshop / Unlocked: the Hybrid Cloud 12th May 2014Software as a Service workshop / Unlocked: the Hybrid Cloud 12th May 2014
Software as a Service workshop / Unlocked: the Hybrid Cloud 12th May 2014Rackspace Academy
 
Araport Workshop Tutorial 2: Authentication and the Agave Profiles Service
Araport Workshop Tutorial 2: Authentication and the Agave Profiles ServiceAraport Workshop Tutorial 2: Authentication and the Agave Profiles Service
Araport Workshop Tutorial 2: Authentication and the Agave Profiles Servicestevemock
 
Building microservices sample application
Building microservices sample applicationBuilding microservices sample application
Building microservices sample applicationAnil Allewar
 
REST API Security: OAuth 2.0, JWTs, and More!
REST API Security: OAuth 2.0, JWTs, and More!REST API Security: OAuth 2.0, JWTs, and More!
REST API Security: OAuth 2.0, JWTs, and More!Stormpath
 
Automating Your Azure Environment
Automating Your Azure EnvironmentAutomating Your Azure Environment
Automating Your Azure EnvironmentMichael Collier
 
Azure Resource Manager - Technical Primer
Azure Resource Manager - Technical PrimerAzure Resource Manager - Technical Primer
Azure Resource Manager - Technical PrimerBen Coleman
 
Migrate your Existing Express Apps to AWS Lambda and Amazon API Gateway
Migrate your Existing Express Apps to AWS Lambda and Amazon API GatewayMigrate your Existing Express Apps to AWS Lambda and Amazon API Gateway
Migrate your Existing Express Apps to AWS Lambda and Amazon API GatewayAmazon Web Services
 
Continuous Integration e Delivery per (r)innovare lo sviluppo software e la g...
Continuous Integration e Delivery per (r)innovare lo sviluppo software e la g...Continuous Integration e Delivery per (r)innovare lo sviluppo software e la g...
Continuous Integration e Delivery per (r)innovare lo sviluppo software e la g...Amazon Web Services
 
SFDC Inbound Integrations
SFDC Inbound IntegrationsSFDC Inbound Integrations
SFDC Inbound IntegrationsSujit Kumar
 
ContainerCon 2015 - Be a Microservices Hero
ContainerCon 2015 - Be a Microservices HeroContainerCon 2015 - Be a Microservices Hero
ContainerCon 2015 - Be a Microservices HeroDragos Dascalita
 
Chris O'Brien - Best bits of Azure for Office 365/SharePoint developers
Chris O'Brien - Best bits of Azure for Office 365/SharePoint developersChris O'Brien - Best bits of Azure for Office 365/SharePoint developers
Chris O'Brien - Best bits of Azure for Office 365/SharePoint developersChris O'Brien
 
Azure Day Reloaded 2019 - ARM Template workshop
Azure Day Reloaded 2019 - ARM Template workshopAzure Day Reloaded 2019 - ARM Template workshop
Azure Day Reloaded 2019 - ARM Template workshopMarco Obinu
 
AWS Summit Barcelona 2015 - Introducing Amazon API Gateway
AWS Summit Barcelona 2015 - Introducing Amazon API GatewayAWS Summit Barcelona 2015 - Introducing Amazon API Gateway
AWS Summit Barcelona 2015 - Introducing Amazon API GatewayVadim Zendejas
 

Similar to Exposing Salesforce REST Services Using Swagger (20)

Using Apache as an Application Server
Using Apache as an Application ServerUsing Apache as an Application Server
Using Apache as an Application Server
 
MesosCon - Be a microservices hero
MesosCon - Be a microservices heroMesosCon - Be a microservices hero
MesosCon - Be a microservices hero
 
CloudStack EC2 Configuration
CloudStack EC2 ConfigurationCloudStack EC2 Configuration
CloudStack EC2 Configuration
 
Owin and katana
Owin and katanaOwin and katana
Owin and katana
 
Design Summit - RESTful API Overview - John Hardy
Design Summit - RESTful API Overview - John HardyDesign Summit - RESTful API Overview - John Hardy
Design Summit - RESTful API Overview - John Hardy
 
Software as a Service workshop / Unlocked: the Hybrid Cloud 12th May 2014
Software as a Service workshop / Unlocked: the Hybrid Cloud 12th May 2014Software as a Service workshop / Unlocked: the Hybrid Cloud 12th May 2014
Software as a Service workshop / Unlocked: the Hybrid Cloud 12th May 2014
 
Araport Workshop Tutorial 2: Authentication and the Agave Profiles Service
Araport Workshop Tutorial 2: Authentication and the Agave Profiles ServiceAraport Workshop Tutorial 2: Authentication and the Agave Profiles Service
Araport Workshop Tutorial 2: Authentication and the Agave Profiles Service
 
Building microservices sample application
Building microservices sample applicationBuilding microservices sample application
Building microservices sample application
 
REST API Security: OAuth 2.0, JWTs, and More!
REST API Security: OAuth 2.0, JWTs, and More!REST API Security: OAuth 2.0, JWTs, and More!
REST API Security: OAuth 2.0, JWTs, and More!
 
Automating Your Azure Environment
Automating Your Azure EnvironmentAutomating Your Azure Environment
Automating Your Azure Environment
 
Azure Resource Manager - Technical Primer
Azure Resource Manager - Technical PrimerAzure Resource Manager - Technical Primer
Azure Resource Manager - Technical Primer
 
Migrate your Existing Express Apps to AWS Lambda and Amazon API Gateway
Migrate your Existing Express Apps to AWS Lambda and Amazon API GatewayMigrate your Existing Express Apps to AWS Lambda and Amazon API Gateway
Migrate your Existing Express Apps to AWS Lambda and Amazon API Gateway
 
Continuous Integration e Delivery per (r)innovare lo sviluppo software e la g...
Continuous Integration e Delivery per (r)innovare lo sviluppo software e la g...Continuous Integration e Delivery per (r)innovare lo sviluppo software e la g...
Continuous Integration e Delivery per (r)innovare lo sviluppo software e la g...
 
SFDC Inbound Integrations
SFDC Inbound IntegrationsSFDC Inbound Integrations
SFDC Inbound Integrations
 
ContainerCon 2015 - Be a Microservices Hero
ContainerCon 2015 - Be a Microservices HeroContainerCon 2015 - Be a Microservices Hero
ContainerCon 2015 - Be a Microservices Hero
 
Palestra VCR
Palestra VCRPalestra VCR
Palestra VCR
 
Chris O'Brien - Best bits of Azure for Office 365/SharePoint developers
Chris O'Brien - Best bits of Azure for Office 365/SharePoint developersChris O'Brien - Best bits of Azure for Office 365/SharePoint developers
Chris O'Brien - Best bits of Azure for Office 365/SharePoint developers
 
Azure Day Reloaded 2019 - ARM Template workshop
Azure Day Reloaded 2019 - ARM Template workshopAzure Day Reloaded 2019 - ARM Template workshop
Azure Day Reloaded 2019 - ARM Template workshop
 
Workshop: We love APIs
Workshop: We love APIsWorkshop: We love APIs
Workshop: We love APIs
 
AWS Summit Barcelona 2015 - Introducing Amazon API Gateway
AWS Summit Barcelona 2015 - Introducing Amazon API GatewayAWS Summit Barcelona 2015 - Introducing Amazon API Gateway
AWS Summit Barcelona 2015 - Introducing Amazon API Gateway
 

More from Salesforce Developers

Sample Gallery: Reference Code and Best Practices for Salesforce Developers
Sample Gallery: Reference Code and Best Practices for Salesforce DevelopersSample Gallery: Reference Code and Best Practices for Salesforce Developers
Sample Gallery: Reference Code and Best Practices for Salesforce DevelopersSalesforce Developers
 
Maximizing Salesforce Lightning Experience and Lightning Component Performance
Maximizing Salesforce Lightning Experience and Lightning Component PerformanceMaximizing Salesforce Lightning Experience and Lightning Component Performance
Maximizing Salesforce Lightning Experience and Lightning Component PerformanceSalesforce Developers
 
Local development with Open Source Base Components
Local development with Open Source Base ComponentsLocal development with Open Source Base Components
Local development with Open Source Base ComponentsSalesforce Developers
 
TrailheaDX India : Developer Highlights
TrailheaDX India : Developer HighlightsTrailheaDX India : Developer Highlights
TrailheaDX India : Developer HighlightsSalesforce Developers
 
Why developers shouldn’t miss TrailheaDX India
Why developers shouldn’t miss TrailheaDX IndiaWhy developers shouldn’t miss TrailheaDX India
Why developers shouldn’t miss TrailheaDX IndiaSalesforce Developers
 
CodeLive: Build Lightning Web Components faster with Local Development
CodeLive: Build Lightning Web Components faster with Local DevelopmentCodeLive: Build Lightning Web Components faster with Local Development
CodeLive: Build Lightning Web Components faster with Local DevelopmentSalesforce Developers
 
CodeLive: Converting Aura Components to Lightning Web Components
CodeLive: Converting Aura Components to Lightning Web ComponentsCodeLive: Converting Aura Components to Lightning Web Components
CodeLive: Converting Aura Components to Lightning Web ComponentsSalesforce Developers
 
Enterprise-grade UI with open source Lightning Web Components
Enterprise-grade UI with open source Lightning Web ComponentsEnterprise-grade UI with open source Lightning Web Components
Enterprise-grade UI with open source Lightning Web ComponentsSalesforce Developers
 
TrailheaDX and Summer '19: Developer Highlights
TrailheaDX and Summer '19: Developer HighlightsTrailheaDX and Summer '19: Developer Highlights
TrailheaDX and Summer '19: Developer HighlightsSalesforce Developers
 
Lightning web components - Episode 4 : Security and Testing
Lightning web components  - Episode 4 : Security and TestingLightning web components  - Episode 4 : Security and Testing
Lightning web components - Episode 4 : Security and TestingSalesforce Developers
 
LWC Episode 3- Component Communication and Aura Interoperability
LWC Episode 3- Component Communication and Aura InteroperabilityLWC Episode 3- Component Communication and Aura Interoperability
LWC Episode 3- Component Communication and Aura InteroperabilitySalesforce Developers
 
Lightning web components episode 2- work with salesforce data
Lightning web components   episode 2- work with salesforce dataLightning web components   episode 2- work with salesforce data
Lightning web components episode 2- work with salesforce dataSalesforce Developers
 
Lightning web components - Episode 1 - An Introduction
Lightning web components - Episode 1 - An IntroductionLightning web components - Episode 1 - An Introduction
Lightning web components - Episode 1 - An IntroductionSalesforce Developers
 
Migrating CPQ to Advanced Calculator and JSQCP
Migrating CPQ to Advanced Calculator and JSQCPMigrating CPQ to Advanced Calculator and JSQCP
Migrating CPQ to Advanced Calculator and JSQCPSalesforce Developers
 
Scale with Large Data Volumes and Big Objects in Salesforce
Scale with Large Data Volumes and Big Objects in SalesforceScale with Large Data Volumes and Big Objects in Salesforce
Scale with Large Data Volumes and Big Objects in SalesforceSalesforce Developers
 
Replicate Salesforce Data in Real Time with Change Data Capture
Replicate Salesforce Data in Real Time with Change Data CaptureReplicate Salesforce Data in Real Time with Change Data Capture
Replicate Salesforce Data in Real Time with Change Data CaptureSalesforce Developers
 
Modern Development with Salesforce DX
Modern Development with Salesforce DXModern Development with Salesforce DX
Modern Development with Salesforce DXSalesforce Developers
 
Integrate CMS Content Into Lightning Communities with CMS Connect
Integrate CMS Content Into Lightning Communities with CMS ConnectIntegrate CMS Content Into Lightning Communities with CMS Connect
Integrate CMS Content Into Lightning Communities with CMS ConnectSalesforce Developers
 

More from Salesforce Developers (20)

Sample Gallery: Reference Code and Best Practices for Salesforce Developers
Sample Gallery: Reference Code and Best Practices for Salesforce DevelopersSample Gallery: Reference Code and Best Practices for Salesforce Developers
Sample Gallery: Reference Code and Best Practices for Salesforce Developers
 
Maximizing Salesforce Lightning Experience and Lightning Component Performance
Maximizing Salesforce Lightning Experience and Lightning Component PerformanceMaximizing Salesforce Lightning Experience and Lightning Component Performance
Maximizing Salesforce Lightning Experience and Lightning Component Performance
 
Local development with Open Source Base Components
Local development with Open Source Base ComponentsLocal development with Open Source Base Components
Local development with Open Source Base Components
 
TrailheaDX India : Developer Highlights
TrailheaDX India : Developer HighlightsTrailheaDX India : Developer Highlights
TrailheaDX India : Developer Highlights
 
Why developers shouldn’t miss TrailheaDX India
Why developers shouldn’t miss TrailheaDX IndiaWhy developers shouldn’t miss TrailheaDX India
Why developers shouldn’t miss TrailheaDX India
 
CodeLive: Build Lightning Web Components faster with Local Development
CodeLive: Build Lightning Web Components faster with Local DevelopmentCodeLive: Build Lightning Web Components faster with Local Development
CodeLive: Build Lightning Web Components faster with Local Development
 
CodeLive: Converting Aura Components to Lightning Web Components
CodeLive: Converting Aura Components to Lightning Web ComponentsCodeLive: Converting Aura Components to Lightning Web Components
CodeLive: Converting Aura Components to Lightning Web Components
 
Enterprise-grade UI with open source Lightning Web Components
Enterprise-grade UI with open source Lightning Web ComponentsEnterprise-grade UI with open source Lightning Web Components
Enterprise-grade UI with open source Lightning Web Components
 
TrailheaDX and Summer '19: Developer Highlights
TrailheaDX and Summer '19: Developer HighlightsTrailheaDX and Summer '19: Developer Highlights
TrailheaDX and Summer '19: Developer Highlights
 
Live coding with LWC
Live coding with LWCLive coding with LWC
Live coding with LWC
 
Lightning web components - Episode 4 : Security and Testing
Lightning web components  - Episode 4 : Security and TestingLightning web components  - Episode 4 : Security and Testing
Lightning web components - Episode 4 : Security and Testing
 
LWC Episode 3- Component Communication and Aura Interoperability
LWC Episode 3- Component Communication and Aura InteroperabilityLWC Episode 3- Component Communication and Aura Interoperability
LWC Episode 3- Component Communication and Aura Interoperability
 
Lightning web components episode 2- work with salesforce data
Lightning web components   episode 2- work with salesforce dataLightning web components   episode 2- work with salesforce data
Lightning web components episode 2- work with salesforce data
 
Lightning web components - Episode 1 - An Introduction
Lightning web components - Episode 1 - An IntroductionLightning web components - Episode 1 - An Introduction
Lightning web components - Episode 1 - An Introduction
 
Migrating CPQ to Advanced Calculator and JSQCP
Migrating CPQ to Advanced Calculator and JSQCPMigrating CPQ to Advanced Calculator and JSQCP
Migrating CPQ to Advanced Calculator and JSQCP
 
Scale with Large Data Volumes and Big Objects in Salesforce
Scale with Large Data Volumes and Big Objects in SalesforceScale with Large Data Volumes and Big Objects in Salesforce
Scale with Large Data Volumes and Big Objects in Salesforce
 
Replicate Salesforce Data in Real Time with Change Data Capture
Replicate Salesforce Data in Real Time with Change Data CaptureReplicate Salesforce Data in Real Time with Change Data Capture
Replicate Salesforce Data in Real Time with Change Data Capture
 
Modern Development with Salesforce DX
Modern Development with Salesforce DXModern Development with Salesforce DX
Modern Development with Salesforce DX
 
Get Into Lightning Flow Development
Get Into Lightning Flow DevelopmentGet Into Lightning Flow Development
Get Into Lightning Flow Development
 
Integrate CMS Content Into Lightning Communities with CMS Connect
Integrate CMS Content Into Lightning Communities with CMS ConnectIntegrate CMS Content Into Lightning Communities with CMS Connect
Integrate CMS Content Into Lightning Communities with CMS Connect
 

Recently uploaded

Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 

Recently uploaded (20)

Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 

Exposing Salesforce REST Services Using Swagger

  • 1. Exposing Salesforce REST Services using Swagger Visualizing your REST Services Thys Michels, Lending Club, Software Engineer @thysmichels
  • 2. Agenda ▪ Objective ▪ Introduction and defining REST endpoints ▪ Force.com REST APIs ▪ Demo REST API ▪ Spring MVC with Swagger Annotations ▪ Demo Spring MVC with Swagger ▪ Resources ▪ Q&A
  • 3. Objective • Review the basics of REST • Showcase a Force.com REST API implementation • Compare different Force.com REST APIs • Develop a Force.com RESTful Service using Swagger
  • 4. What is REST • REpresentational State Transfer • An architecture style for designing distributed systems • Not a standard, rather a set of patterns: • Client/Server, Stateless, Uniform interface, etc. • Not tied to HTTP, but associated most commonly with it.
  • 5. HTTP’s Uniform Interface • URI’s identify resources • HTTP verbs describe a limited set of operations that can be used to manipulate a resource • GET • DELETE • PUT • POST • Headers help describe the messages
  • 6. Defining a REST Endpoint What does this endpoint mean to a developer, tester or any consumer: /accounts What does the endpoint tell us?
  • 7. Defining a REST Endpoint (2) Endpoint Description: Operation Descriptions /account Operations: GET POST PUT DELETE Error Codes: Validation Input: Parameter Values Form Values JSON Format Header information Return formats
  • 8. Salesforce REST APIs • https://github.com/jesperfj/force-rest-https://github.com/jesperfj/force-restapi • Developer: Jesper Joergensen • Lightweight library for building Force.com apps with OAuth authentication and data access through the Force.com REST API. • https://github.com/ryanbrainard/force-rest-https://github. com/ryanbrainard/force-rest-api • Developer: Ryan Brainard • Forked version of Jasper Joergensen project • Caching enhancements • Available in Maven Central
  • 9. Force.com REST API Maven dependency <repositories> <repository> <id>force-rest-api</id> <name>force-rest-api repository on GitHub</name> <url>http://jesperfj.github.com/force-rest-api/repository/</url> </repository> </repositories> <dependency> <groupId>com.force.api</groupId> <artifactId>force-rest-api</artifactId> <version>0.0.19</version> </dependency>
  • 10. Authenticating to Salesforce • Using Username and Password • For backend application where only server authentication is needed: ForceApi api = new ForceApi(new ApiConfig() .setUsername("user@domain.com") .setPassword("password+token")); • Using OAuth Username and Password • Front end application where user authentication is needed: ForceApi api = new ForceApi(new ApiConfig() .setUsername("user@domain.com") .setPassword("password") .setClientId("longclientidalphanumstring") .setClientSecret("notsolongnumeric"));
  • 11. OAuth Web Server Flow String url = Auth.startOAuthWebServerFlow(new AuthorizationRequest() .apiConfig(new ApiConfig() .setClientId("longclientidalphanumstring") .setRedirectURI("https://myapp.mydomain.com/oauth")) .state("mystate")); ApiSession s = Auth.completeOAuthWebServerFlow(new AuthorizationResponse() .apiConfig(new ApiConfig() .setClientId("longclientidalphanumstring") .setClientSecret("notsolongnumeric") .setRedirectURI("https://myapp.mydomain.com/oauth")) .code("alphanumericstringpassedbackinbrowserrequest")); ForceApi api = new ForceApi(s.getApiConfig(),s);
  • 12. Defining your Salesforce POJO Object (Model) import org.codehaus.jackson.annotate.JsonIgnoreProperties; import org.codehaus.jackson.annotate.JsonProperty; @JsonIgnoreProperties(ignoreUnknown=true) public class Account { @JsonProperty(value="Id") String id; @JsonProperty(value="Name") String name; }
  • 13. REST API Operations • POST/GET: Query a List of SObjects • QueryResult<Account> res = api.query("SELECT id FROM Account WHERE name LIKE 'Test account%'", Account.class); • POST/GET: Get an SObject • Account res = api.getSObject("Account", "001D000000INjVe").as (Account.class); • POST: Create a new SObject • Account a = new Account(); a.setName("Test account"); String id = api.createSObject("account", a);
  • 14. REST API Operations • POST/PUT: Update an SObject when already exist • api.createOrUpdateSObject("account", existingAccount); • DELETE: Delete an existing SObject • api.deleteSObject("account”, “001D000000INjVe”);
  • 15. Putting it all together import com.force.api.ApiConfig; import com.force.api.ForceApi; import com.thysmichels.swagger4forcedotcom.models.Account; public class Main { private static final String USERNAME = ”username@email.com"; private static final String PASSWORDTOKEN = ”password+token”; public static void main(String[] args) { ForceApi api = new ForceApi(new ApiConfig().setUsername(USERNAME).setPassword(PASSWORDTOKEN)); Account a = new Account(); a.setName("Test account"); String id = api.createSObject("account", a); a.setName("Updated Test Account"); api.updateSObject("account", id, a); Account res = api.getSObject("Account",id).as(Account.class); api.deleteSObject("account", res.getId()); } }
  • 17. Spring MVC vs Visualforce • The Spring Web model-view-controller (MVC) framework is designed around a DispatcherServlet that dispatches requests to: • Model (POJO) • View (JSP) • Controller (@Controller and @RequestMapping annotation classes) • Visualforce MVC • Model (SObject, Apex Classes) • View resolution (Pages/Components) • Controller (Standard or Custom Apex classes)
  • 19. Spring MVC OAuth Login Service • XML AnnotationConfiguration for setting up Salesforce OAuth: <fss:oauth> <fss:oauthInfo endpoint="http://login.salesforce.com" oauth-key="#{systemEnvironment['OAUTH_CLIENT_KEY']}" oauth-secret="#{systemEnvironment['OAUTH_CLIENT_SECRET']}"/> </fss:oauth> • Windows: • Set OAUTH_CLIENT_KEY=3MVM3_GuVCQ3gmEE5al72RmBfiAWhBX5O2wYc9zTZ8 • Set OAUTH_CLIENT_SECRET=1319558946720906100 • Unix/Linux • Export OAUTH_CLIENT_KEY=3MVM3_GuVCQ3gmEE5al72RmBfiAWhBX5O2wYc9zTZ8 • Export OAUTH_CLIENT_SECRET=1319558946720906100
  • 20. Salesforce API Spring MVC Controller @Controller @RequestMapping(value = "/api/v1/account") public class AccountController { //Login to salesforce @Autowired LoginService loginService; @RequestMapping(value = "/", method = RequestMethod. GET, produces = "application/json") public @ResponseBody List<Account> showAllAccounts() { QueryResult<Account> res = loginService.getForceApi().query("SELECT Name FROM Account", Account.class); return res.getRecords(); } }
  • 21. Some Spring MVC Annotations • @Controller - The @Controller annotation indicates that a particular class serves the role of a controller. • @RequestMapping - You use the @RequestMapping annotation to map URLs such as /account onto an entire class or a particular handler method. • @PathVariable - Access to URI template variables. • @RequestParam - Access to specific Servlet request parameters.
  • 22. Intro to Swagger • Swagger is a specification and complete framework implementation for describing, producing, consuming, and visualizing RESTful web services. • Company: http://Company: http://helloreverb.comCompany: http://helloreverb.com/ • Link: httpsLink: https://developers.helloreverb. com/swaggerLink: https://developers.helloreverb. com/swagger/ • We will use Swagger to describe, produce, consume and visualize our Force.com REST services.
  • 23. Swagger Maven Dependency • http://mvnrepository.com/artifact/com. knappsack/swagger4spring-web/http://mvnrepository. com/artifact/com.knappsack/swagger4spring-web/0.2.0 • Include Maven dependency to you project: <dependency> <groupId>com.knappsack</groupId> <artifactId>swagger4spring-web</artifactId> <version>0.2.0</version> </dependency>
  • 24. Swagger Base Controller @Controller @RequestMapping(value = "/api") public class ApiController extends ApiDocumentationController { public ApiController() { setBaseControllerPackage("com.thysmichels.swagger4forcedotcom.controllers.api"); setBaseModelPackage("com.thysmichels.swagger4forcedotcom.model"); setApiVersion("v1"); } @RequestMapping(value = "/", method = RequestMethod. ET) G public String documentation() { return "api"; } }
  • 25. Swagger Base Annotations • @basePath - optional - the base URL of your web application, for example http: //localhost/swagger4spring-web-example • @baseControllerPackage - optional - this is the package you want swagger4spring-web to scan to look for classes annotated with @Controller. • @baseModelPackage - optional - this is the package you want to scan if all your model objects are in a specific directory. • @apiVersion - required - this is the version of your API
  • 26. Swagger Annotations @Api – describe a RESTful API on a high level @Api(value = "Account operations", listingClass = "AccountController", basePath = "/api/v1/account", description = "All operations for accounts")
  • 27. Swagger Annotations @ApiOperation – define a RESTful operation •@ApiOperation(value = ”Get all accounts", notes = ”Get all account (max: 200) ", httpMethod = "GET", responseClass = "Account", multiValueResponse = true)
  • 28. Swagger Annotations @ApiError – define one error code •@ApiError(code = 500, reason = "Process error") @ApiErrors – define multiple error codes •@ApiErrors(value = { @ApiError(code = 400, reason = "Invalid Id supplied"), @ApiError (code = 404, reason = "Account not found") })
  • 29. Swagger Annotations @ApiParam– define path variables •public @ResponseBody Account findAccountById (@ApiParam(internalDescription = "java.lang.string", name = "accountId", required = true, value = "string”)) {}
  • 30. Putting it all together @Controller @RequestMapping(value = "/api/v1/account") @Api(value = "Account operations", listingClass = "AccountController", basePath = "/api/v1/account", description = "All operations for accounts") public class AccountController { @Autowired AccountService accountService; @ApiOperation(value = "Find all accounts", notes = "Get all account currently available", httpMethod = "GET", responseClass = "Account", multiValueResponse = true) @ApiError(code = 500, reason = "Process error") @RequestMapping(value = "/", method = RequestMethod. GET, produces = "application/json") public @ResponseBody List<Account> showAllAccounts() { return accountService.listAccounts(); } }
  • 31. Swagger JavaScript function displaySwaggerDocuments() { var url = '<c:url value="/api/resourceList"/>'; window.swaggerUi = new SwaggerUi({ discoveryUrl: url, dom_id: "swagger-ui-container", supportHeaderParams: false, supportedSubmitMethods: ['get', 'post', 'put', 'delete'], apiKey: "", … }
  • 32. Invoking REST Endpoint • Using curl • curl -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"name": "New Account Name"}' http://localhost:8080/api/v1/account • Using Java HttpClient client = new DefaultHttpClient(); HttpPost post = new HttpPost("http://localhost:8080/api/v1/account"); post.setEntity(new StringEntity("{"name": "New Account"}")); post.setHeader("Accept", "application/json"); post.setHeader("Content-Type", "application/json"); HttpResponse response = client.execute(post);
  • 33. Force.com REST Services with Swagger Demo
  • 34. Resources • Heroku: Force.com Services using Swagger • https://force-com-rest-swagger.herokuapp.com/ • GitHub: Repository • https://github.com/thysmichels/force.com-swagger-rest-spring-mvcheroku • Swagger Sample Projects • https://https://github.comhttps://github.com/https://github. com/wordnikhttps://github.com/wordnik/swaggercore/tree/master/samples