Which API Should I Use?

As a Marketing Cloud Growth developer, you’re most likely to interact with REST, Bulk, and Data Cloud APIs. However, multiple APIs are available for handling different needs and use cases.

Use REST API to query, create, and modify data in your Salesforce org using JSON requests. You can also use this API to send transactional messages and manage Salesforce users. An advantage of using REST API is that most modern applications and programming languages include features that make it easier to implement REST calls. REST API also supports composite requests, which you can use to send up to 25 requests in a single call. Most REST API requests are handled synchronously, but a few are asynchronous.

Bulk API 2.0 is an asynchronous, REST-based API for the Salesforce platform. You can use it to create, manage, and query large volumes of data in your Salesforce org. Any request that includes 2,000 records or more is a good candidate for Bulk API 2.0. Because it’s asynchronous, requests to Bulk API 2.0 require you to issue separate requests to create a job, upload content, check the status of the job, and close the job when it’s complete.

SOAP API performs many of the same functions as REST API. An advantage of using SOAP API is that it supports Web Services Security (WS-Security) headers, which can provide end-to-end security for API requests. SOAP requests are typically larger and more complex than their REST equivalents. As a result, they require more bandwidth, memory, and processing power. Like REST API, most SOAP API requests are synchronous, but a few are asynchronous.

Use Metadata API to read and manage flows. For example, Metadata API is helpful when you want to move flows from a development environment to your production environment.

Use the REST-based Connect API to upload and publish content such as images and emails to your marketing content workspace.

Use the streaming operations in Data Cloud API to create, update, or delete individual records synchronously. For example, you can use the streaming operations to add transaction data to Data Cloud from an external commerce platform as new records are generated.

Data Cloud API also includes bulk operations, which you can use to bring large quantities of data into Data Cloud asynchronously. For example, use bulk requests to synchronize Data Cloud with an external database.