I've used postman to create all the calls for an application we're building... I'm converting those calls to C#, so far everything has been working great, Auth, Token Refresh, getting campaign info, getting contact Lists. What i can't get working is the bulk import from CSV. static async Task ImportContactsFromCsvAsync() { try { //var client = new HttpClient(); //there is one global one for the whole program var request = new HttpRequestMessage(HttpMethod.Post, https://api.cc.email/v3/activities/contacts_file_import); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Bearer "+accessToken); var content = new MultipartFormDataContent(); content.Add(new StreamContent(File.OpenRead("CCTEST2.csv")), "file", "CCTEST2.csv"); content.Add(new StringContent("afefdcac-7fe9-11ee-8918-fa163e504c74"), "list_ids"); request.Content = content; var response = await client.SendAsync(request); //response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); } catch (Exception ex) { Console.WriteLine($"An error occurred: {ex.Message}"); } return; } [{"error_key":"http.status.bad_request","error_message":"Unable to parse the request body as multipart form-data."}] I keep getting bad request, i've started going down the route of manually building the request with lower level functions, but so far have not had any luck.
... View more