0

I created an automation triggered by a file drop in SFMC using the API but the file drop section still needs to be configured. The closest thing to an answer I could find was this post in which someone discusses using a "FileTrigger" Object in a new API Call, but doesn't explain what type of call to use or any other details.

If anyone has any insight I would be so grateful, thanks!

2

I have found a better way to accomplish this all in a single call by utilizing REST API.

You use the endpoint automation/v1/automations to create (POST) your new automation.

See below example:

POST /automation/v1/automations
Host: {{yourSubDomain}}.rest.marketingcloudapis.com
Authorization: Bearer XXXXXXX
Content-Type: application/json

and then the payload:

{
    "name": "testRestAuto",
    "description": "testRestAuto",
    "key": "testRestAuto",
    "steps": [
        {
            "annotation": "",
            "stepNumber": 0,
            "activities": [
                {
                    "id": "yourActivityID",
                    "name": "yourActivityName",
                    "objectTypeId": 43, 
                    "displayOrder": 0,
                    "activityObjectId": "{{yourActivityObjectID}}"
                }
            ],
            "id": "f4518041-5702-4712-a690-abc17e6a30f1"
        },
        {
            "annotation": "",
            "stepNumber": 1,
            "activities": [
                {
                    "name": "1 Hours",
                    "objectTypeId": 467,
                    "displayOrder": 0,
                    "activityObjectId": "00000000-0000-0000-0000-000000000000",
                    "serializedObject": "{\"duration\":1,\"durationUnits\":\"Hours\"}"
                }
            ]
        }
    ],
    "startSource": {
        "typeId": 2, /* sets it to Triggered Auto */
        "fileDrop": {
            "filenamePatternTypeId": 0, 
            /* 0 is no name, 1 Contains, 2 begins with, 3 ends with */
            "filenamePattern": "file", 
            /* only used with 1-3 to set string for filename - remove for 0 */
            "folderLocation": "triggered_automations",
            "statusId": 0,
            "queueFiles": true
        }
    },
    "categoryId": 58142 /* Folder ID */
}

The important part to pay attention to is the 'startSource' section:

    "startSource": {
        "typeId": 2, /* sets it to Triggered Auto */
        "fileDrop": {
            "filenamePatternTypeId": 0, 
            /* 0 is no name, 1 Contains, 2 begins with, 3 ends with */
            "filenamePattern": "file", 
            /* only used with 1-3 to set string for filename - remove for 0 */
            "folderLocation": "triggered_automations",
            "statusId": 0,
            "queueFiles": true
        }
    }

This is where you will set up the triggered Send information.

After you created it, you can then use PATCH or GET (utilizing the ObjectID at the end of the endpoint) to update or retrieve your automation.

  • 1
    I can't thank you enough for your timely and informative answer, it helped me out so much, it is working great now! For those reading this who have the same question this post was also helpful in solving the problem: salesforce.stackexchange.com/questions/260550/… – Brett Jul 22 at 18:12
  • @Brett - Great to hear! If this answers your question, please select the checkmark next to the answer to denote this is the correct answer. This will help others in the community to find the answer quicker if they experience the same issue. – Gortonington Jul 22 at 18:57
  • do you if the automation can be activated in the same call? – Brett Jul 23 at 2:48
  • I haven't seen a way to activate it in the same call, I believe it may need to be a separate one - but as it is an undocumented Endpoint, there could be something I am missing that will let you do that. – Gortonington Jul 23 at 12:51

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.