verified
Retrieve Contexts for an Auto-Suppression ListLearn how to retrieve Contexts for 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",
"Definition.ObjectID",
"Definition.Name",
"Definition.CustomerKey",
"Definition.Category",
"Definition.Description",
"Context",
"SendClassification.ObjectID",
"Send.ID",
"SenderProfile.ObjectID",
"SendClassificationType",
"Client.CreatedBy",
"CreatedDate",
"Client.ModifiedBy",
"ModifiedDate",
"Client.ID",
"Client.EnterpriseID",
"AppliesToAllSends"
];
var result = api.retrieve("SuppressionListContext", cols);
<script runat="server">
Platform.Load("core", "1");
var api = new Script.Util.WSProxy();
try {
var cols = [
"ObjectID",
"Definition.ObjectID",
"Definition.Name",
"Definition.CustomerKey",
"Definition.Category",
"Definition.Description",
"Context",
"SendClassification.ObjectID",
"Send.ID",
"SenderProfile.ObjectID",
"SendClassificationType",
"Client.CreatedBy",
"CreatedDate",
"Client.ModifiedBy",
"ModifiedDate",
"Client.ID",
"Client.EnterpriseID",
"AppliesToAllSends"
];
var result = api.retrieve("SuppressionListContext", cols);
Write(Stringify(result));
} catch (error) {
Write(Stringify(error));
}
</script>
{
"Status": "OK",
"RequestID": "S0M3-GU1D-K3Y-G03SR1G4T-H3R3",
"Results": [
{
"Context": "BusinessUnit",
"SendClassificationType": "Marketing",
"SendClassification": null,
"Send": null,
"Definition": {
"Name": "MyNewSuppressionList 2",
"Category": 3132,
"Description": "My Suppression List #2",
"Contexts": null,
"Fields": null,
"SubscriberCount": 0,
"NotifyEmail": null,
"Client": null,
"PartnerKey": null,
"PartnerProperties": null,
"CreatedDate": "0001-01-01T00:00:00.000",
"ModifiedDate": null,
"ID": 0,
"ObjectID": "S0M3-GU1D-K3Y-G03SR1G4T-H3R3",
"CustomerKey": "S0M3-GU1D-K3Y-G03SR1G4T-H3R3",
"Owner": null,
"CorrelationID": null,
"ObjectState": null,
"IsPlatformObject": false
},
"AppliesToAllSends": false,
"SenderProfile": 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:30:04.082",
"ModifiedDate": "2022-12-06T12:30:04.082",
"ID": 0,
"ObjectID": "S0M3-GU1D-K3Y-G03SR1G4T-H3R3",
"CustomerKey": null,
"Owner": null,
"CorrelationID": null,
"ObjectState": null,
"IsPlatformObject": false
},
{
"Definition": {
"ObjectID": "S0M3-GU1D-K3Y-G03SR1G4T-H3R3",
"Name": "MyNewSuppressionList",
"CustomerKey": "S0M3-GU1D-K3Y-G03SR1G4T-H3R3",
"Category": 3132,
"Description": "My Suppression List #1",
"Contexts": null,
"Fields": null,
"SubscriberCount": 0,
"NotifyEmail": null,
"Client": null,
"PartnerKey": null,
"PartnerProperties": null,
"CreatedDate": "0001-01-01T00:00:00.000",
"ModifiedDate": null,
"ID": 0,
"Owner": null,
"CorrelationID": null,
"ObjectState": null,
"IsPlatformObject": false
},
"SendClassification": null,
"Send": null,
"SenderProfile": {
"Name": null,
"Description": null,
"FromName": null,
"FromAddress": null,
"UseDefaultRMMRules": false,
"AutoForwardToEmailAddress": null,
"AutoForwardToName": null,
"DirectForward": false,
"AutoForwardTriggeredSend": null,
"AutoReply": false,
"AutoReplyTriggeredSend": null,
"SenderHeaderEmailAddress": null,
"SenderHeaderName": null,
"DataRetentionPeriodLength": 0,
"DataRetentionPeriodUnitOfMeasure": "Secondly",
"ReplyManagementRuleSet": null,
"RMMCustomRoutingEmailAddress": null,
"RMMCustomTriggeredSend": null,
"RMMCustomAutoReplyTriggeredSend": null,
"RMMRuleCollection": null,
"ReplyToAddress": null,
"ReplyToDisplayName": null,
"FallbackFromAddress": null,
"Client": null,
"PartnerKey": null,
"PartnerProperties": null,
"CreatedDate": "0001-01-01T00:00:00.000",
"ModifiedDate": null,
"ID": 0,
"ObjectID": "S0M3-GU1D-K3Y-G03SR1G4T-H3R3",
"CustomerKey": null,
"Owner": null,
"CorrelationID": null,
"ObjectState": null,
"IsPlatformObject": false
},
"Client": {
"ID": 100000000,
"ClientID1": 0,
"PartnerClientKey": null,
"UserID": 0,
"PartnerUserKey": null,
"CreatedBy": 0,
"ModifiedBy": 0,
"EnterpriseID": 100000000,
"CustomerKey": null,
"CustomerID": null
},
"ObjectID": "S0M3-GU1D-K3Y-G03SR1G4T-H3R3",
"Context": "SenderProfile",
"SendClassificationType": "Operational",
"CreatedDate": "2022-12-06T12:16:41.317",
"ModifiedDate": "2022-12-06T12:16:41.317",
"AppliesToAllSends": false,
"PartnerKey": null,
"PartnerProperties": null,
"ID": 0,
"CustomerKey": null,
"Owner": null,
"CorrelationID": null,
"ObjectState": null,
"IsPlatformObject": false
}
],
"HasMoreRows": false
}
Reference
Ressources and references related to the current methods.
Official documentation
SOAP object