2

I need to make an Apex Callout to Marketing Cloud when a Lead is created in Salesforce that matches certain criteria. I would like to use this MC Rest API - https://www.exacttargetapis.com/messaging/v1/messageDefinitionSends/key:Autoemail/send. The issue then is that I first need to authenticate with MC to get an Access Token to pass when making the above API call. Does anyone have a good way to persist the Access Token in a Salesforce org? I'm thinking of storing it in a Custom Setting and only updating it when an Apex callout goes to use it and sees that it's nearly 60 minutes old. Is anyone doing something similar? Thanks!

1 Answers1

0

If you know that access token to external service can be expired and should be updated sometimes automatically, the better approach is which you choose - custom setting (or custom object for storing it).

If this token can be hardcoded one time and it will not be changed for a long period, you can checkout Authentication Settings for External Systems functionality.

Hleb
  • 7,037
  • 12
  • 58
  • 117
  • Thanks Hleb, it looks like Marketing Cloud Access Tokens always expire in 60 minutes. Is anybody out there using this approach already to integrate with MC? – Kevin murray Sep 28 '17 at 10:42
  • @Kevinmurray unfortunately, I didn't work with Marketing Cloud, but I used approach with custom settings for integration with another third-party service and this completely satisfied our needs. – Hleb Sep 28 '17 at 12:18