Learning Objectives
After completing this unit, you’ll be able to:
- Describe how to use the Marketing Cloud REST API.
- Identify the Marketing Cloud apps that interface with the REST API.
Take a REST
Marketing Cloud’s REST API offers you access to the most recent Marketing Cloud features. This unit gives you insight into what you can accomplish with the REST API and how to customize it to your needs.
REST API Basics
Before we dive in, take a look at the common traits for all REST API requests and endpoints.
- The REST API supports multichannel use and accepts JSON request bodies.
- All requests are synchronous and can contain up to 4 MB of information.
- Tracking information and other data-retrieve operations time out after 300 seconds.
- Other requests time out after 120 seconds.
With that in mind, let’s take a look at what you can accomplish with the REST API across several Marketing Cloud apps.
Content Builder
In Marketing Cloud, Content Builder is where you can create all of the material included in email, push, and SMS messages. No matter how the information is sent from the account, all of the content (also known as assets) resides in Content Builder. Assets also include the templates and slots used to create and organize your content.
You can use REST API requests to retrieve, update, or delete assets and categories (also known as folders) in Content Builder, among other less common requests. Salesforce Developers contains a full list, including samples of requests and resources to use when interacting with Content Builder.
Example: Update an Email Message
Take a look at the following resource and organization for a request. This example updates an existing email message, and it also demonstrates a typical JSON payload. The request uses the PATCH method to the specified route and updates the content of an email message. The ID value accepts the external key used to identify the asset in your account.
PATCH /asset/v1/content/assets/{id}{ "name": "NTO Welcome Series Email", "channels": { "email": true, "web": false}, "views": { "html": { "content": "<!DOCTYPE html><body>This is a simple message.</body></html>" }, "text": {}, "subjectline": {}, "preheader": {} }}
Journey Builder
Journey Builder determines how contacts receive different types of messages based on events and behavior. For example, you can send email messages to customers who signed up for a newsletter, but never clicked a link or purchased a product. This is an example of a journey. To create a journey in Marketing Cloud, your steps can look something like this example.
- Create a sendable data extension in Marketing Cloud. This data extension includes a unique contact key for each contact and information to use as part of any send.
- Create event definitions in Marketing Cloud. These event definitions control which contacts enter the journey and when.
- Build the journey. This includes any activities, such as sends or updates, that determine which messages the contact receives. You can also add a goal here to help you determine the success of the journey.
- Publish the journey.This step activates the journey and evaluates contacts to determine if they enter the journey.
- Fire an entry event. This step begins the journey for the contacts that meet the entry criteria.
A journey can include some pretty complex operations, so Salesforce Developers includes a full reference for all these steps.
Example: Send an Email Message Via Journey Builder
Let’s take a look at a simple example, for reference. Here’s the JSON for an event that sends an email message. The information specifies the activity and the triggered send with associated metadata. The email is sent when the event is triggered as part of the journey.
{ "type": "EMAILV2", "key": "<activity key>", "name": "<activity name>", "applicationId": "<Marketing Cloud provided GUID>", "outcomes": [ { "key": "<outcome key>", "next": "<key of next activity>" } ], "metaData":{ "icon":"/img/email-icon.svg", "iconSmall":"/img/email-icon.svg", "category":"message", "version":"1.0", "isConfigured":true }, "configurationArguments":{ "triggeredSend":{ "emailId":"<email id>", "emailSubject": "<subject>", "preHeader":"<preheader>", "description":"<description>", "campaigns":[ { "id":"<campaign id>", "name":"<campaign name>", "color":"<campaign color>" } ], "sendClassificationId":"<send classification id>", "senderProfileId":"<sender profile id>", "deliveryProfileId":"<delivery profile id>", "publicationListId":"<publication list id>", "suppressionLists":[ { "name":"<suppression list name>", "id":"<suppression list id>" } ], "domainExclusions":[ { "name":"<domain exclusion name>", "id":"<domain exclusion id>" } ], "exclusionFilter":"<exclusion script>", "isTrackingClicks":true, "isMultipart":true, "isSendLogging":true, "suppressTracking":true, "ccEmail":"<cc email>", "bccEmail":"<bcc email>", "keyword":"<keyword>", "throttleLimit":500, "throttleOpens":"12:00", "throttleCloses":"12:30", "isSalesforceTracking":true } }}
GroupConnect
Marketing Cloud uses the GroupConnect REST API to send messages using apps like Facebook Messenger and LINE. Contacts might receive messages for shipping or reservation updates, account changes, or other communications.
You can set up your GroupConnect API integration with these steps from Salesforce Developers.
Example: Register a Facebook Page
This example contains a sample request that identifies the platform, includes the necessary access information, and identifies the page to register.
Host: https://YOUR_SUBDOMAIN.rest.marketingcloudapis.comPOST /ott/v1/registrationContent-Type: application/jsonAuthorization: Bearer YOUR_ACCESS_TOKEN{ "ottPlatformName" : "messenger", "ottPlatformAttributes" : { "applicationId" : "1093076390764037", "applicationSecret" : "03d537gg656gvkbe9b430f002e9c4517", "pageId" : "1732555047025799", "pageName" : "SFMC Engineers", "pageAccessToken" :"someaccesstoken4fasdcruib213123knubkdnfisdubnu12312ub3pijnb", "endpointUrl" :"https://graph.facebook.com/v2.6/me/messages", "callbackVerifyToken" : "this_is_the_verify_token", "isActive": true }}
MobileConnect
MobileConnect allows Marketing Cloud accounts to send SMS and MMS messages to contacts. These types of messages require more regulation than email messages, so MobileConnect provides different types of opt-in mechanisms to help you comply with the applicable regulations for your sends. All contacts must opt to receive your messages in one of three ways.
- Single Opt-In. The contact sends an SMS message via a short code to subscribe to further communication.
- Double Opt-In. The contact sends the SMS message and confirms in a reply that they want to continue receiving messages.
- Double Opt-In with Age Confirmation. In addition to the two confirmation messages, the contact also confirms that they are old enough to receive the messages.
After they’ve subscribed, you can send a variety of messages to your subscribers, either individually or via a list. You can also create triggered messages that send after a certain activity, such as a purchase or shipment. Other common API requests include subscription confirmation and using a web form (or mobile app) as part of the opt-in process.
Example: Send an SMS Message Via MobileConnect
Let’s take a look at an example for sending a message to welcome a new subscriber. The Subscribe and Resubscribe values require subscription confirmation before sending the message.
POSThttps://YOUR_SUBDOMAIN.rest.marketingcloudapis.com/sms/v1/messageContact/MzA6Nzg6MA/sendContent-Type: application/jsonAuthorization: Bearer YOUR_OAUTH_ACCESS_TOKEN{ "mobileNumbers": [ "13175551212" ], "Subscribe": true, "Resubscribe": true, "Override": true, "messageText": "Welcome to Salesforce Developers",}
Personalization Builder
Personalization Builder works with Einstein Recommendations to personalize multichannel messages based on your customers’ needs, interests, and preferences. This API integration helps you update the information used to create recommendations, manage privacy requests, and download large reports.
This integration requires the Crimson Kraken API key from your Marketing Cloud account. Contact your Marketing Cloud admin for assistance if you can’t access this key.
Example: Update Personalization Builder Settings
This example shows an example of information necessary to update privacy settings for the specified Personalization Builder profile.
Host: https://app.igodigital.comPOST /api/v2/organization/12345678/privacyContent-Type: application/jsonAuthorization: Bearer YOUR_API_KEY{ "batch": { "hashed-id-01": ["do_not_track"], // Adds "do_not_track" privacy setting, removes "do_not_profile" or "do_not_process" if they were previously set "hashed-id-02": ["do_not_profile"], // Adds "do_not_profile" privacy setting, removes "do_not_track" or "do_not_process" if they were previously set "hashed-id-03": ["do_not_process"], // Adds "do_not_process" privacy setting, removes "do_not_profile" or "do_not_track" if they were previously set "hashed-id-04": ["do_not_track", "do_not_profile"], // Adds "do_not_track" and "do_not_profile" privacy settings, removes "do_not_process" if it was previously set "hashed-id-05": ["do_not_track", "do_not_process"], // Adds "do_not_track" and "do_not_process" privacy settings, removes "do_not_profile" if it was previously set "hashed-id-06": ["do_not_profile", "do_not_process"], // Adds "do_not_profile" and "do_not_process" privacy settings, removes "do_not_track" if it was previously set "hashed-id-07": ["do_not_track", "do_not_profile", "do_not_process"], // Adds "do_not_track", "do_not_profile" and "do_not_process" privacy settings "hashed-id-08": [], // Removes any existing privacy settings for profile "hashed-id-09": ["rtbf_delete"], // Deletes profile and associated data "hashed-id-10": ["rtbf_suppress"] // Deletes profile and associated data after suppression period }}
Transactional Messaging
The transactional messaging API manages automated messaging used for order confirmations, password resets, and other nonpromotional messages. You can use email or SMS messages for these communications. This API offers speedier performance than your average triggered send in Email Studio or MobileConnect, and you can use the Event Notification Service (an immediate notification API) to receive instantaneous confirmation of your sends.
To create transactional messages using the API, follow these steps.
- Create an email message in Content Builder and a list in Email Studio (or a keyword in MobileConnect).
- Get your access token.
- Create a transactional send definition via REST API. If you create a triggered send in Email Studio or Outbound Message in MobileConnect, the transactional REST API fails to send.
- (Optional) You can create a subscription using the Event Notification Service that delivers real-time tracking data about the messages.
Example: Send a Transactional Email Message
This sample code contains an example of the information necessary to send a transactional email message.
Host: https://YOUR_SUBDOMAIN.rest.marketingcloudapis.comPOST /messaging/v1/email/messages/f4fe74b7-c3c0-4e5a-9f49-b63a641109a2Content-Type: application/jsonAuthorization: Bearer YOUR_ACCESS_TOKEN{ "definitionKey": "2FA_order_accounts", "recipient": { "contactKey": "recipient2", "to": "recipient2@example.com", "attributes": { "UserAttribute_1": "value_1", "UserAttribute_n": "value_n", } },}
Whew, we covered a lot! And that’s just the start of what’s possible with the REST API. You can find additional resources and explore even more possibilities on Salesforce Developers. Next up, you learn how to amp up your Email Studio integration with the SOAP API.
Resources
- Salesforce Developer: Intro to Marketing Cloud APIs
- Salesforce Developer: Content Builder API
- Salesforce Developer: GroupConnect Chat Messaging API
- Salesforce Developer: Journey Builder API
- Salesforce Developer: MobileConnect API
- Salesforce Developer: Transactional Messaging API
- Salesforce Developer:REST API Reference
FAQs
Does Salesforce Marketing Cloud have an API? ›
The Wait Until API Event Activity is a new Journey Builder activity released as part of the April 2021 Salesforce Marketing Cloud Release. It allows you to create a real-time experience for contacts by allowing an external event to trigger an action mid-journey.
Which API does Marketing Cloud offer? ›As a developer, APIs are the building blocks you use to connect your system to Marketing Cloud. We want you to have everything you need to design and implement your code, so Marketing Cloud offers two robust APIs: REST and SOAP.
How do I connect my API to Marketing Cloud? ›- In the Marketing Cloud, navigate to Email Studio.
- Click Admin.
- Expand Account Settings and click My Users.
- Select the API user.
- Click Integrate for Salesforce.com Status.
- Enter the Salesforce system user username.
- Save the settings.
Create the Marketing Cloud API User, which is typically a unique user that connects to the Salesforce System User in Marketing Cloud Connect Setup.
What is the difference between REST API and SOAP API in Marketing Cloud? ›The major difference between SOAP and REST API include:
SOAP API has official standards because it's a protocol. REST API has no official standards because it's an architectural style of coding and tags. REST API uses Web Application Description Language to describe service.
Salesforce Data APIs
They are REST API, SOAP API, Bulk API, and Pub/Sub API. Together they make up the Salesforce data APIs. Their purpose is to let you manipulate your Salesforce data or subscribe to data changes, whereas other APIs let you do things like customize page layouts or build custom development tools.
Cloud Endpoints is a user-managed service whereas API Gateway is a fully managed service. Both support the same OpenAPI definition format. The main difference is that API Gateway can route a request to multiple backends, but Cloud Endpoints can route traffic only to a single backend.
What is Marketing Cloud called now? ›Here are the latest name changes affecting marketers who use Salesforce: Marketing Cloud Email Studio (aka ExactTarget) to Marketing Cloud Engagement. Pardot to Marketing Cloud Account Engagement. CDP to Marketing Cloud Customer Data Platform.
Is there a sandbox for Marketing Cloud? ›Salesforce Marketing Cloud does not offer standalone sandbox environments. Use an additional Business Unit for testing purposes. If that does not fit your business use case, please reach out to your Account Executive to consider purchasing an additional production Marketing Cloud tenant.
How do I connect my postman to Marketing Cloud? ›- Choose Your Interface (Desktop or Web) Postman App. ...
- Create an Installed Package in Marketing Cloud. Go to Marketing Cloud -> Apps -> Installed Packages. ...
- Fork the Collection. ...
- Configure the Collection. ...
- Collection Authentication. ...
- Execute a Request.
Why do we use SOAP API? ›
As an API, SOAP allows applications to interact and create, update, delete and recover records such as passwords, accounts and custom objects. Because of its extensible, neutral and independent nature, SOAP API allows developers to maintain accounts and run searches using all programming languages.
What are the 4 types of API? ›- Monolithic APIs. Most public APIs are monolithic APIs, meaning they are architected as a single, coherent codebase providing access to a complex data source. ...
- Microservices APIs. ...
- Composite APIs. ...
- Unified APIs.
A vendor-specific cloud API supports the services of a particular cloud provider. For example, the Microsoft Azure REST API supports many services offered by the public Azure cloud. For example- Azure DevOps, Cosmos DB, and Visual Studio. A vendor-specific cloud API considers all the functionalities of this platform.
What is an example of API in cloud computing? ›Popular Cloud APIs
Google Compute Engine API – used to create and run virtual machines (VMs) on Google Cloud. Google Storage Transfer API – used to transfer data from an external source to Google Cloud. AutoML API – helps citizen developers to create machine learning models for specific business requirements.
A general rule of thumb when you're deciding between SOAP and REST for building your API: if you want standardization and enhanced security, use SOAP. If you want flexibility and efficiency, use REST.
Why is SOAP better than REST API? ›SOAP provides the following advantages when compared to REST: Language, platform, and transport independent (REST requires use of HTTP) Works well in distributed enterprise environments (REST assumes direct point-to-point communication) Standardized.
Which API is faster SOAP or REST? ›SOAP messages are larger, which makes communication slower. REST has faster performance due to smaller messages and caching support.
What is the difference between REST API and streaming API? ›Streaming API vs REST API – essential differences
REST API leverages client-server architecture. Hence a user makes a request and the server responds with the information that the user needs. Streaming APIs updates, on the other hand, are sent to the user immediately as events occur.
The Salesforce REST API lets you integrate with Salesforce applications using simple HTTP methods, in either JSON or XML formats, making this an ideal API for developing mobile applications or external clients. Salesforce also supports Apex REST, which lets you create Web services on Force.com using Apex.
What is standard API in Salesforce? ›You can use the Salesforce standard API to read data from Salesforce sources and write data to Salesforce targets. Use the standard API to process a normal amount of Salesforce data and standard reporting on the results of the standard API load. Advanced options in synchronization tasks.
What are the three basic clouds in cloud computing? ›
There are also three main types of cloud computing services: Infrastructure-as-a-Service (IaaS), Platforms-as-a-Service (PaaS), and Software-as-a-Service (SaaS).
How do cloud APIs work? ›Here's how cloud APIs work. Developers access cloud APIs to connect services. The API communicates with the cloud service and brings the information back to the developer and their application. As a result, the cloud API enables communication and integration between cloud services.
Is Marketing Cloud separate from Salesforce? ›Yes. Marketing Cloud is a core component of Salesforce Customer 360. It operates alongside other clouds to complete the Customer 360: Sales Cloud, Service Cloud, Community Cloud, Analytics Cloud, and App Cloud.
Is Marketing Cloud different from Salesforce? ›Marketing Cloud manages marketing touchpoints across the whole customer lifecycle, and so taps into other datasets beyond Sales Cloud (eg. website analytics, service case data, advertising data). Salesforce is the core CRM (customer database) platform, which Sales Cloud is built on.
Is Salesforce CRM or Marketing Cloud? ›Salesforce Marketing Cloud is a customer relationship management (CRM) platform for marketers that allows them to create and manage marketing relationships and campaigns with customers.
What is Marketing Cloud built on? ›Marketing Cloud is a digital marketing platform from Salesforce which includes tools for email marketing, social media marketing, mobile marketing, online advertising, and marketing automation. Marketing Cloud provides a unified view of customers so businesses can create personalised, omni-channel, customer journeys.
What does sandbox mean in cloud? ›A sandbox is an isolated testing environment that enables users to run programs or open files without affecting the application, system or platform on which they run. Software developers use sandboxes to test new programming code.
Are there companies like sandbox? ›The Sandbox's alternatives and competitors. See how The Sandbox compares to similar products. The Sandbox's top competitors include Digital Entertainment Asset, Vault Hill, and Planetarium Labs. Digital Entertainment Asset operates a play-to-earn (P2E) gaming arena.
How do I upload data to Marketing Cloud? ›- Hover over Subscribers.
- Click Data Extensions.
- Under Actions click Import for the data extension to import into.
- Complete the Import Into Data Extension dialog box: ...
- Click Next.
- Complete the Configure Mapping dialog box that appears. ...
- Click Next.
In Sales or Service Cloud, navigate to a lead, contact, person account, or campaign. Click Send Marketing Cloud Email. To access Marketing Cloud emails, click Find. Select an email.
How do I track emails in Marketing Cloud? ›
In a Sent, Running, or Stopped journey, access an email message's performance metrics by clicking the email activity in the journey. To access the Email Performance tile, click View Details. Click the Contacts tab to review contact-level data for the send, including opens, clicks, bounces, and unsubscribes.
Is SOAP API outdated? ›Originally designed for and first used by Microsoft in 1998, SOAP is considered old and complex. And it has drastically been replaced by the more flexible REST architecture, which serves more than 70 percent of public APIs today.
What is the difference between REST API and RESTful API? ›REST API uses web services and is based on request and response, whereas RESTful API works completely based on REST application and infrastructure. REST apps have strong protocols and pre-configured architecture layers as security measures, whereas RESTful apps have multi-layered transport protocols.
Are SOAP APIs still used? ›SOAP or Simple Objects Access Protocol is a web communication protocol designed for Microsoft back in 1998. Today, it's mostly used to expose web services and transmit data over HTTP/HTTPS.
What are the prerequisites for Marketing Cloud connect? ›Marketing Cloud Connect requires a relationship between a single Marketing Cloud account and one or more Salesforce orgs. Your Marketing Cloud account must be provisioned and enabled for use with Marketing cloud Connect before connection.
Is Marketing Cloud Connect bidirectional? ›It is a unidirectional synchronization.
How do I map fields from Salesforce to Marketing Cloud? ›- In Marketing Cloud, navigate to Email Studio.
- Click Subscribers.
- Click Profile Management.
- Select an existing attribute or create one.
- In the New Attribute Properties window, click the Salesforce tab within the attribute properties. ...
- To map the attribute, select the field.
What is an API for a beginner? An API key for beginners is a set of methods and functions that an app or program uses to communicate with another app or program. They are also known as "methods" in computer science. Users can use an API to obtain information from other programs, get data, and more.
What is API in simple words? ›What does API stand for? API stands for Application Programming Interface. In the context of APIs, the word Application refers to any software with a distinct function. Interface can be thought of as a contract of service between two applications.
What are the three most common APIs? ›Today, there are three categories of API protocols or architectures: REST, RPC and SOAP. These might be dubbed "formats," each with unique characteristics and tradeoffs and employed for different purposes.
What is REST API in cloud? ›
A REST API (also known as RESTful API) is an application programming interface (API or web API) that conforms to the constraints of REST architectural style and allows for interaction with RESTful web services. REST stands for representational state transfer and was created by computer scientist Roy Fielding.
What are the 3 types of APIs and give examples for each? ›- REST, a collection of guidelines for lightweight, scalable web APIs.
- SOAP, a stricter protocol for more secure APIs.
- RPC, a protocol for invoking processes that can be written with XML (XML-RPC) or JSON (JSON-RPC).
RESTful API is an interface that two computer systems use to exchange information securely over the internet. Most business applications have to communicate with other internal and third-party applications to perform various tasks.
What is a typical API example? ›Weather data is a popular API example that we come across regularly. Rich weather snippets appear ubiquitous, appearing on all platforms such as Google Search, Apple's Weather app, and even your smart home device.
Which is API in AWS? ›What is Amazon API Gateway? Amazon API Gateway is an AWS service for creating, publishing, maintaining, monitoring, and securing REST, HTTP, and WebSocket APIs at any scale. API developers can create APIs that access AWS or other web services, as well as data stored in the AWS Cloud .
Does Salesforce offer an API? ›Users get many great built-in capabilities, but since no company can build the perfect, customized platform for every single user, Salesforce uses APIs. By offering APIs, Salesforce customers take all the technology available to create the capabilities they need for their own platforms.
How does Salesforce integrate with Marketing Cloud? ›Marketing Cloud Connect combines the digital marketing capabilities of Marketing Cloud with the data management, segmentation, and campaign management tools in Salesforce. Create unitary customer relationships with more data-driven, personalized conversations and the ability to automate the customer journey.
Does Marketing Cloud connect consume API calls? ›Most calls made by Marketing Cloud Connect are SOAP and REST. BULK API calls are only used by individual email results and individual link details for tracking.
What comes with Salesforce Marketing Cloud? ›The Marketing Cloud incorporates integrated solutions for customer journey management, email, mobile, social media, web personalization, advertising, content creation, content management and data analysis.
Can Salesforce call a REST API? ›You can do this by completing Quick Start: Connect Postman to Salesforce. You can make REST API calls to your Trailhead playground using the resources in the Postman app Salesforce Collection REST folder just like you would from any other HTTP interface.
Is Salesforce API free? ›
For Professional Edition organizations, all requests for API access must be purchased and can be processed contacting your Account Executive.
What is the difference between Salesforce and Salesforce Marketing Cloud? ›Salesforce Marketing Cloud is built to identify leads and guide them toward your product or service, while Salesforce Sales Cloud is built to close deals and bring in revenue.
What is the difference between Salesforce and Marketing Cloud? ›Salesforce Sales Cloud and Salesforce Marketing Cloud are different solutions from the Salesforce CRM suite. Each has a distinct primary purpose. Salesforce Sales Cloud is designed to help you close deals, while Salesforce Marketing Cloud enables you to find new leads and turn them into customers.
How difficult is Salesforce Marketing Cloud? ›All Salesforce certifications require prior study and training, but the Cloud Marketing Consultant certification is considered one of the most complicated to obtain due to all the previous knowledge you need to have about Cloud Marketing, the complicated questions, the case studies and the technical difficulty.
What is the limit of API call in Marketing Cloud? ›Yearly Limit
Basic: 0 calls/year. Pro: 2M calls/year. Corporate: 6M calls/year. Enterprise: 200M calls/year.
Marketing APIs are application programming interfaces that help marketing operations in a variety of ways — marketing automation, integration, social media, email marketing, data collection, or any other category that falls under marketing. What is marketing automation?
What are the two types of API limits? ›We have two types of API limit: Minute API Limit and Daily API limit.
Does Salesforce Marketing Cloud require coding? ›Solid understanding of programming languages like HTML, CSS, and JavaScript. Familiarity with data integration and management. Knowledge of SQL and data analytics. Understanding of the Salesforce ecosystem and CRM principles.
Is Salesforce Marketing Cloud hosted in AWS? ›Many Salesforce products run on AWS. In addition, Salesforce customers can build on AWS to extend their Salesforce capabilities.