Monday, 21 June 2021

Salesforce Integration API's

No-code Integrations :

=====================


MuleSoft

Salesforce Connect

Heroku Connect

External Services


Custom API Integrations :

=========================


SOAP

REST

Bulk

Composite

Streaming 

metadata

Tooling 

UI


Streaming Events Integrations (pub/Sub) :

=========================================


Platform Events

Change Data Capture


Salesforce Platform Integration Features :


1.Salesforce Core


APIs and Web Services

Salesforce Connect

External Services

Event Bus


2.Heroku 


Database

Heroku Connect

Other add-ons

Compute Dynos


3.Mulesoft Anypoint


Connectors

API Design & Mgt

Integration Runtime

Secure API Gateway


Salesforce Core APIs :

======================

1.REST API

  Access and manipulate data with a RESTful pattern using JSON and XML.

2.SOAP API

  Access and manipulate data using standard SOAP XML messages

3.Bulk API

   Perform large volume CRUD operations asynchronously.

4.Composite Graph API

   Chain multiple operations for related objects/records in a single REST call.

5.APEX (Custom SOAP and REST API using Apex Programming language)

   Build custom SOAP and REST APIs through Apex programming language.

6.Streaming API

   Subscribe to events using the Bayeux/CometD HTTP long-polling protocol.

7.User Interface API.

   Return UI-optimized payload display,edit or create a record.

8.Industries API

   Access to special Health and Financial Services Cloud-specific objects and features.

9.Analytics API

  Access Salesforce Report and Dashboard data using Restful APIs.

10.Metadata API

   Package and deploy setup metadata to Salesforce orgs asynchronously.

11.Tooling API

   Build custom development tools for applications using SOAP and RESTful APIS.

12.Social API 

   View,create and join Chatter conversations through RESTful APIs

   


Data APIs(SOAP & REST) :


Access and modify objects and records in real-time


ex : /SObjects/Account

     /SObjects/Account/describe

     /query?q=SELECT+Name,Industry+FROM+Account

     

     /SObjects/Property__c

     /SObjects/Property__c/describe

     /query?q=SELECT+Name,Type__c+FROM+Property__c

     /query?q=SELECT+FIELDS(ALL)+FROM+Property__c+LIMIT+200

     

Bulk API :


Access and modify large number of records asynchronously.

SOAP & REST are real-time APIs so daily limits apply.

Bulk API lets you process up to millions of records asynchronously.

Based on REST,Processes operations in batch.


Configure and start --> Check job Status --> Retrieve results.


Composite Graph API :


Chain multiple CRUD operations for related objects/records in a single REST call.

Requests organized in a graph.

Designed for optimal processing.

Ability to roll back entire transaction.


Apex Callout (HTTP Request) :


HttpRequest req=new HttpRequest();

req.setEndpoint(url);

req.setMethod(method);

req.setBody(body);

Http http =new Http();

HttpResponse resp=http.send(req);


Custom Apex REST Endpoint :


@RestResource(urlMapping='/propertyhub/*)

global class PropertiesService{

  @HttpGet

  global static void getAccounts(){

    RestRequest req = RestContext.request;

    RestResponse res = RestContext.response;

    

    //Do something with request

    // Send a custom response or return data (serialized as JSON)

      try {

            List<Account> accounts = [SELECT Id, Name FROM Account];

            res.responseBody = Blob.valueOf(JSON.serialize(accounts));

            res.statusCode = 200;

        } catch (Exception e) {

            res.responseBody = Blob.valueOf(e.getMessage());

            res.statusCode = 500;

        }

  

  }

 

}     


Design with the Right API :


SOAP : server to server , real-time access

REST : Client to Server, real-time access

Bulk : Working asynchronously with large data volumes

Composite API : Set of operations related objects/records

Custom APex REST & SOAP : Exposing custom business logic.


Salesforce Connect :


1.OData 2.0/4.0 or Custom Connector using Apex.

2.External data represented as Salesforce entites/objects.

3.Setup & sync with no code.

4.No data duplication

5.Data mastering at system of record.


Heroku Connect :


Salesforce data synchronized to a Heroku Postgres database.


External Service :


Integrate with 3rd party systems without code.

1.Import an ApenAPI specification schema.

2.Select operations

3.Use auto-generated Flow Actions.


Streaming API :


1.Change Data Capture(streaming event)

2.Platform Events


1.Change Data Capture(streaming event) :


A Change Data Capture event, or change event, is a notification that Salesforce sends 

when a change to a Salesforce record occurs as part of a create, update, delete, or undelete operation. 

The notification includes all new and changed fields, and header fields that contain information about the change. 

For example, header fields indicate the type of change that triggered the event and the origin of the change. 

Change events support all custom objects and a subset of standard objects.


Use change events to:


1.Receive notifications of Salesforce record changes, including create, update, delete, and undelete operations.

2.Capture field changes for all records.

3.Get broad access to all data regardless of sharing rules.

4.Get information about the change in the event header, such as the origin of the change, 

  which allows ignoring changes that your client generates.

5.Perform data updates using transaction boundaries.

6.Use a versioned event schema.

7.Subscribe to mass changes in a scalable way.

8.Get access to retained events for up to three days.


Asynchronous Apex triggers :


Asynchronous Apex triggers are change event triggers that run asynchronously after a database transaction is completed. 

They are ‘after-insert’ triggers and can be created the same way you create regular Apex triggers, the only difference is the sObject,

where you will have change it to the event object. The name of changeEvent object has suffix “changeEvent” for standard object and   

__changeEvent for custom objects (e.g. OpportunityChangeEvent , Employee_ChangeEvent  etc).


Use of Asynchronous trigger and Change Data Capture. 


1. Asynchronous triggers are the probable replacement for future methods and queuable 

    jobs with certain limitations.  


2. Let’s take a simple business example: when a customer logs a case with customer 

    service, case records gets created. If you want write a logic which can execute 

    asynchronously and assign a technician to it then you can write an asynchronous trigger 

    on CaseEvent.


3. Change Data Capture can be used for Integration purpose such as to downstream 

    system (ERP System) and it is much more effective and faster than the normal 

    webservices.  


4. CDC stores events up to 3 days so very effective if your downstream system is down for 

     weekly maintenance, it will automatically re trigger once it is up.  


2.Platform Events :


Platform events enable you to deliver secure, scalable, and customizable event notifications within Salesforce 

or from external sources via a Message bus.


MuleSoft :


Build Low Code Integrations with MuleSoft.


Integrate fast with Flow Designer.

Rich set of built-in connectors.

Low code be extended with script.

More than just a builder, a run-time manager.


No comments:

Post a Comment