Wednesday, 14 September 2022

Basic Integration interview Questions

 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.

 @RestResource(urlMapping='/your URL/*')

 Methods used in REST:

@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.

 @HTTPGET : The @HttpGet 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 GET request is sent, and returns the specified resource. These are some considerations when using this annotation:

·        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.

 @HTTPPATCH : The @HttpPatch 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 PATCH request is sent, and updates the specified resource.

To use this annotation, your Apex method must be defined as global static.

 @HTTPPOST : The @HttpPost 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 POST request is sent, and creates a new resource.

To use this annotation, your Apex method must be defined as global static.

 @HTTPPUT : The @HttpPut 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 PUT request is sent, and creates or updates the specified resource.

To use this annotation, your Apex method must be defined as global static.

  What is Remote Site Settings?

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.

  What is Named Credentials?

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.

  What is SOAP API?

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.

  Difference Between REST and SOAP.

 

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

 What is Connected App?

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.

 What is OAuth?

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.

 

 

No comments:

Post a Comment

Duplicate id in list

  Error 'System.ListException: Duplicate id in list' in Apex : list  can hold  duplicate values, but if you try to add duplicate  sO...