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

Getting started with Salesforce security
Getting started with Salesforce securityGetting started with Salesforce security
Getting started with Salesforce securitySalesforce Admins
 
Salesforce integration best practices columbus meetup
Salesforce integration best practices   columbus meetupSalesforce integration best practices   columbus meetup
Salesforce integration best practices columbus meetupMuleSoft Meetup
 
Apache Superset - open source data exploration and visualization (Conclusion ...
Apache Superset - open source data exploration and visualization (Conclusion ...Apache Superset - open source data exploration and visualization (Conclusion ...
Apache Superset - open source data exploration and visualization (Conclusion ...Lucas Jellema
 
Best Practices with Apex in 2022.pdf
Best Practices with Apex in 2022.pdfBest Practices with Apex in 2022.pdf
Best Practices with Apex in 2022.pdfMohith Shrivastava
 
Exposing services with Azure API Management
Exposing services with Azure API ManagementExposing services with Azure API Management
Exposing services with Azure API ManagementCallon Campbell
 
SharePoint Overview
SharePoint OverviewSharePoint Overview
SharePoint OverviewAmy Phillips
 
OpenID Connect and Single Sign-On for Beginners
OpenID Connect and Single Sign-On for BeginnersOpenID Connect and Single Sign-On for Beginners
OpenID Connect and Single Sign-On for BeginnersSalesforce Developers
 
Salesforce administrator training presentation slides
Salesforce administrator training presentation slides Salesforce administrator training presentation slides
Salesforce administrator training presentation slides Salesforce Associates
 
Salesforce Org Health Check & Performance Testing
Salesforce Org Health Check & Performance TestingSalesforce Org Health Check & Performance Testing
Salesforce Org Health Check & Performance TestingImtiazBinMohiuddin
 
Securing Team, SharePoint, and OneDrive in Microsoft 365 - M365VM
Securing Team, SharePoint, and OneDrive in Microsoft 365 - M365VMSecuring Team, SharePoint, and OneDrive in Microsoft 365 - M365VM
Securing Team, SharePoint, and OneDrive in Microsoft 365 - M365VMDrew Madelung
 
Understanding the Salesforce Architecture: How We Do the Magic We Do
Understanding the Salesforce Architecture: How We Do the Magic We DoUnderstanding the Salesforce Architecture: How We Do the Magic We Do
Understanding the Salesforce Architecture: How We Do the Magic We DoSalesforce Developers
 
Implement an enterprise service bus revised
Implement an enterprise service bus    revisedImplement an enterprise service bus    revised
Implement an enterprise service bus revisedInfo-Tech Research Group
 
Salesforce Security Model (Dmitry Goshko, Igor Haritonovich)
Salesforce Security Model (Dmitry Goshko, Igor Haritonovich)Salesforce Security Model (Dmitry Goshko, Igor Haritonovich)
Salesforce Security Model (Dmitry Goshko, Igor Haritonovich)Yury Bondarau
 
DevOps in Salesforce AppCloud
DevOps in Salesforce AppCloudDevOps in Salesforce AppCloud
DevOps in Salesforce AppCloudrsg00usa
 
Sharing and security in Salesforce
Sharing and security in SalesforceSharing and security in Salesforce
Sharing and security in SalesforceSaurabh Kulkarni
 
Migrate to Microsoft Azure with Confidence
Migrate to Microsoft Azure with ConfidenceMigrate to Microsoft Azure with Confidence
Migrate to Microsoft Azure with ConfidenceDavid J Rosenthal
 
Labelling in Microsoft 365 - Retention & Sensitivity
Labelling in Microsoft 365 - Retention & SensitivityLabelling in Microsoft 365 - Retention & Sensitivity
Labelling in Microsoft 365 - Retention & SensitivityDrew Madelung
 
Site reliability engineering
Site reliability engineeringSite reliability engineering
Site reliability engineeringJason Loeffler
 

What's hot (20)

Azure purview
Azure purviewAzure purview
Azure purview
 
Getting started with Salesforce security
Getting started with Salesforce securityGetting started with Salesforce security
Getting started with Salesforce security
 
Salesforce integration best practices columbus meetup
Salesforce integration best practices   columbus meetupSalesforce integration best practices   columbus meetup
Salesforce integration best practices columbus meetup
 
Apache Superset - open source data exploration and visualization (Conclusion ...
Apache Superset - open source data exploration and visualization (Conclusion ...Apache Superset - open source data exploration and visualization (Conclusion ...
Apache Superset - open source data exploration and visualization (Conclusion ...
 
Best Practices with Apex in 2022.pdf
Best Practices with Apex in 2022.pdfBest Practices with Apex in 2022.pdf
Best Practices with Apex in 2022.pdf
 
Exposing services with Azure API Management
Exposing services with Azure API ManagementExposing services with Azure API Management
Exposing services with Azure API Management
 
SharePoint Overview
SharePoint OverviewSharePoint Overview
SharePoint Overview
 
Salesforce static code analysis
Salesforce static code analysisSalesforce static code analysis
Salesforce static code analysis
 
OpenID Connect and Single Sign-On for Beginners
OpenID Connect and Single Sign-On for BeginnersOpenID Connect and Single Sign-On for Beginners
OpenID Connect and Single Sign-On for Beginners
 
Salesforce administrator training presentation slides
Salesforce administrator training presentation slides Salesforce administrator training presentation slides
Salesforce administrator training presentation slides
 
Salesforce Org Health Check & Performance Testing
Salesforce Org Health Check & Performance TestingSalesforce Org Health Check & Performance Testing
Salesforce Org Health Check & Performance Testing
 
Securing Team, SharePoint, and OneDrive in Microsoft 365 - M365VM
Securing Team, SharePoint, and OneDrive in Microsoft 365 - M365VMSecuring Team, SharePoint, and OneDrive in Microsoft 365 - M365VM
Securing Team, SharePoint, and OneDrive in Microsoft 365 - M365VM
 
Understanding the Salesforce Architecture: How We Do the Magic We Do
Understanding the Salesforce Architecture: How We Do the Magic We DoUnderstanding the Salesforce Architecture: How We Do the Magic We Do
Understanding the Salesforce Architecture: How We Do the Magic We Do
 
Implement an enterprise service bus revised
Implement an enterprise service bus    revisedImplement an enterprise service bus    revised
Implement an enterprise service bus revised
 
Salesforce Security Model (Dmitry Goshko, Igor Haritonovich)
Salesforce Security Model (Dmitry Goshko, Igor Haritonovich)Salesforce Security Model (Dmitry Goshko, Igor Haritonovich)
Salesforce Security Model (Dmitry Goshko, Igor Haritonovich)
 
DevOps in Salesforce AppCloud
DevOps in Salesforce AppCloudDevOps in Salesforce AppCloud
DevOps in Salesforce AppCloud
 
Sharing and security in Salesforce
Sharing and security in SalesforceSharing and security in Salesforce
Sharing and security in Salesforce
 
Migrate to Microsoft Azure with Confidence
Migrate to Microsoft Azure with ConfidenceMigrate to Microsoft Azure with Confidence
Migrate to Microsoft Azure with Confidence
 
Labelling in Microsoft 365 - Retention & Sensitivity
Labelling in Microsoft 365 - Retention & SensitivityLabelling in Microsoft 365 - Retention & Sensitivity
Labelling in Microsoft 365 - Retention & Sensitivity
 
Site reliability engineering
Site reliability engineeringSite reliability engineering
Site reliability engineering
 

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

Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 

Recently uploaded (20)

Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 

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