0

I'm about to embark on my first SFMC project and am seeking some hand holding for getting started. Please be forgiving in that this question is more vague than typical on a stack exchange post and I'm wearing my newbie shield.

Tag suggestions welcome too.

End goal: I would like to extract exact target email data for reporting and analytics purposes. Prefer read only. The goal is just reporting and analytics e.g. campaign name, sends, opens, etc.

Since it looks like there's no R library for this, I'm looking at Python. I found the Fuel SDK in python. It looks like this package might be for more than simply reading data.

I have two points of confusion I'm hoping to get some pointers on with this post.

First, what level of permissions to I need within the browser UI in order to grant access to an API? If I login, then in the upper right select the drop down at

my name > settings > installed packages

I am able to create 'apps'.

Do I need to given my goal of extracting read only email data? Are there any set up things I need to do in the uI before working within a script?

Second, first time using SalesForce, there's a lot of APIs:

The Fuel SDK for Python provides easy access to Salesforce Marketing Cloud's Fuel API Family services, including a collection of REST APIs and a SOAP API. These APIs provide access to Salesforce Marketing Cloud functionality via common collection types such as array/hash.

If I'm reading this right, 'Fuel' is one of several families of API and within Fuel there a collection of various APIs!

Which API do I want given my goal?

What set up do I need to do in the browser interface first and which API should I start exploring?

1 Answer 1

2

Salesforce Marketing Cloud comes with two distinct API's:

  • REST API
  • SOAP API

Each of these API's have different endpoints or methods to access and control your Salesforce Marketing Cloud instance from external.

REST API:

The REST API uses JSON request and response bodies and resource endpoints to support multi-channel use. All new Marketing Cloud technologies implement REST API. REST calls are synchronous, with timeout values of 120 for non-tracking operations and 300 seconds for tracking and data retrieve operations. The maximum payload of any call is four megabytes.

The REST API uses standard HTTP methods such as GET, POST, PUT, PATCH and so on. A full list of available REST API routes and methods can be found here.


SOAP API:

The SOAP API uses SOAP envelopes to pass information between you and Marketing Cloud. We recommend a limit of no more than 2k per minute for SOAP calls. Support may request your SOAP envelope to troubleshoot issues.

The SOAP API allows you to execute methods such as create, delete, execute, perform and many more. Each methods needs an object such as Automation or DataExtension. A full list of supported objects and its method can be found here.


To make it easier for any developer, Salesforce has introduced a free open source starter kit / SDK. This SDK is called the Fuel SDK.

The Marketing Cloud platform SDKs provide a cross-functional framework around the SOAP and REST APIs. This framework allows developers to integrate APIs using native language code libraries. The platform SDKs use both the SOAP and REST APIs to provide agnostic protocol interfaces and automated token management.

This starter kit should get you rolling quite quickly as you do not have to start from scratch.


As with any API, you are opening your Salesforce Marketing Cloud Instance to the public. This obviously needs to be done with caution and Salesforce has enabled several options to make this access more secure.

This open communication layer can be set and secured within the settings you have mentioned:

my name > settings > installed packages

Each package can have a different type of component depending on your use case. There is enough information outlined in the official Salesforce API documentation already, please have a look if further reading is required. enter image description here

Each package can also have different access level depending on your use case. Keep in mind, allowing the least possible access for your use case is always preferable.


I hope this high level overview of the Salesforce Marketing Cloud API clarify certain things a bit more.

Coming to your original question and use case:

How to export data to be used for reporting purposes

You could use the API to get data from DataExtension such the DataViews directly but I would not recommend this.

Depending on your sending volume, this export can be quite large and execution time can be critical.

Instead of trying to access the raw data via API, I would recommend this approach:

  • Run an Automation in Automation Studio.
  • The first activity is a SQL activity to copy the internal DataViews into a DataExtension
  • Use a DataExtract activity with the type Data Extension Extract to export the DataExtension to the SafeHouse
  • Use a FileTransfer activity to transfer the file from the SafeHouse to your sFTP of choice. For example at BigQuery which nicely aligns with Salesforce acquired product Tableau. Obviously you can also export this to a s3 bucket in AWS and use QuickSight by processing the data with Lambda

From there the possibilities are endless. There are other DataExtract types which may suit your use case better and which can skip the SQL part itself.

Keep in mind regardless of what extract you do, you want the data to be as granular as possible and build up aggregated reports on top within the tool of your choice.

1
  • This is great! Very helpful. Thanks a lot.
    – Doug Fir
    Commented Sep 10, 2021 at 13:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .