Last active
November 27, 2017 10:38
-
-
Save henrikj242/51cbdb3c5cb431572d44df57abe3a1a8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.IO; | |
using System.Net; | |
using static System.Console; | |
public static class Program | |
{ | |
static void Main() | |
{ | |
WebClient client = new WebClient (); | |
string pmClient = "peytzmail-subdomain", mailinglistId = "mailing-list-id", startCriteria = "period_start=2017-11-01", userEmail = "api-user%40example.com", userToken = "sEcr3t"; | |
// start_criteria can either be a date 'period_start=yyyy-mm-dd' or an id 'from_id=someEventId'. | |
// Save the last id from one request and use it in from_id in the next to get a continuous set of events | |
string url = String.Format("https://{0}.peytzmail.com/api/v1/subscriber_events/mailinglists/{1}.json?changes[]=unsubscribe&{2}&user_email={3}&user_token={4}", | |
pmClient, mailinglistId, startCriteria, userEmail, userToken | |
); | |
string reply = client.DownloadString (url); | |
Console.WriteLine (reply); | |
Console.ReadLine(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment