How to integrate SFMC to external service via REST API?

How to integrate SFMC to external service via REST API?

Utilizing REST API is the go-to for these integrations in most services, but how to do this inside of SFMC is not well documented anywhere! Plus, the default functions in AMPscript and SSJS are limited and only include GET and POST methods, severely limiting your capabilities. This is where the Script.Util functions come in.

Why is it important to use API calls in SFMC?

API calls are one of the most powerful tools available to an SFMC user. It essentially allows you to make changes, perform actions, retrieve data and more all programmatically via an outside resource. Below I will give a quick overview on setting up an API integration package and then utilizing it in POSTman.

How to make API calls to SFMC from Postman?

**EDIT 04/08/2021 ** – Updated to show implementation inside of new POSTman UI as well as set up utilizing the same environment and syntax used by the Salesforce provided API collection. API calls are one of the most powerful tools available to an SFMC user.

How to make a soap call to SFMC?

SOAP has Methods (declared inside of payload/body) as well as Objects that are to be utilized to determine action and result. This should then return a SOAP envelope with the requested fields shown above inside of it. See below image showing a response to the above call:

Are there any REST API methods in SSJs?

This severely limits your API capabilities, both internally for Salesforce Marketing Cloud (SFMC) and to any external resource. Is there any way via AMPScript or SSJS to utilize HTTP methods outside of GET and POST?

How to make SFMC systems talk to each other?

An issue many people face when trying to have their systems talk to each other is that if there is not a pre-existing app in SFMC for their service, how do we make them talk to each other? Many people just use bulk upload/downloads via CSV and SFTP and call it a day.

Is it possible to integrate SFMC with CSV?

Many people just use bulk upload/downloads via CSV and SFTP and call it a day. This works great for high volume interactions or interactions that do not require real-time integration, but if you need to have quick, low volume integrations, this is not a viable solution.

What are the two sections of SFMC SSJs?

SFMC SSJS is separated into two different ‘sections’ for platform specific functions – Platform and Core library. Each has a very different purpose and unique capabilities. Below I will give a quick overview on these two sections, but will go into more detail on them in later articles.

When to use the JavaScript parameter in SFMC?

This parameter is where you specify if the code inside the block is JavaScript or AMPscript. The script tags inside of SFMC only allow those two languages. As the default value for this parameter is JavaScript, it is not a required parameter to be used in the declaration of the script tag.

How is SFMC core library different from ampscript?

Core Library is very different from AMPscript and is focused more on simplified and controlled API calls to SFMC SOAP objects via built-in functions. These two sections combined with native JS abilities are what makes up SFMC SSJS.

Which is REST API for Salesforce Marketing Cloud?

The Salesforce Marketing Cloud (ExactTarget) Fuel REST API is lightweight, easy to use, and on its way to full maturity. Development teams are choosing to leverage it more frequently.