/// <summary>
        /// Add a new list member
        /// <param name="member">Member to add</param>
        /// <param name="list_id">Unique id for the list</param>
        /// </summary>
        internal async Task <dynamic> AddMemberAsync(MCMember member, string list_id)
        {
            string endpoint = Authenticate.EndPoint(TargetTypes.lists, SubTargetType.members, SubTargetType.not_applicable,
                                                    list_id);

            return(await BaseOperation.PostAsync <MCMember>(endpoint, member));
        }
Exemple #2
0
        /// <summary>
        /// Return list member activity for a specific campaign
        /// <param name="campaignId">Unique id for the campaign</param>
        /// <param name="subscriber_hash">The MD5 hash of the lowercase version of the list member’s email address</param>
        /// </summary>
        internal async Task <EmailActivity> GetSubscriberEmailActivityAsync(string campaignId, string subscriber_hash)
        {
            string endpoint = Authenticate.EndPoint(TargetTypes.reports, SubTargetType.email_activity,
                                                    SubTargetType.not_applicable, campaignId, subscriber_hash);

            return(await BaseOperation.GetAsync <EmailActivity>(endpoint));
        }
Exemple #3
0
        /// <summary>
        /// Return recent feedback based on a campaign’s statistics
        /// <param name="campaignId">Campaign Id</param>
        /// </summary>
        internal async Task <CampaignAdvice> GetAdviceAsync(string campaignId)
        {
            string endpoint = Authenticate.EndPoint(TargetTypes.reports, SubTargetType.advice, SubTargetType.not_applicable,
                                                    campaignId);

            return(await BaseOperation.GetAsync <CampaignAdvice>(endpoint));
        }
Exemple #4
0
        /// <summary>
        /// Return top open locations for a specific campaign.
        /// <param name="campaignId">Unique id for the campaign</param>
        /// <param name="subscriber_hash">The MD5 hash of the lowercase version of the list member’s email address</param>
        /// </summary>
        internal async Task <SentTo> GetCampaignRecipientAsync(string campaignId, string subscriber_hash)
        {
            string endpoint = Authenticate.EndPoint(TargetTypes.reports, SubTargetType.sent_to, SubTargetType.not_applicable,
                                                    campaignId, subscriber_hash);

            return(await BaseOperation.GetAsync <SentTo>(endpoint));
        }
        /// <summary>
        /// View queued subscribers for an automated email
        /// <param name="workflow_id">Unique id for the Automation workflow</param>
        /// <param name="workflow_email_id">Unique id for the Automation workflow email</param>
        /// </summary>
        internal async Task <RootAutomationsEmailQueue> GetQueuedSubscriberListAsync(string workflow_id, string workflow_email_id)
        {
            string endpoint = Authenticate.EndPoint(TargetTypes.automations, SubTargetType.emails, SubTargetType.queue,
                                                    workflow_id, workflow_email_id);

            return(await BaseOperation.GetAsync <RootAutomationsEmailQueue>(endpoint));
        }
Exemple #6
0
        /// <summary>
        /// Get feedback about a campaign
        /// <param name="campaignId">Unique id for the campaign</param>
        /// <param name="feedback_id">Unique id for the feedback message.</param>
        /// </summary>
        internal async Task <Feedback> GetFeedbackAsync(string campaignId, string feedback_id)
        {
            string endpoint = Authenticate.EndPoint(TargetTypes.campaigns, SubTargetType.feedback,
                                                    SubTargetType.not_applicable, campaignId, feedback_id);

            return(await BaseOperation.GetAsync <Feedback>(endpoint));
        }
Exemple #7
0
        /// <summary>
        /// Get a list of conversations
        /// </summary>
        internal async Task <RootConversation> GetConversationsAsync()
        {
            string endpoint = Authenticate.EndPoint(TargetTypes.conversations, SubTargetType.not_applicable,
                                                    SubTargetType.not_applicable);

            return(await BaseOperation.GetAsync <RootConversation>(endpoint));
        }
Exemple #8
0
        /// <summary>
        /// Start a batch operation
        /// <param name="bundle"></param>
        /// </summary>
        internal async Task <dynamic> PostBatchOperationAsync(RootBatch bundle)
        {
            string endpoint = Authenticate.EndPoint(TargetTypes.batches, SubTargetType.not_applicable,
                                                    SubTargetType.not_applicable);

            return(await BaseOperation.PostAsync <RootBatch>(endpoint, bundle));
        }
Exemple #9
0
        /// <summary>
        /// Get the status of a batch operation request
        /// <param name="batchId">The unique id for the batch operation</param>
        /// </summary>
        internal async Task <RootBatch> GetBatchReportAsync(string batchId)
        {
            string endpoint = Authenticate.EndPoint(TargetTypes.batches, SubTargetType.not_applicable,
                                                    SubTargetType.not_applicable, batchId);

            return(await BaseOperation.GetAsync <RootBatch>(endpoint));
        }
Exemple #10
0
        /// <summary>
        /// Delete a specific template
        /// <param name="template_id">The unique id for the template</param>
        /// </summary>
        internal async Task <HttpResponseMessage> DeleteTemplateAsync(string template_id)
        {
            string endpoint = Authenticate.EndPoint(TargetTypes.templates, SubTargetType.not_applicable,
                                                    SubTargetType.not_applicable, template_id);

            return(await BaseOperation.DeleteAsync(endpoint));
        }
        /// <summary>
        /// Return statistics for the top-performing domains from a campaign.
        /// <param name="campaignId">Unique id for campaign</param>
        /// </summary>
        internal async Task <DomainPerformance> GetDomainPerformanceAsync(string campaignId)
        {
            string endpoint = Authenticate.EndPoint(TargetTypes.reports, SubTargetType.domain_performance,
                                                    SubTargetType.not_applicable, campaignId);

            return(await BaseOperation.GetAsync <DomainPerformance>(endpoint));
        }
Exemple #12
0
        /// <summary>
        /// Get information about a specific template
        /// <param name="template_id">The unique id for the template.</param>
        /// </summary>
        internal async Task <Template> GetTemplateAsync(string template_id)
        {
            string endpoint = Authenticate.EndPoint(TargetTypes.templates, SubTargetType.not_applicable,
                                                    SubTargetType.not_applicable, template_id);

            return(await BaseOperation.GetAsync <Template>(endpoint));
        }
        /// <summary>
        /// Get a list of Automations
        /// </summary>
        internal async Task <RootAutomation> GetAllAutomationListsAsync(int count = 10)
        {
            string endpoint = Authenticate.EndPoint(TargetTypes.automations, SubTargetType.not_applicable, SubTargetType.not_applicable);

            endpoint = String.Format("{0}?count={1}", endpoint, count);
            return(await BaseOperation.GetAsync <RootAutomation>(endpoint));
        }
        /// <summary>
        /// Get a specific campaign report
        /// <param name="campaignId">Campaign Id</param>
        /// </summary>
        internal async Task <ReportOverview_Campaign> GetCampaignOverviewAsync(string campaignId)
        {
            string endpoint = Authenticate.EndPoint(TargetTypes.reports, SubTargetType.not_applicable,
                                                    SubTargetType.not_applicable, campaignId);

            return(await BaseOperation.GetAsync <ReportOverview_Campaign>(endpoint));
        }
        /// <summary>
        /// Delete interests in a specific category
        /// <param name="list_id">Unique id for the list</param>
        /// <param name="interest_category_id">Unique id for the interest category</param>
        /// <param name="interest_id">The specific interest or ‘group name</param>
        /// </summary>
        internal async Task <HttpResponseMessage> DeleteInterestCategoryInterestAsync(string list_id,
                                                                                      string interest_category_id,
                                                                                      string interest_id)
        {
            string endpoint = Authenticate.EndPoint(TargetTypes.lists, SubTargetType.interest_categories,
                                                    SubTargetType.interests, list_id, interest_category_id);

            endpoint = String.Format("{0}/{1}", endpoint, interest_id);

            HttpResponseMessage result;

            using (var client = new HttpClient())
            {
                try
                {
                    Authenticate.ClientAuthentication(client);

                    result = await client.DeleteAsync(endpoint).ConfigureAwait(false);
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }
            return(result);
        }
        /// <summary>
        /// Return A list of reports for child campaigns of a specific parent campaign.
        /// <param name="campaignId">Campaign Id</param>
        /// </summary>
        internal async Task <Sub_Reports> GetChildCampaignReportsAsync(string campaignId)
        {
            string endpoint = Authenticate.EndPoint(TargetTypes.reports, SubTargetType.sub_reports,
                                                    SubTargetType.not_applicable, campaignId);

            return(await BaseOperation.GetAsync <Sub_Reports>(endpoint));
        }
        /// <summary>
        /// Get information about a specific workflow email
        /// <param name="workflow_id">Unique id for the Automation workflow</param>
        /// <param name="workflow_email_id">Unique id for the Automation workflow email</param>
        /// </summary>
        internal async Task <AutomationsEmail> GetAutomationEmailInfoAsync(string workflow_id, string workflow_email_id)
        {
            string endpoint = Authenticate.EndPoint(TargetTypes.automations, SubTargetType.emails,
                                                    SubTargetType.not_applicable, workflow_id, workflow_email_id);

            return(await BaseOperation.GetAsync <AutomationsEmail>(endpoint));
        }
        /// <summary>
        /// Return a summary of social activity for the campaign, tracked by EepURL.
        /// <param name="campaignId">Unique id for campaign</param>
        /// </summary>
        internal async Task <Eepurl> GetEepUrlActivityAsync(string campaignId)
        {
            string endpoint = Authenticate.EndPoint(TargetTypes.reports, SubTargetType.eepurl, SubTargetType.not_applicable,
                                                    campaignId);

            return(await BaseOperation.GetAsync <Eepurl>(endpoint));
        }
Exemple #19
0
        /// <summary>
        /// Delete a campaign feedback message
        /// <param name="campaignId">Unique id for the campaign</param>
        /// <param name="feedback_id">Unique id for the feedback message.</param>
        /// </summary>
        internal async Task <HttpResponseMessage> DeleteFeedbackAsync(string campaignId, string feedback_id)
        {
            string endpoint = Authenticate.EndPoint(TargetTypes.campaigns, SubTargetType.feedback,
                                                    SubTargetType.not_applicable, campaignId, feedback_id);

            return(await BaseOperation.DeleteAsync(endpoint));
        }
Exemple #20
0
        /// <summary>
        /// Get a specific campaign folder
        /// <param name="folder_id">Unique id for the campaign folder</param>
        /// </summary>
        internal async Task <CampaignFolder> GetCampaignFolderAsync(string folder_id)
        {
            string endpoint = Authenticate.EndPoint(TargetTypes.campaign_folders, SubTargetType.not_applicable,
                                                    SubTargetType.not_applicable, folder_id);

            return(await BaseOperation.GetAsync <CampaignFolder>(endpoint));
        }
Exemple #21
0
        /// <summary>
        /// Return top open locations for a specific campaign.
        /// <param name="campaignId">Unique id for the campaign</param>
        /// </summary>
        internal async Task <RootSentTo> GetRecipientsInfoAsync(string campaignId)
        {
            string endpoint = Authenticate.EndPoint(TargetTypes.reports, SubTargetType.sent_to, SubTargetType.not_applicable,
                                                    campaignId);

            return(await BaseOperation.GetAsync <RootSentTo>(endpoint));
        }
Exemple #22
0
        /// <summary>
        /// Delete a campaign folder
        /// <param name="folder_id">Unique id for the campaign folder</param>
        /// </summary>
        internal async Task <HttpResponseMessage> DeleteCampaignFolderAsync(string folder_id)
        {
            string endpoint = Authenticate.EndPoint(TargetTypes.campaign_folders, SubTargetType.not_applicable,
                                                    SubTargetType.not_applicable, folder_id);

            return(await BaseOperation.DeleteAsync(endpoint));
        }
        /// <summary>
        /// Return top open locations for a specific campaign.
        /// <param name="campaignId">Unique id for the campaign</param>
        /// </summary>
        internal async Task <RootLocation> GetTopLocationAsync(string campaignId)
        {
            string endpoint = Authenticate.EndPoint(TargetTypes.reports, SubTargetType.locations, SubTargetType.not_applicable,
                                                    campaignId);

            return(await BaseOperation.GetAsync <RootLocation>(endpoint));
        }
        /// <summary>
        /// Send a campaign
        /// <param name="campaignId">Unique id for the campaign</param>
        /// </summary>
        internal async Task <dynamic> SendCampaignAsync(string campaignId)
        {
            string endpoint = Authenticate.EndPoint(TargetTypes.campaigns, SubTargetType.actionSend, SubTargetType.not_applicable,
                                                    campaignId);

            return(await BaseOperation.PostAsync(endpoint));
        }
        /// <summary>
        /// Get conversation messages
        /// <param name="conversation_id">Unique id for the campaign</param>
        /// <param name="message_id">The unique id for the conversation message</param>
        /// </summary>
        internal async Task <ConversationMessage> GetMessageAsync(string conversation_id, string message_id)
        {
            string endpoint = Authenticate.EndPoint(TargetTypes.conversations, SubTargetType.messages,
                                                    SubTargetType.not_applicable, conversation_id, message_id);

            return(await BaseOperation.GetAsync <ConversationMessage>(endpoint));
        }
Exemple #26
0
        /// <summary>
        /// Return statistics for the top-performing domains from a campaign.
        /// <param name="campaignId">Unique id for campaign</param>
        /// </summary>
        internal async Task <RootUnsubscribe> GetUnsubscriberListAsync(string campaignId)
        {
            string endpoint = Authenticate.EndPoint(TargetTypes.reports, SubTargetType.unsubscribed,
                                                    SubTargetType.not_applicable, campaignId);

            return(await BaseOperation.GetAsync <RootUnsubscribe>(endpoint));
        }
Exemple #27
0
        /// <summary>
        /// View all subscribers removed from a workflow
        /// <param name="workflow_id">Unique id for the Automation workflow</param>
        /// </summary>
        internal async Task <RemovedSubscriber> GetRemovedSubscriberListAsync(string workflow_id)
        {
            string endpoint = Authenticate.EndPoint(TargetTypes.automations, SubTargetType.removed_subscribers,
                                                    SubTargetType.not_applicable, workflow_id);

            return(await BaseOperation.GetAsync <RemovedSubscriber>(endpoint));
        }
Exemple #28
0
        /// <summary>
        /// Get information about a specific Automation workflow
        /// <param name="workflow_id">Unique id for the Automation workflow</param>
        /// </summary>
        internal async Task <MCAutomation> GetAutomationAsync(string workflow_id)
        {
            string endpoint = Authenticate.EndPoint(TargetTypes.automations, SubTargetType.not_applicable,
                                                    SubTargetType.not_applicable, workflow_id);

            return(await BaseOperation.GetAsync <MCAutomation>(endpoint));
        }
Exemple #29
0
        /// <summary>
        /// Get the send checklist for a campaign
        /// <param name="campaign_id">Unique id for the campaign</param>
        /// </summary>
        internal async Task <RootCheckList> GetCheckListAsync(string campaign_id)
        {
            string endpoint = Authenticate.EndPoint(TargetTypes.campaigns, SubTargetType.send_checklist,
                                                    SubTargetType.not_applicable, campaign_id);

            return(await BaseOperation.GetAsync <RootCheckList>(endpoint));
        }
        /// <summary>
        /// Return click details for a specific link
        /// <param name="campaignId">Campaign Id</param>
        /// <param name="linkId">The id for the link</param>
        /// </summary>
        internal async Task <ClickReports> GetAllSubscribersInfoAsync(string campaignId, string linkId)
        {
            string endpoint = Authenticate.EndPoint(TargetTypes.reports, SubTargetType.click_details, SubTargetType.members,
                                                    campaignId, linkId);

            return(await BaseOperation.GetAsync <ClickReports>(endpoint));
        }