Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
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