1

I came to you guys because I don't understand a problem on a Custom Activity in Journey Builder, here is the error : enter image description here

I am a beginner so sorry if it is a stupid question. I thought it was that my answer when I save my activity but I return a status 200 in my backend.

app.post(/\/activity\/(save|publish|validate)/, (req, res) => {
   console.log('SAVE/VALIDATE/PUBLISH');
   console.log(req.body);
   return res.status(200).json({success: true});
});

Maybe I don't understand the error correctly. Also my req.body is empty and I don't know why. I give to you my code for save in CustomActivity.js :

function save () {
    //var eventDefinitionKey = $('#select-entryevent-defkey').val();
    let campaignNameKey = $('#select-campaign-name').val();
    let ftpServerKey = $('#select-ftp-server').val();
    let dataExtensionKey = $('#select-data-extension-key').val();

    payload['arguments'] = payload['arguments'] || {};
    payload['arguments'].execute = payload['arguments'].execute || {};


    payload['arguments'].execute.inArguments = [{
        'serviceCloudId': '{{Event.<YOUR ENTRY EVENT DEFINITION KEY>.\"<EVENT DATA ID PATH>\"}}',
        'campaignNameKey': campaignNameKey,
        'ftpServerKey': ftpServerKey,
        'dataExtensionKey': dataExtensionKey,
    }];

    payload['metaData'] = payload['metaData'] || {};
    payload['metaData'].isConfigured = true;
    console.log(JSON.stringify(payload));

    connection.trigger('updateActivity', payload);
}

I'm using Heroku to run my web application. Thanks for your help and if you have any questions, tell me and I will answer quickly.

EDIT : my config file

{
"key": "30...(my key)9",
"metaData": {
  "icon": "images/icon.png",
  "iconSmall": "images/icon_small.png",
  "isConfigured": true
},
"type": "REST",
"lang": {
   "en-US": {
      "name": "MyElefant",
      "description": "FTP server Cloud"
    }
},
"workflowApiVersion": "1.1",
"configurationArguments": {
   "applicationExtensionKey": "30..(my key)9",
   "save": {
       "url": "https://test-app-perso-ikumbi.herokuapp.com/activity/save",
       "verb": "POST",
       "body": "",
       "useJwt": false
    },
"publish": {
  "url": "https://test-app-perso-ikumbi.herokuapp.com/activity/publish",
  "verb": "POST",
  "body": "",
  "useJwt": false
},
"validate": {
  "url": "https://test-app-perso-ikumbi.herokuapp.com/activity/validate",
  "verb": "POST",
  "body": "",
  "useJwt": false
}
},
"wizardSteps": [
{
  "key": "eventdefinitionkey",
  "label": "Event Definition Key"
}
],
"outcomes": [
{
  "key": "rest-1-outcome-1",
  "next": "<key of next activity>"
}
],
"userInterfaces": {
   "runningModal": {
     "url": "runningModal.html"
    },
   "runningHover": {
     "url": "runningHover.html"
    }
},
"arguments": {
  "execute": {
    "inArguments": [],
    "outArguments": [],
    "url": "https://test-app-perso-ikumbi.herokuapp.com/activity/execute",
    "verb": "POST",
    "body": "",
    "header": "",
    "format": "json",
    "useJwt": false,
    "timeout": 90000
  }
},
"edit": {
  "url": "https://test-app-perso-ikumbi.herokuapp.com/index.html",
  "height": 400,
  "width": 500
}
}
  • Is there additional output in your browser's JavaScript console? Additionally, did you try using the Salesforce Marketing Cloud - Developer Tools (Google Chrome Extension) that shows additional information for errors in Marketing Cloud? Did you try manually sending a POST-request to your endpoint and checking the result? As it looks like you are using a modified version of my example activity but without JWT verification, did you change the body-parser middleware to not use JWT? – Markus Slabina Jun 11 '18 at 9:36
  • Thanks for your quick answer, I indeed use the example activity, I will try disabling JWT , I looked over Marketing Cloud extension and nothing is shown on the "error messages". I will try also the manual POST-request, I will answer when I have done that – Pierre-Adrien Delisle Jun 11 '18 at 9:48
  • I did change the JWT in the body-parser and the error is still there, I did a POST-request with postman and I have this as an answer on test-app-perso-ikumbi.herokuapp.com/activity/save : { "success": true } – Pierre-Adrien Delisle Jun 11 '18 at 11:21
  • I can show you if you want my config file because I did maybe a bad use of the config file. – Pierre-Adrien Delisle Jun 11 '18 at 11:30
  • Please edit your question to include the config file as this could be the issue. – Markus Slabina Jun 11 '18 at 11:41
0

I found where the problem come from. It was from the Data Extension in Journey Builder because as soon as I changed it, there is no more errors and execute requests are made. I don't why it was doing that exactly, maybe because the original DE was used in an other activity so it made my journey crash. Thanks Markus for the help :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.