示例#1
0
        public async Task PathCampaign(Campaigns campaigns, string server, string campaignId)
        {
            HttpClientPath PathAsync = new HttpClientPath(Apihelper.apiClient);
            string         json      = JsonConvert.SerializeObject(campaigns);
            StringContent  data      = new StringContent(json, Encoding.UTF8, "application/json");

            using (HttpResponseMessage response = await PathAsync.PatchAsync($"https://{server}.api.mailchimp.com/3.0/campaigns/{campaignId}", data))
            {
                //if (response.IsSuccessStatusCode)
                //    result = response.Content.ReadAsStringAsync().Result;
            }
        }
示例#2
0
        public async Task PathSingleSend(SingleSend singleSend, string singleSendId)
        {
            HttpClientPath PathAsync = new HttpClientPath(Apihelper.apiClient);
            string         json      = JsonConvert.SerializeObject(singleSend);
            StringContent  data      = new StringContent(json, Encoding.UTF8, "application/json");

            using (HttpResponseMessage response = await PathAsync.PatchAsync($"https://api.sendgrid.com/v3/marketing/singlesends/{singleSendId}", data))
            {
                //if (response.IsSuccessStatusCode)
                //    result = response.Content.ReadAsStringAsync().Result;
            }
        }
示例#3
0
        public async Task PathInterest(Group interest, string interestId, string server, string listId)
        {
            HttpClientPath PathAsync = new HttpClientPath(Apihelper.apiClient);
            string         json      = JsonConvert.SerializeObject(interest);
            StringContent  data      = new StringContent(json, Encoding.UTF8, "application/json");

            using (HttpResponseMessage response = await PathAsync.PatchAsync($"https://{server}.api.mailchimp.com/3.0/lists/{listId}/interest-categories/53afadfa03/interests/{interestId}", data))
            {
                //if (response.IsSuccessStatusCode)
                //    result = response.Content.ReadAsStringAsync().Result;
            }
        }