Genesys Cloud (formerly PureCloud)

Discussion Thread View

API to Upload Contact List

  • 1.  API to Upload Contact List

    Posted 01-25-2021 15:43

    I'm trying to automate the upload contact list process. I try to use the /uploads/v2/contactlist API but without success. Follow how I'm calling the API:

    $headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
    $headers.Add("Content-Type", "application/json")
    $headers.Add("Content-Type", "multipart/form-data; boundary=----WebKitFormBoundary")
    $body = '{"id":"f40f5640-3135-4d2f-bd72-b8f2a5a1dc3e","file":"[path and file].csv","filetype":"contactlist","contact-id-name":"DEBTOR"}'
    $response = Invoke-RestMethod '' -Method 'POST' -Headers $headers -Body $body

    I tried to use the WebRequest method too but every call returns 400 Bad Request without any other information.

    $response = Invoke-WebRequest -Uri '' -Method 'POST' -Headers $headers -Body $body

    Another way I tried was using the postman to test. Unfortunately without success too.

    Can anyone give me a direction to upload a contact list?

    Daniel Rizete
    Financial Debt Recovery