-1

I created a Transactional Send Journey in Journey Builder, sending a given Email.

I call it from a Node.js local script (passing a unique message key, the email address and the corresponding Contact Key) :

const needle = require('needle')

const MC_CLIENT_ID = '---'
const MC_CLIENT_SECRET = '---'
const MC_MID = '---'
const MC_AUTH = '---/v2/token'
const MC_TR_SEND = '---/messaging/v1/email/messages/'
const MC_JB_TR = '---'

const argv = require("yargs/yargs")(process.argv.slice(2))
  .option("message_key", {
    alias: "k",
    describe: "Message key. Must be unique."
  }).option("to", {
    alias: "t",
    describe: "Email to send transactional message to"
  }).option("contact_key", {
    alias: "c",
    describe: "Contact key of the recipient"
  })
  .demandOption(["message_key"])
  .help().argv;

var message_key = argv.message_key
var to = argv.to
var contact_key = argv.contact_key

var auth = { grant_type: 'client_credentials', client_id: MC_CLIENT_ID, client_secret: MC_CLIENT_SECRET, account_id: MC_MID }

needle('post', MC_AUTH, auth).then(function(resp) {
  
  var access_token = resp.body.access_token
  var header = { headers: { Authorization: 'Bearer ' + access_token, 'Content-Type': 'application/json'} };
  
  var message = { 
    definitionKey: MC_JB_TR, 
    recipient: {
      contactKey: contact_key,
      to: to,
      attributes: {
        UserAttribute_1: "value_1",
        UserAttribute_n: "value_n"
      }
    }
  }

  needle('post', MC_TR_SEND + message_key, message, header).then(function(resp) {
    console.log(resp)
  }).catch(function(err) { console.log(err.message) })

  
}).catch(function(err) { console.log(err.message) })

I get the following result :

MCMS_UTM_Authorization_InsufficientPrivileges: Insufficient privileges to complete this action.

Searched everywhere, but was not lucky to solve it.

2
  • 2
    Looks like the component of you managed package used reach the API lacks the required email-related permissions needed to trigger a Transactional Send Journey. Aug 9, 2022 at 12:50
  • @FrançoisPerret : which ones, and how to add them ? Aug 9, 2022 at 12:52

1 Answer 1

2

You may need to check the following permissions in the Installed Package used to reach the API (Setup > Installed Packages > Your Package > API Integration Server to Server Component) :

Permissions for using Journey Triggered Sends

Details here :

Use the following email permissions settings for the API integration: write, read, and send.

2
  • 1
    solved ! Thanks. Aug 9, 2022 at 13:01
  • So, if you problem is solved, consider accepting the answer ;) Aug 9, 2022 at 13:02

You must log in to answer this question.

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