Error updating (csv) dncList by api

Import failed after running the endpoint to update a dncList

The service returns 200 and the correlationId.

"https://apps.mypurecloud.com/uploads/v2/contactlist".
The corresponding data is updated in the body

  • id
  • file
  • fileType -> dnclist
  • contact-id-name -> PhoneId_1

I upload the same csv manually in the portal and it works correctly. A single key column which is PhoneId_1.

I use the same endpoint to update contactList and it works correctly (setting the fileType to contactlist).

Thanks.

Hi,

If the service is returning 200 then that means it has uploaded successfully. Are you getting an error message back from the endpoint?

Hi,

The error is only shown in purecloud, in the dnclist with a warning with the message "Import failed"

Before running the upload endpoint, I run the import status with the dnclistId and the message is as follows:

https: // api. {{Environment}} / api / v2 / outbound / dnclists / {dnclistId} / importstatus
{
"totalRecords": 0,
"completedRecords": 0,
"percentComplete": 0
}

After running the upload, I run the import status again and the message is as follows:

https: // api. {{Environment}} / api / v2 / outbound / dnclists / {dnclistId} / importstatus

{

"state": "FAILED",

"totalRecords": 0,

"completedRecords": 0,

"percentComplete": 0,

"failureReason": "NO_COLUMNS_DEFINED"

}

In the file (csv) I specify a column PhoneNumbers and then several phone numbers.

Hi Daniel,

Based on the fact you are getting a 200 response, the file is successfully loading to the cloud, but the file is malformed in some way. Have you included in the first row, the column names, and do they match what is being expected in the portal?

If they do, then I would open a ticket with our Care team, refer to this post. They can then have the engineering group begin to look at it.

Thanks,
John Carnell
Manager, Developer Engagement

Hi John,

We have been with a ticket in Care team for several weeks, they still have not found a solution.

And we validate that the csv is correct.

Thanks.

Hello Daniela,

I just did a test with the Genesys Desktop UI, to see what requests it was sending (via Chrome Dev Tools - Network).
And I think there is possibly a problem with the description in the dev center page on Upload Contact Lists.
The information is accurate for Outbound Contact Lists. But i see a different body in case of DNC List.

Could you please try the following?

Assuming you have created your DNC List (Internal) with a single column for the phone numbers (I mean one number in this column, per row).

If you want to add/append numbers, your CSV file will also need to have a single column for the phone numbers.
The name of that column can be whatever you want, as it apparently needs to be sent in the request body (so that Genesys Cloud knows what column it has to read for phone numbers).

So let's say my column name in the CSV is "NewPhoneNumbers", the request body will be the following:

id: (the id of my dnc list)
file: (the content of my csv as binary)
fileType: dnclist
phoneColumns: ["NewPhoneNumbers"]

Regards,

Hello Jerome,

It is exactly what I am doing.
Respecting the name of the only column that has the phones, so that you can identify it. Then I specify the file type, the identifier of the dnclist and a csv that previously provided it manually on the purecloud page.

But sadly I keep getting Import Failed.

Regards

Hello,

No - what I wrote above was to remove the contact-id-name parameter.

Then add one with key: phoneColumns
And with value: ["PhoneId_1"]
(not just PhoneId_1 but ["PhoneId_1"])

Regards,

1 Like

Thank you very much.

Finally, after weeks of unsuccessful attempts.

It finally worked!

Thank you very much!

PD: Please update the documentation with this information.

https://developer.mypurecloud.com/api/rest/v2/outbound/uploadcontactlists.html

You are right, it was to search a little more thoroughly and there was the answer.

Thank you

Jerome thanks for working through this. I am going to open a ticket with the dev team that owns this documentation, reference this thread and make sure they update the documentation.

Daniela: Sorry you had to go through this headache. I know how frustrating it can be when the documentation is incorrect.

Thanks,
John Carnell
Manager, Developer Engagement

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.