Concepts or coding lessons of Salesforce that you can implement easily

When to Use Salesforce Metadata API

Use Metadata API to retrieve, deploy, create, update, or delete customizations for your org. 
The most common use is to migrate changes from a sandbox or testing org to your production environment. 
Metadata API is intended for managing customizations and for building tools that can manage the metadata model, not the data itself.

The easiest way to access the functionality in Metadata API is to use the Force.com IDE or Ant Migration Tool. Both tools are built on top of Metadata API and use the standard Eclipse and Ant tools, respectively, to simplify working with Metadata API.

  • Force.com IDE is built on the Eclipse platform, for programmers familiar with integrated development environments. Code, compile, test, and deploy from within the IDE.
  • The Ant Migration Tool is ideal if you use a script or the command line for moving metadata between a local directory and a Salesforce org.


Read More: Which Salesforce API Do I Use in Integration?
                    When To Use Salesforce REST API  
                   When To Use Salesforce SOAP API 
                   When To Use Salesforce Bulk API 
                   When To Use Salesforce Chatter API  

Which Salesforce API Do I Use in Integration ?

Choosing the right API for your integration needs is an important decision. 
Here’s some information on most commonly used APIs, including supported protocols, data formats, communication paradigms, and use cases. 

Treat this blog as a reference you can return to when you’re considering which API to use.

API Name
Protocol
Data Format
Communication
REST API
REST
JSON, XML
Synchronous
SOAP API
SOAP (WSDL)
XML
Synchronous
Chatter REST API
REST
JSON, XML
Synchronous (photos are processed asynchronously)
User Interface API
REST
JSON
Synchronous
Analytics REST API
REST
JSON, XML
Synchronous
Bulk API
REST
CSV, JSON, XML
Asynchronous
Metadata API
SOAP (WSDL)
XML
Asynchronous
Streaming API
Bayeux
JSON
Asynchronous (stream of data)
Apex REST API
REST
JSON, XML, Custom
Synchronous
Apex SOAP API
SOAP (WSDL)
XML
Synchronous
Tooling API
REST or SOAP (WSDL)
JSON, XML, Custom
Synchronous



Read More: When To Use Salesforce REST API  
                   When To Use Salesforce SOAP API 
                   When To Use Salesforce Bulk API 
                   When To Use Salesforce Chatter API  

When to Use Salesforce Analytics REST API

  • You can access Analytics assets—such as datasets, lenses, and dashboards—programmatically using the Analytics REST API. 
  • Send queries directly to the Analytics Platform. 
  • Access datasets that have been imported into the Analytics Platform. 
  • Create and retrieve lenses.
  • Access XMD information. 
  • Retrieve a list of dataset versions. 
  • Create and retrieve Analytics applications. 
  • Create, update, and retrieve Analytics dashboards. 
  • Retrieve a list of dependencies for an application. 
  • Determine what features are available to the user. 
  • Work with snapshots. 
  • Manipulate replicated datasets.


Read More: When To Use Salesforce REST API  
                   When To Use Salesforce SOAP API 
                   When To Use Salesforce Bulk API 
                   When To Use Salesforce Chatter API  

When to Use Salesforce User Interface API


  • Build Salesforce UI for native mobile apps and custom web apps using the same API that Salesforce uses to build Lightning Experience and Salesforce for Android, iOS, and mobile web. 
  • Build user interfaces that let users work with records, list views, actions, favorites, and more. 
  • Not only do you get data and metadata in a single response, but the response matches metadata changes made to the org by Salesforce admins. 
  • You don’t have to worry about layouts, picklists, field-level security, or sharing—all you have to do is build an app that users love.




Read More: When To Use Salesforce REST API  
                   When To Use Salesforce SOAP API 
                   When To Use Salesforce Bulk API 
                   When To Use Salesforce Chatter API  

When to Use Salesforce Chatter REST API

  • Use Chatter REST API to display Chatter feeds, users, groups, and followers, especially in mobile applications. 
  • Chatter REST API also provides programmatic access to files, recommendations, topics, notifications, Data.com purchasing, and more. 
  • Chatter REST API is similar to APIs offered by other companies with feeds, such as Facebook and Twitter, but it also exposes Salesforce features beyond Chatter.


Read More: When To Use Salesforce REST API  
                   When To Use Salesforce SOAP API  

When to Use Salesforce Bulk API

Bulk API is a specialized RESTful API for loading and querying lots of data at once. By lots, I mean 50,000 records or more. 
Bulk API is asynchronous, meaning that you can submit a request and come back later for the results. 
This approach is the preferred one when dealing with large amounts of data. There are two versions of Bulk API (1.0 and 2.0). 
Both versions handle large amounts of data, but we use Bulk API 2.0 in this module because it’s a bit easier to use.

Bulk API is great for performing tasks that involve lots of records, such as loading data into your org for the first time.

Bulk API is based on REST principles and is optimized for loading or deleting large sets of data. 
You can use it to query, queryAll, insert, update, upsert, or delete many records asynchronously by submitting batches. Salesforce processes batches in the background.

SOAP API, in contrast, is optimized for real-time client applications that update a few records at a time. You can use SOAP API for processing many records, but when the data sets contain hundreds of thousands of records, SOAP API is less practical. Bulk API is designed to make it simple to process data from a few thousand to millions of records.

The easiest way to use Bulk API is to enable it for processing records in Data Loader using CSV files. Using Data Loader avoids the need to write your own client application.

When to Use Salesforce SOAP API

SOAP API is a robust and powerful web service based on the industry-standard protocol of the same name. 
It uses a Web Services Description Language (WSDL) file to rigorously define the parameters for accessing data through the API. 
SOAP API supports XML only. 
Most of the SOAP API functionality is also available through REST API. 
It just depends on which standard better meets your needs.
  • Because SOAP API uses the WSDL file as a formal contract between the API and consumer, it’s great for writing server-to-server integrations.
  • You can use SOAP API to create, retrieve, update, or delete records. You can also use SOAP API to perform searches and much more. 
  • Use SOAP API in any language that supports web services.
For example, you can use SOAP API to integrate Salesforce with your org’s ERP and finance systems. You can also deliver real-time sales and support information to company portals and populate critical business systems with customer information.

                   When To Use Salesforce Analytics REST API 
                   When To Use Salesforce Bulk API 
                   When To Use Salesforce Chatter API  

When to Use Salesforce REST API

REST API is a simple and powerful web service based on RESTful principles. 
It exposes all sorts of Salesforce functionality via REST resources and HTTP methods. 
REST API supports both XML and JSON.

For example, you can create, read, update, and delete (CRUD) records, search or query your data, retrieve object metadata, and access information about limits in your Salesforce org. 

  • Because REST API has a lightweight request and response framework and is easy to use, it’s great for writing mobile and web apps.
  • Its advantages include ease of integration and development, and it’s an excellent choice of technology for use with mobile applications and web projects. 
  • For certain projects, you may want to use REST API with other Salesforce REST APIs. 
  • To build UI for creating, reading, updating, and deleting records, including building UI for list views, actions, and dependent picklists, use User Interface API. 
  • To build UI for Chatter, communities, or recommendations, use Chatter REST API. 
  • If you have many records to process, consider using Bulk API, which is based on REST principles and optimized for large sets of data.