C# class for using our company's API as part of the subscription.
Install the NuGet package from the package manager console:
Install-Package ApiParser -Version 1.2.8
- Create instance from ApiParser.NET.dll
ApiParser parser = new ApiParser("API_USERNAME", "API_TOKEN", "json");
- Call method from ApiParser
int listid = 20;
int subscriberid = 150;
object responce = parser.GetTrackingEvents(listid, subscriberid);
- GetTrackingEvents
Definition:
public object GetTrackingEvents(int listid = 0, int subscriberid = 0, int limit = 100, int offset = 0)
- GetLeadScore
Definition:
public object GetLeadScore(int subscriberid = 0)
- SetLeadScore
Definition:
public object SetLeadScore(int subscriberid = 0, int? leadScore = null, string type = "add")
- LoadCustomField
Definition:
public object LoadCustomField(int fieldid = 0, bool return_options = false, bool makeInstance = false)
- GetCustomFields
Previous:
public object GetCustomFields(int[] lists = null)Now:
public object GetCustomFields(int[] lists = null)
- lists: is not required.
- GetNewsletterSummary
Definition:
public object GetNewsletterSummary(int newsletterid = 0, int statid = 0, string from = "", string to = "")
- GetStatids
Definition:
public object GetStatids(int listid = 0, int segmentid = 0, int campaignid = 0, string from = "", string to = "", int limit = 100, int offset = 0)
- GetSnapshots
Definition:
public object GetSnapshots(int subscriberid = 0, int triggerid = 0, int autoresponderid = 0)
- ResubscribeContact
Previous:
public string ResubscribeContact(int listid = 0, string emailaddress = "", string mobileNumber = "", string mobilePrefix = "", bool add_to_autoresponders = false)Now:
public string ResubscribeContact(int listid = 0, string emailaddress = "", string mobileNumber = "", string mobilePrefix = "", bool add_to_autoresponders = false, List<ContactFieldText> contactFields = null, List<Dictionary<string, object>> otmValues = null)
- Added: contactFields and otmValues.
- GetSegments
Definition:
public object GetSegments(int listid = 0, bool count_subscribers = false, int limit = 1000, int offset = 0)
- GetTriggers
Definition:
public object GetTriggers(int listid = 0, int limit = 1000, int offset = 0)
- AddToOTMDocument
Definition:
public string AddToOTMDocument(int listid = 0, int subscriberid = 0, string emailaddress = "", string mobile = "", string mobilePrefix = "", int fieldid = 0, Dictionary<string, object> values = null, string path = "")
- GetSubscribersByCustomField
Definition:
public object GetSubscribersByCustomField(int listid = 0, List<ContactFieldText> data = null, bool activeonly = true, bool countonly = false, int limit = 1000, int offset = 0)
- GetTriggerSummary
Definition:
public object GetTriggerSummary(int triggerid = 0, string from = "", string to = "")
- GetAutoresponderSummary
Definition:
public object GetAutoresponderSummary(int autoresponderid = 0, string from = "", string to = "")
- GetSegmentSummary
Definition:
public object GetSegmentSummary(int segmentid = 0, string from = "", string to = "")
- GetRulesForSegment
Definition:
public object GetRulesForSegment(int segmentid = 0)
- EditNewsletter
Definition:
public object EditNewsletter(int newsletterid = 0, string name = "", string subject = "")
- SetTriggerStatus
Definition:
public object SetTriggerStatus(int triggerid = 0, bool status = false)
- SetAutoresponderStatus
Definition:
public object SetAutoresponderStatus(int autoresponderid = 0, bool status = false)
#### Method definition changed:
- GetNewsletters
Previous:
public object GetNewsletters(bool countOnly = false, bool getLastSentDetails = false, bool content = true, string afterCreateDate = "", string newsletterNameLike = "")Now:
public object GetNewsletters(bool countOnly = false, bool getLastSentDetails = false, bool content = true, string afterCreateDate = "", string newsletterNameLike = "", int limit = 100, int offset = 0)
- Added: limit & offset.
- SendSMS
Definition:
public string SendSMS(int campaignid = 0, string subject = "", string text = "", int subscriberid = 0, int listid = 0, string mobile = "", string mobilePrefix = "")
- GetSubscribersFromSegment
Definition:
public object GetSubscribersFromSegment(int segmentid = 0, bool countonly = false, bool activeonly = true, int limit = 100, int offset = 0)
- ViewNewsletter
Definition:
public object ViewNewsletter(int newsletterid = 0)
- GetTriggersForSegment
Definition:
public object GetTriggersForSegment(int segmentid = 0)