Leadpages.Drip.DripDotNet by dripaccounts

<PackageReference Include="Leadpages.Drip.DripDotNet" Version="1.2.0" />

 DripClient

public class DripClient
protected const string ApplyTagToSubscriberResource = "/{accountId}/tags"

public const string BaseUrl = "https://api.getdrip.com/v2/"

protected const string BatchRequestBodyKey = "batches"

protected const string CampaignIdQueryKey = "campaignId"

protected const string CampaignIdUrlSegmentKey = "campaignId"

protected const string CreateOrUpdateSubscriberResource = "{accountId}/subscribers"

protected const string CreateOrUpdateSubscribersBatchResource = "{accountId}/subscribers/batches"

protected const string EventsRequestBodyKey = "events"

protected const string FetchSubscriberResource = "{accountId}/subscribers/{subscriberId}"

protected const string RemoveTagFromSubscriberResource = "/{accountId}/subscribers/{subscriberId}/tags/{tag}"

protected const string SubscriberIdUrlSegmentKey = "subscriberId"

protected const string SubscribersRequestBodyKey = "subscribers"

protected const string SubscribeToCampaignResource = "{accountId}/campaigns/{campaignId}/subscribers"

protected const string TagsRequestBodyKey = "tags"

protected const string TagUrlSegmentKey = "tag"

protected const string TrackEventResource = "/{accountId}/events"

protected const string TrackEventsResource = "/{accountId}/events/batches"

protected const string UnsubscribeFromCampaignResource = "/{accountId}/subscribers/{subscriberId}/unsubscribe"

public string AccessToken { get; set; }

public string AccountId { get; set; }

public string ApiKey { get; set; }

protected RestClient Client { get; }

public DripClient()

public DripClient(string apiKey = null, string accountId = null, string accessToken = null)

public DripResponse ApplyTagToSubscriber(string email, string tag)

Apply a tag to a subscriber. See: https://www.getdrip.com/docs/rest-api#apply_tag

public Task<DripResponse> ApplyTagToSubscriberAsync(string email, string tag, CancellationToken cancellationToken = default)

Apply a tag to a subscriber. See: https://www.getdrip.com/docs/rest-api#apply_tag

Create or update a subscriber. See: https://www.getdrip.com/docs/rest-api#create_or_update_subscriber

Create or update a subscriber. See: https://www.getdrip.com/docs/rest-api#create_or_update_subscriber

We recommend using this API endpoint when you need to create or update a collection of subscribers at once. Note: Since our batch APIs process requests in the background, there may be a delay between the time you submit your request and the time your data appears in user interface. See: https://www.getdrip.com/docs/rest-api#subscriber_batches

We recommend using this API endpoint when you need to create or update a collection of subscribers at once. Note: Since our batch APIs process requests in the background, there may be a delay between the time you submit your request and the time your data appears in user interface. See: https://www.getdrip.com/docs/rest-api#subscriber_batches

protected virtual IRestRequest CreatePostRequest(string resourceUrl, string requestBodyKey = null, object requestBody = null, string urlSegmentKey = null, string urlSegmentValue = null)

protected virtual IRestRequest CreateRemoveTagFromSubscriberRequest(string email, string tag)

protected virtual IRestRequest CreateRequest(Method method, string resourceUrl, string requestBodyKey = null, object requestBody = null, string urlSegmentKey = null, string urlSegmentValue = null)

protected virtual RestClient CreateRestClient()

protected virtual IRestRequest CreateUnsubscribeCampaignRequest(string idOrEmail, string campaignId)

protected virtual TResponse Execute<TResponse>(IRestRequest request) where TResponse : DripResponse

protected virtual Task<TResponse> ExecuteAsync<TResponse>(IRestRequest request, CancellationToken cancellationToken) where TResponse : DripResponse

protected virtual TResponse GetResource<TResponse>(string resourceUrl, string urlSegmentKey, string urlSegmentValue) where TResponse : DripResponse

protected virtual Task<TResponse> GetResourceAsync<TResponse>(string resourceUrl, string urlSegmentKey, string urlSegmentValue, CancellationToken cancellationToken) where TResponse : DripResponse

public DripSubscribersResponse GetSubscriber(string idOrEmail)

Fetch a subscriber. See: https://www.getdrip.com/docs/rest-api#fetch_subscriber

public Task<DripSubscribersResponse> GetSubscriberAsync(string idOrEmail, CancellationToken cancellationToken = default)

Fetch a subscriber. See: https://www.getdrip.com/docs/rest-api#fetch_subscriber

protected virtual DripResponse PostBatchResource<TData>(string resourceUrl, string key, TData data)

protected virtual Task<DripResponse> PostBatchResourceAsync<TData>(string resourceUrl, string key, TData data, CancellationToken cancellationToken)

protected virtual TResponse PostResource<TResponse>(string resourceUrl, string requestBodyKey, object requestBody, string urlSegmentKey = null, string urlSegmentValue = null) where TResponse : DripResponse

protected virtual Task<TResponse> PostResourceAsync<TResponse>(string resourceUrl, string requestBodyKey, object requestBody, CancellationToken cancellationToken, string urlSegmentKey = null, string urlSegmentValue = null) where TResponse : DripResponse

public DripResponse RemoveTagFromSubscriber(string email, string tag)

Remove a tag from a subscriber. See: https://www.getdrip.com/docs/rest-api#remove_tag

public Task<DripResponse> RemoveTagFromSubscriberAsync(string email, string tag, CancellationToken cancellationToken = default)

Remove a tag from a subscriber. See: https://www.getdrip.com/docs/rest-api#remove_tag

Subscribe a Subscriber to a campaign. See: https://www.getdrip.com/docs/rest-api#subscribe

public Task<DripSubscribersResponse> SubscribeToCampaignAsync(string campaignId, ModifyDripCampaignSubscriberRequest campaignSubscriber, CancellationToken cancellationToken = default)

Subscribe a Subscriber to a campaign. See: https://www.getdrip.com/docs/rest-api#subscribe

public DripResponse TrackEvent(DripEvent dripEvent)

Track an event. See: https://www.getdrip.com/docs/rest-api#record_event

public Task<DripResponse> TrackEventAsync(DripEvent dripEvent, CancellationToken cancellationToken = default)

Track an event. See: https://www.getdrip.com/docs/rest-api#record_event

Track a collection of events all at once. See: https://www.getdrip.com/docs/rest-api#event_batches

public Task<DripResponse> TrackEventsAsync(IEnumerable<DripEvent> dripEvents, CancellationToken cancellationToken = default)

Track a collection of events all at once. See: https://www.getdrip.com/docs/rest-api#event_batches

public DripSubscribersResponse UnsubscribeFromCampaign(string idOrEmail, string campaignId = null)

Unsubscribe a subscriber globally or from one specific campaign. See: https://www.getdrip.com/docs/rest-api#unsubscribe

public Task<DripSubscribersResponse> UnsubscribeFromCampaignAsync(string idOrEmail, string campaignId = null, CancellationToken cancellationToken = default)

Unsubscribe a subscriber globally or from one specific campaign. See: https://www.getdrip.com/docs/rest-api#unsubscribe