Retrieve a Triggered Send Definition verified

Learn how to retrieve a Triggered Send Definition in Salesforce Marketing Cloud (SFMC) with SSJS (server-side JavaScript). Code snippets include the WSProxy method.

WSProxy

var api = new Script.Util.WSProxy();

var filter = {
    Property: "CustomerKey",
    SimpleOperator: "equals",
    Value: "S0M3-GU1D-K3Y-G03SR1G4T-H3R3"
}

var cols = [
    "Name", 
    "CustomerKey", 
    "TriggeredSendStatus", 
    "Email.ID",
    "List.ID"
];

var result = api.retrieve("TriggeredSendDefinition", cols, filter);
<script runat="server">

    Platform.Load("core", "1");

    var api = new Script.Util.WSProxy();

    try {

        var filter = {
            Property: "CustomerKey",
            SimpleOperator: "equals",
            Value: "S0M3-GU1D-K3Y-G03SR1G4T-H3R3"
        }

        var cols = [
            "Name", 
            "CustomerKey", 
            "TriggeredSendStatus", 
            "Email.ID",
            "List.ID"
        ];

        var result = api.retrieve("TriggeredSendDefinition", cols, filter);

        Write(Stringify(result));

    } catch (error) {

        Write(Stringify(error));

    }

</script>
{
    "Status": "OK",
    "RequestID": "S0M3-GU1D-K3Y-G03SR1G4T-H3R3",
    "Results": [
        {
            "CustomerKey": "12345",
            "Client": null,
            "Email": {
                "ID": 6789,
                "Name": null,
                "Folder": null,
                "CategoryID": 0,
                "HTMLBody": null,
                "TextBody": null,
                "ContentAreas": null,
                "Subject": null,
                "IsActive": false,
                "IsHTMLPaste": false,
                "ClonedFromID": 0,
                "Status": null,
                "EmailType": null,
                "CharacterSet": null,
                "HasDynamicSubjectLine": false,
                "ContentCheckStatus": null,
                "Template": null,
                "CustomObjectID": null,
                "SampleAudienceOnly": false,
                "SyncTextWithHTML": false,
                "PreHeader": null,
                "IsApproved": false,
                "__AdditionalEmailAttribute1": null,
                "__AdditionalEmailAttribute2": null,
                "__AdditionalEmailAttribute3": null,
                "__AdditionalEmailAttribute4": null,
                "__AdditionalEmailAttribute5": null,
                "Client": null,
                "PartnerKey": null,
                "PartnerProperties": null,
                "CreatedDate": "0001-01-01T00:00:00.000",
                "ModifiedDate": null,
                "ObjectID": null,
                "CustomerKey": null,
                "Owner": null,
                "CorrelationID": null,
                "ObjectState": null,
                "IsPlatformObject": false
            },
            "List": {
                "ListClassification": "ExactTargetList",
                "Type": "Public",
                "ListName": null,
                "Category": 0,
                "Description": null,
                "Subscribers": null,
                "AutomatedEmail": null,
                "OptInProfile": null,
                "SendClassification": null,
                "Client": null,
                "PartnerKey": null,
                "PartnerProperties": null,
                "CreatedDate": "0001-01-01T00:00:00.000",
                "ModifiedDate": null,
                "ID": 1,
                "ObjectID": null,
                "CustomerKey": null,
                "Owner": null,
                "CorrelationID": null,
                "ObjectState": null,
                "IsPlatformObject": false
            },
            "HeaderContentArea": null,
            "FooterContentArea": null,
            "SendClassification": null,
            "SenderProfile": null,
            "DeliveryProfile": null,
            "PrivateDomain": null,
            "PrivateIP": null,
            "ObjectID": null,
            "CreatedDate": "0001-01-01T00:00:00.000",
            "ModifiedDate": null,
            "Name": "MyTriggeredSend",
            "Description": null,
            "AutoAddSubscribers": false,
            "AutoUpdateSubscribers": false,
            "BatchInterval": 0,
            "FromName": null,
            "FromAddress": null,
            "BccEmail": null,
            "EmailSubject": null,
            "DynamicEmailSubject": null,
            "IsMultipart": false,
            "IsWrapped": false,
            "AllowedSlots": 0,
            "NewSlotTrigger": 0,
            "SendLimit": 0,
            "SendWindowOpen": "0001-01-01T00:00:00.000",
            "SendWindowClose": "0001-01-01T00:00:00.000",
            "SuppressTracking": false,
            "Keyword": null,
            "IsPlatformObject": false,
            "TriggeredSendType": "Continuous",
            "TriggeredSendStatus": "Inactive",
            "PartnerKey": null,
            "SendWindowDelete": false,
            "RefreshContent": false,
            "ExclusionFilter": null,
            "Priority": null,
            "SendSourceCustomerKey": null,
            "ExclusionListCollection": null,
            "CCEmail": null,
            "SendSourceDataExtension": null,
            "IsAlwaysOn": false,
            "DisableOnEmailBuildError": false,
            "KeepExistingEmailSubject": false,
            "PreHeader": null,
            "ReplyToAddress": null,
            "ReplyToDisplayName": null,
            "DataSchemas": null,
            "TriggeredSendClass": "Standard",
            "TriggeredSendSubClass": "Standard",
            "TriggeredSendVersionID": 0,
            "RequestExpirationSeconds": 0,
            "OptionFlags": 0,
            "OptionFlagsUpdateMask": 0,
            "OptionVersion": 0,
            "CategoryID": 0,
            "SourceAddressType": "DefaultPrivateIPAddress",
            "DomainType": "DefaultDomain",
            "HeaderSalutationSource": "Default",
            "FooterSalutationSource": "Default",
            "IsSendLogging": false,
            "InteractionObjectID": null,
            "PartnerProperties": null,
            "ID": 0,
            "Owner": null,
            "CorrelationID": null,
            "ObjectState": null
        }
    ],
    "HasMoreRows": false
}

WARNING

Due to the decomission of the Classic Content, Email.ID now refers to the legacyData.legacyId of the asset in the Content Builder.

Reference

Ressources and references related to the current methods.

SOAP object

Last Updated: