0

(Tag suggestions very welcome, this is my first post on this forum)

We use ExactTarget to manage our customers email. I would like to do some reporting and analytics using these data - email subject line, sends, opens etc.

R's Salesforcer package provides an interface for R to connect to Salesforce via API. With this post, my goal is to get help or pointers to just get my connection/auth done. I am unsure what I need to set up in the Exact Target UI first, if anything (Packages?)

I followed the auth guide here.

library(dplyr)
library(salesforcer)

# Using OAuth 2.0 authentication
sf_auth()

When the browser tab opens to login, I enter my login details at the page https://login.salesforce.com. But my login credentials don't work here. I would usually login at mc.login.exacttarget.com.

I tried changing the login url field sf_auth(login_url = 'https://mc.login.exacttarget.com') which resulted in a new browser tab with a forbidden message:

Forbidden
You don't have permission to access /services/oauth2/authorize on this server.

When I login via browser outside of the R package, I am able to navigate to set up > platform tools > apps > installed packages. Here I can create new apps and give them permissions. There's various options such as server to server, web, and then the permissions granted to the app. Once saved I'm provided with various API integration components including:

client id
client secret
Authentication, REST and SOAP Base URIs

I tried changing options to use these credentials e.g. from this page.

options(salesforcer.consumer_key = "<my client id>")
options(salesforcer.consumer_secret = "<my client secret>")
sf_auth()

This opens a browser tab with message

error=invalid_client_id&error_description=client%20identifier%20invalid

I tried including the loginurl again but got the same forbidden error message.

How can I connect to SalesForce to extract ExactTarget email data using R? Do I need to create a package within Salesforce UI or should I be able to login just with my browser login credentials?

1

1 Answer 1

1

That package is for Salesforce Core and not for Salesforce Marketing Cloud (SFMC). Salesforce Marketing cloud has its own authentication system as well as different API capabilities and endpoints. This means that nothing in that package will interact or authenticate inside SFMC.

I do not know of anything that is not a paid service that allows you to interact with SFMC data in R. Depending on your use cases, you might find other custom solutions that can solve your need though that are not paid services.

1
  • Thanks for clarifying this for me, I was unsure
    – Doug Fir
    Commented Sep 1, 2021 at 21:45

You must log in to answer this question.

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