Skip to content

Instantly share code, notes, and snippets.

@jesslilly
Created October 10, 2017 18:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jesslilly/f4253b1377c755a2ad59565055bae219 to your computer and use it in GitHub Desktop.
Save jesslilly/f4253b1377c755a2ad59565055bae219 to your computer and use it in GitHub Desktop.
Get all list names and list IDs from Campaign Monitor (createsend_dotnet)
[TestMethod]
public void PrintListIds()
{
PrintListIds("key", "id");
PrintListIds("key", "id");
PrintListIds("key", "id");
}
private static void PrintListIds(string apiKey, string clientId)
{
var auth = new ApiKeyAuthenticationDetails(apiKey);
var client = new Client(auth, clientId);
var lists = client.Lists();
foreach (var list in lists)
{
Console.WriteLine($"{list.Name} ID: {list.ListID}");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment