1var lue, lue_prop, Response;
2
3lue = Platform.Function.CreateObject("ExecuteRequest");
4Platform.Function.SetObjectProperty(lue,"Name","LogUnsubEvent");
5
6//For accounts using the subscriber key functionality
7lue_prop = Platform.Function.CreateObject("APIProperty");
8Platform.Function.SetObjectProperty(lue_prop, "Name", "SubscriberKey");
9Platform.Function.SetObjectProperty(lue_prop, "Value", subkey);
10Platform.Function.AddObjectArrayItem(lue, "Parameters", lue_prop);
11
12//For accounts not using the subscriber key functionality
13//lue_prop = Platform.Function.CreateObject("APIProperty");
14//Platform.Function.SetObjectProperty(lue_prop, "Name", "EmailAddress");
15//Platform.Function.SetObjectProperty(lue_prop, "Value", subkey);
16//Platform.Function.AddObjectArrayItem(lue, "Parameters", lue_prop);
17
18lue_prop = Platform.Function.CreateObject("APIProperty");
19Platform.Function.SetObjectProperty(lue_prop, "Name", "JobID");
20Platform.Function.SetObjectProperty(lue_prop, "Value", jid);
21Platform.Function.AddObjectArrayItem(lue, "Parameters", lue_prop);
22
23lue_prop = Platform.Function.CreateObject("APIProperty");
24Platform.Function.SetObjectProperty(lue_prop, "Name", "ListID");
25Platform.Function.SetObjectProperty(lue_prop, "Value", lid);
26Platform.Function.AddObjectArrayItem(lue, "Parameters", lue_prop);
27
28lue_prop = Platform.Function.CreateObject("APIProperty");
29Platform.Function.SetObjectProperty(lue_prop, "Name", "BatchID");
30Platform.Function.SetObjectProperty(lue_prop, "Value", bid);
31Platform.Function.AddObjectArrayItem(lue, "Parameters", lue_prop);
32
33lue_prop = Platform.Function.CreateObject("APIProperty");
34Platform.Function.SetObjectProperty(lue_prop, "Name", "Reason");
35Platform.Function.SetObjectProperty(lue_prop, "Value", "Profile Center Unsubscribe");
36Platform.Function.AddObjectArrayItem(lue, "Parameters", lue_prop);
37
38var statusAndRequest = [0,0];
39
40Response = Platform.Function.InvokeExecute(lue, statusAndRequest);