Skip to content

Instantly share code, notes, and snippets.

@jdeblank
Last active January 22, 2023 01:03
Show Gist options
  • Select an option

  • Save jdeblank/985d45db07c28679d84a612334ed9e7f to your computer and use it in GitHub Desktop.

Select an option

Save jdeblank/985d45db07c28679d84a612334ed9e7f to your computer and use it in GitHub Desktop.

Revisions

  1. jdeblank revised this gist May 6, 2019. No changes.
  2. jdeblank revised this gist May 6, 2019. 1 changed file with 1 addition and 2 deletions.
    3 changes: 1 addition & 2 deletions ssjs_wsproxy_updatePublist.js
    Original file line number Diff line number Diff line change
    @@ -15,8 +15,7 @@
    Lists: [{
    ID: '12345',
    Status: 'Active'
    }],
    Status: 'Active'
    }]
    };
    var options = {
    SaveOptions: [{
  3. jdeblank created this gist Apr 23, 2019.
    31 changes: 31 additions & 0 deletions ssjs_wsproxy_updatePublist.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,31 @@
    <script runat="server">
    Platform.Load("core","1.1.1");

    var subkey = "abc123";
    var email = "[email protected]"

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

    // Set specific BU context if required
    // prox.setClientId({ "ID": 7279411 });

    var sub = {
    SubscriberKey: subkey,
    EmailAddress: email,
    Lists: [{
    ID: '12345',
    Status: 'Active'
    }],
    Status: 'Active'
    };
    var options = {
    SaveOptions: [{
    PropertyName: "*",
    SaveAction: "UpdateAdd"
    }]
    };

    var resp = prox.createItem("Subscriber", sub, options);

    Write("Response: " + Stringify(resp));
    </script>