Explore Developer Tools
After completing this unit, you’ll be able to:
- Explain the differences between the Marketing Cloud REST and SOAP APIs.
- Describe how you can use the Marketing Cloud SDKs.
- Name the Marketing Cloud programmatic languages.
So you’re a Marketing Cloud developer. Whether you’ve been doing this a while, or learning it for the first time, we want to introduce you to the wealth of tools at your fingertips for extending the power of Marketing Cloud. Trailblazers like you are making a huge impact with Salesforce customers around the globe—whether you’re a consultant doing custom development for multiple customers, or an in-house developer creating custom solutions for your employer. From SDKs to APIs, we’ll give you enough information in this module to get started with Marketing Cloud development, so you’re ready to use the tools you need for your next project.
Ready to get started with Marketing Cloud APIs? In this module, we assume you understand the basics about APIs (application programming interfaces) and how they are used for communication between two different software applications. If you haven’t worked with APIs before, that’s okay. In this badge, we’re looking at the Marketing Cloud APIs at a high level, so you can understand their differences and how you can use them.
So let’s dive into Marketing Cloud APIs. The first thing to know is that Marketing Cloud offers two APIs: REST (Representational State Transfer) and SOAP (Simple Object Access Protocol). Both of these APIs are used for distinct purposes. The REST API exposes broader access to Marketing Cloud capabilities. The SOAP API provides comprehensive access to most email functionality. These two APIs share a common authentication mechanism based on OAuth 2. Let’s take a closer look at each.
The REST API for Marketing Cloud is a great way to share assets from your internal databases or applications with your Marketing Cloud account.
Here are some examples of what you can do:
|Marketing Cloud REST API
||What you use it for...
||Share marketing content, such as emails, images, text, and other documents.
|Event Notification Service
||Receive notifications when certain events occur in Marketing Cloud. You can be notified when customers request password resets, get order confirmations, log in using two-factor authentication, and other events.
||Create event-driven, responsive campaigns to distribute across any channel (online and offline), at any time and at any frequency.
|GroupConnect Chat Messaging
||Send real-time event-based messages to your users in Facebook Messenger and LINE.
||Subscribe mobile numbers to a short code using one of three SMS opt-in variations.
||Update the data used to provide Einstein recommendations, manage consumer privacy requests, and easily download large reports.
||Send personalized, transactional email messages to your customers.
All new Marketing Cloud technologies implement REST API, so this is an important one to familiarize yourself with. Here are a few important things to note about the Marketing Cloud REST API:
- Most REST calls are synchronous.
- Timeout values are 120 seconds for non-tracking operations and 300 seconds for tracking and data retrieve operations.
- The maximum payload of any call is four megabytes.
As you know, SOAP APIs provide a means for applications on different operating systems, technologies, and languages to communicate using only XML. You can use the Marketing Cloud SOAP API for managing things such as tracking data, subscribers and lists, automations, content, and most other email activities.
Here’s some examples of what you can do:
|Web Services SOAP API
||What you use it for...
||Schedule and send emails, identifying message recipients using dynamic, rule-based segmentation of lists, events and profiles.
||Retrieve tracking data and use it to create reports and dashboards to see how your customers view and respond to your data.
|Subscribers and lists
||Retrieve subscribers for a list or lists for a subscriber.
||Define an activity using an automation in Automation Studio.
||Create a triggered email send.
Keep these things in mind when using the Marketing Cloud SOAP API:
- The SOAP API uses SOAP envelopes to pass information between you and Marketing Cloud.
- We recommend a limit of no more than 2000 per minute for SOAP calls.
- Support may request your SOAP envelope to troubleshoot issues.
Looking for SDKs (Software Development Kits) to develop custom applications you can use with Marketing Cloud? You’re in luck! Marketing Cloud SDKs provide a cross-functional framework around the SOAP and REST APIs, allowing you to integrate APIs using native language code libraries. The Marketing Cloud platform SDKs use both the SOAP and REST APIs to provide agnostic protocol interfaces and automated token management. In addition to SDKs for the Marketing Cloud platform, we offer SDKs for MobilePush and Content Builder.
We currently offer six platform SDKs: C#, Java, Node, PHP, Python, and Ruby. Check out example code for a few of these:
||Code Sample of the SDK being used to retrieve all lists in an account
We also provide SDKs for iOS and Android to use with MobilePush, a Marketing Cloud product that allows you to create and send targeted push messages based on cross-channel consumer data to encourage app usage.
The Salesforce Marketing Cloud SDKs, excluding the MobilePush and Content Builder SDKs, are community-supported projects. The SDK source code, samples, and documentation are publicly available on Github to use as-is or fork and modify for your needs. We invite everyone in the community to collaborate with us on Github and submit pull requests to help improve the source code and samples.
Marketing Cloud offers custom scripting languages to personalize landing pages, create applications, construct cross-channel templates or layouts, and work with messaging functions on the Marketing Cloud platform.
AMPscript is a scripting language that you can embed within HTML emails, text emails, landing pages, SMS messages, and push notifications from MobilePush. Do you want a message to display customized text to the recipient? For example, “Thanks for your purchase, Ted, you earned 1,000 points as a Gold subscriber!” AMPscript is your answer for personalization. Marketing Cloud processes the AMPscript calls at the time of send.
Wondering whether to use AMPscript or SSJS? Consider this:
- AMPscript is the preferred language for personalizing message content. It simply and efficiently handles inline personalization or simple IF ELSE statements.
- AMPscript works better than SSJS for use cases where each subscriber needs to see unique content.
- AMPscript has a shorter learning curve than SSJS for users new to scripting languages in general.
- Most users can handle the tasks they need to perform using AMPscript.
Guide Template Language (GTL)
GTL provides a declarative syntax used for creating personalized, dynamic, data-driven messages, as well as constructing cross-channel templates and layouts. GTL uses the widely adopted Handlebars and Mustache template languages and provides additional functionality, while simplifying how users interact with content and data to help them quickly build personalized Journey messages. GTL works with JSON data sources supplied by script or by a REST API service. Guide can also access specified lists and data extensions within a Marketing Cloud account.
- AMPscript Syntax Guide
- Digging Deeper into Oauth 2.0 in Salesforce
- GitHub Repository - Salesforce Marketing Cloud Platform
- Guide Template Language
- Intro to Marketing Cloud APIs
- Introduction to Programmatic Marketing Content
- Introduction to SDKs
- Your Subdomain and Your Tenant's Endpoints