Retrieve an Auto-Suppression List verified

Learn how to retrieve an Auto-Suppression List in Salesforce Marketing Cloud (SFMC) with SSJS (server-side JavaScript). Code snippets include the WSProxy method.

WSProxy

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

var cols = [
    "ObjectID",
    "CustomerKey",
    "Name",
    "Description",
    "Client.CreatedBy",
    "CreatedDate",
    "Client.ModifiedBy",
    "ModifiedDate",
    "Category",
    "Client.ID",
    "Client.EnterpriseID",
    "SubscriberCount"
];

var filter = {
    Property: "Name",
    SimpleOperator: "equals",
    Value: "MyNewSuppressionList"
};

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

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

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

    try {

        var cols = [
            "ObjectID",
            "CustomerKey",
            "Name",
            "Description",
            "Client.CreatedBy",
            "CreatedDate",
            "Client.ModifiedBy",
            "ModifiedDate",
            "Category",
            "Client.ID",
            "Client.EnterpriseID",
            "SubscriberCount"
        ];

        var filter = {
            Property: "Name",
            SimpleOperator: "equals",
            Value: "MyNewSuppressionList"
        };

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

        Write(Stringify(result));

    } catch (error) {

        Write(Stringify(error));

    }

</script>
{
    "Status": "OK",
    "RequestID": "S0M3-GU1D-K3Y-G03SR1G4T-H3R3",
    "Results": [
        {
            "Name": "MyNewSuppressionList",
            "Category": 1234,
            "Description": "My Suppression List",
            "Contexts": null,
            "Fields": null,
            "SubscriberCount": 0,
            "NotifyEmail": null,
            "Client": {
                "ID": 100000000,
                "ClientID1": 0,
                "PartnerClientKey": null,
                "UserID": 0,
                "PartnerUserKey": null,
                "CreatedBy": 0,
                "ModifiedBy": 0,
                "EnterpriseID": 100000000,
                "CustomerKey": null,
                "CustomerID": null
            },
            "PartnerKey": null,
            "PartnerProperties": null,
            "CreatedDate": "2022-12-06T12:16:41.317",
            "ModifiedDate": "2022-12-06T12:16:41.317",
            "ID": 0,
            "ObjectID": "S0M3-GU1D-K3Y-G03SR1G4T-H3R3",
            "CustomerKey": "S0M3-GU1D-K3Y-G03SR1G4T-H3R3",
            "Owner": null,
            "CorrelationID": null,
            "ObjectState": null,
            "IsPlatformObject": false
        }
    ],
    "HasMoreRows": false
}

TIP

Retrieve all the Lists by removing the filter property.

Reference

Ressources and references related to the current methods.

SOAP object

Help me turn coffee into code

This website is provided to you free of charge. However, a lot of time and effort are spent to write, test and mainain the code. Please consider supporting my work by buying me a cup of coffee.

Last Updated: