Re: Triggering a campaign using REST API & custom token returns 611 - System error

someusername
Level 1

Triggering a campaign using REST API & custom token returns 611 - System error

Hi Community,

 

So I am trying to trigger a campaign using the REST API. The guide that I am following it this: https://developers.marketo.com/rest-api/assets/transactional-email/ 

 

I managed to get Marketo to send a test email by POSTing to "/rest/v1/campaigns/${id}/trigger.json", but when I include "tokens" in the post request, I get  611 - System error.

 

To illustrate, this works fine, (email is received etc.):

 

Request: 
url: '/rest/v1/campaigns/8304/trigger.json',
method: 'post',
data: '{"input":{"leads":[{"id":4889879}],"tokens":[]}}',
headers: {
  Accept: 'application/json, text/plain, */*',
  'Content-Type': 'application/json;charset=utf-8',
  Authorization: 'Bearer XXXXXXXXXXXXXXXXXXXXXXXXXXX',
  'User-Agent': 'axios/0.21.1',
  'Content-Length': 48
}

Response:
{
  "requestId": "2f0e#17bde6445ee",
  "result": [
      {
          "id": 8304
      }
  ],
  "success": true
}

 

 

This doesn't work:

 

Request:
url: '/rest/v1/campaigns/8304/trigger.json',
method: 'post',
data: '{"input":{"leads":[{"id":4889879}],"tokens":[{"name":"{{my.someToken}}","value":"http://www.somedomain.com/XXXXXX"}]}}',
headers: {
  Accept: 'application/json, text/plain, */*',
  'Content-Type': 'application/json;charset=utf-8',
  Authorization: 'Bearer XXXXXXXXXXXXXXXXXXXXXXXXXXX',
  'User-Agent': 'axios/0.21.1',
  'Content-Length': 123
},


Response: 
{
  "requestId": "1fc#17bde665d98",
  "success": false,
  "errors": [
      {
          "code": "611",
          "message": "System error"
      }
  ]
}

 

 

I made sure that the token is added to the Program and email template.

 

someusername_2-1631524613924.png

 

 

someusername_0-1631525147537.png

 

 

Things that I have tried so far

  • Giving the API user all available permissions
  • Adding custom token on different levels, such as on the folder level.

 

Any ideas? Thank you in advance for your help.

6 REPLIES 6
SanfordWhiteman
Level 10 - Community Moderator

Re: Triggering a campaign using REST API & custom token returns 611 - System error

I’m not able to repro this with your exact config (same {{my.token}} value, requestable campaign, JSON payload).

someusername
Level 1

Re: Triggering a campaign using REST API & custom token returns 611 - System error

@SanfordWhiteman Thanks for spending time on this. Do you know if there is a way of getting more useful / descriptive error message, in order to better understand where the fault is?

SanfordWhiteman
Level 10 - Community Moderator

Re: Triggering a campaign using REST API & custom token returns 611 - System error


Do you know if there is a way of getting more useful / descriptive error message, in order to better understand where the fault is?

Not for this case. I’d be happy to look at it with you offline to figure it out, but there’s a tradeoff: you have to change your Community username to something representing you or your company. We try to have non-snarky usernames. 🙂

someusername
Level 1

Re: Triggering a campaign using REST API & custom token returns 611 - System error

Hi,

 

I wouldn't consider "someusername" a snarky. But sure, I'll change that... but I'm not sure how as there is no such option in My profile nor My settings.

 

SanfordWhiteman
Level 10 - Community Moderator

Re: Triggering a campaign using REST API & custom token returns 611 - System error

Hmm, we may have turned off the ability to self-manage usernames. (The guidelines used to say your friendly name or company name should be “authentic,“ that might’ve been edited out.)

 

Anyway! If you want to troubleshoot this, let me know via DM.

someusername
Level 1

Re: Triggering a campaign using REST API & custom token returns 611 - System error

Posting an update on the resolution of this issue. Marketo tech support helped us to figure out the issue.

 

When triggering a campaign using the REST API, while specifying one or more tokens; the program that is being triggered (purple mailbox icon) can not be nested in another program (brown briefcase icon). It must be directly under a folder.

 

Marketo, being a legacy application it has many quirks. This is one of them.

 

FYI: @SanfordWhiteman