Internal server error when uploading Customer List or Customer List Item.

Anonymous
2025-03-06T15:31:56+00:00

I am currently uploading the csv with the contents below

Type,Status,Id,Parent Id,Client Id,Modified Time,Name,Description,Scope,Audience,Action Type

Format Version,,,,,,6.0,,,,,,

Customer List,Active,-1,,af32d10b-7e30-b9e3-3384-3a187e3a3d40,CCYY-03-DDT11:22:52,New Dealerverse Name,New Customer List Dealerverse Description,Customer,New Customer List,Add

to the given url from IBulkService the code is below

var bulkService = new ServiceClient

var request = new GetBulkUploadUrlRequest()

{

    AccountId = long.Parse(customerId),

    ResponseMode = ResponseMode.ErrorsAndResults,

};

var response = await bulkService.CallAsync((s, r) => s.GetBulkUploadUrlAsync(r), request);

string uploadUrl = response.UploadUrl;

using (var httpClient = new HttpClient())

{

    using (var fileStream = new FileStream(csvFilePath, FileMode.Open, FileAccess.Read))

    using (var content = new StreamContent(fileStream))

    {

        content.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("text/plain");

        HttpResponseMessage uploadResponse = await httpClient.PostAsync(response.UploadUrl, content);

        if (uploadResponse.IsSuccessStatusCode)

        {

            Console.WriteLine("Bulk file uploaded successfully.");

        }

        else

        {

            Console.WriteLine($"Upload failed. Status Code: {uploadResponse.StatusCode}");

            string errorDetails = await uploadResponse.Content.ReadAsStringAsync();

            Console.WriteLine($"Error Details: {errorDetails}");

            return false;

        }

    }

}

The problem is in this line HttpResponseMessage uploadResponse = await httpClient.PostAsync(response.UploadUrl, content);

The response is IsSuccessStatusCode = false

And when you look at the response error details it shows Internal Server Error.

Please help.

Microsoft Advertising | Ad delivery | Audience placements

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Anonymous
    2025-03-06T16:21:46+00:00

    Hi Hasmer,

    We recommend that you ask your API question at the API Development Forum. In that forum you will find our API development engineers and partners who work with our APIs every day.

    For immediate assistance with API, you are always welcome to contact support directly.

    Thank you,

    Shaynne | Microsoft Advertising Support Specialist | 800-518-5689

    0 comments No comments
  2. Anonymous
    2025-03-06T20:51:42+00:00

    Thank you.

    0 comments No comments