public ActionResult BatchMember(string listId, string segmentId, BatchSegmentMembers batchSegmentMembers) { Task <BatchSegmentMembersResponse> result = null; if (listId != null && segmentId != null && batchSegmentMembers != null) { result = mailChimpManager.ListSegments.BatchMemberAsync(listId, segmentId, batchSegmentMembers); } return(View(result.Result)); }
public async Task <BatchSegmentMembersResponse> BatchMemberAsync(string listId, string segmentId, BatchSegmentMembers batchSegmentMembers) { using (var client = CreateMailClient(string.Format(BaseUrl + "/", listId))) { var response = await client.PostAsJsonAsync(segmentId, batchSegmentMembers).ConfigureAwait(false); await response.EnsureSuccessMailChimpAsync().ConfigureAwait(false); var memberResponse = await response.Content.ReadAsAsync <BatchSegmentMembersResponse>().ConfigureAwait(false); return(memberResponse); } }