What is integration? Why we need integration in Salesforce?
Integration
is a process of connecting two applications. Enterprise system
uses many applications, many or most of which are not designed to work with one
another out of the box. Each application can have data, business logic,
presentation, and security layers, all of which are possible targets for
integration.
Integration comes in picture when some
interaction is required from external system. Let us take example, we want to
validate address of account record. This can be done using google address
validation or smarty street API integration.
What Is Webservices?
Webservices
is a functionality or code which helps to us to do integration. Web services are
open standard (XML, SOAP, HTTP, etc.) based web applications that interact with
other web applications for the purpose of exchanging data.
There are
two types of Webservices:
· SOAP web services.
· RESTful web services.
What is REST API?
A REST API is also known as
RESTful API. It stands for representational state transfer. REST API has
a lightweight request and response framework. It is a simple, easy-to-use, and
powerful web service based on RESTful principles. REST API supports both XML
and JSON. The protocol for REST is HTTP.
@HTTPDELETE : The @HttpDelete annotation is used at the method level and enables you to expose an Apex method as a REST resource. This method is called when an HTTP DELETE request is sent, and deletes the specified resource.
To use this annotation, your
Apex method must be defined as global static.
·
To use this annotation, your
Apex method must be defined as global static.
·
Methods
annotated with @HttpGet are also called if the HTTP request uses the HEAD
request method.
To use this annotation, your
Apex method must be defined as global static.
To use this annotation,
your Apex method must be defined as global static.
To use this annotation,
your Apex method must be defined as global static.
Before any apex callout can
call an external site, that site must be registered in the remote site settings
page or the callout fails. Salesforce prevents callout to unauthorized network
access.
Using Named credentials, We
can make callout to external system without supplying username and password. A Named
credentials specifies the URL of a callout endpoint and its required
authentication parameters in one definition.
SOAP is the Simple Object
Access Protocol which
supports XML only. you can create, get,
delete, and update records using the SOAP API (Simple Object Access Protocol
API). Any language that supports web services can utilize the SOAP API. Here
are the features of SOAP API.
·
Relies on XML and
Schema.
·
Strongly types
messaging framework.
·
Operations and its
XML structure of request and response defined.
·
Communicated through
WSDL.
·
The underlying
transport protocol can be sent over almost any protocol, server-side such as
HTTP, SMTP, TCP, or JMS.
|
REST |
SOAP |
|
REST is not a protocol; it is an architectural style. |
SOAP is a protocol. |
|
REST uses URL to expose the web service. |
SOAP uses WSDL class to expose the web service |
|
REST allows different data formats: XML, JSON, plain text. |
SOAP Allows Only XML format |
|
REST requires less bandwidth than SOAP. |
SOAP requires more bandwidth than REST. |
|
RESTful services inherit security measure from underlying
transport layer |
SOAP uses its own security measures. SOAP is based on
standardized Web service security. Thus, better secured compared to REST.
SOAP is more reliable in terms of security than REST |
A connected app is a
framework that enables an external application to integrate with Salesforce
using APIs and standard protocols, such as SAML, OAuth, and OpenID Connect.
Connected apps use these protocols to authenticate, authorize, and provide
single sign-on (SSO) for external apps.
OAuth is short for open authorization. OAuth 2.0 is a framework that allows for a secure way for
systems to establish trust with one another. The end goal is to obtain an
access token that can be used by to access protected resources without ever
providing your username or password to the other system.
How Many Callouts To External Service Can Be Made In A Single Apex Transaction?
Governor
limits will restrict a single Apex transaction to make a maximum of 100
callouts to an HTTP request or an API call.
What Is Call In And Call Out?
Call In is used to exposing our webservices to another users Call Out is used to invoking or consuming our webservices to others.
What is JSON ?
JSON
stands for JavaScript Object Notation. JSON is light weighted than XML.
When exchanging data between a browser and a server, the data can only be text.
JSON is text, and we can convert any JavaScript object into JSON, and send JSON
to the server.