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.
Things that I have tried so far
Any ideas? Thank you in advance for your help.
I’m not able to repro this with your exact config (same {{my.token}} value, requestable campaign, JSON payload).
@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?
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. 🙂
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.
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.
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