Genesys Cloud - Main

 View Only

Discussion Thread View
  • 1.  API to Upload Contact List

    Posted 01-25-2021 15:43
    Hi,

    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 'https://apps.mypurecloud.com/uploads/v2/contactlist' -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 'https://apps.mypurecloud.com/uploads/v2/contactlist' -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?
    #Integrations

    ------------------------------
    Daniel Rizete
    Financial Debt Recovery
    ------------------------------


  • 2.  RE: API to Upload Contact List

    Posted 03-20-2023 16:51

    Better late than never. Here's a working curl example to import into Postman. You might need to change "apps.usw2.pure.cloud".

    id

    Id of your contact list to upload to

    file

    binary file data

    fileType

    contactlist

    contact-id-name

    The column name from your file to use as the contact id.

    Documented here https://developer.genesys.cloud/routing/outbound/uploadcontactlists

    curl --location 'https://apps.usw2.pure.cloud/uploads/v2/contactlist' \
    --header 'Authorization: Bearer ' \
    --form 'id=""' \
    --form 'file=@""' \
    --form 'fileType="contactlist"' \
    --form 'contact-id-name=""'

    Response:

    {
        "correlationId": ""
    }


    ------------------------------
    Brandon Hall
    Eventus Solutions Group
    ------------------------------



Need Help finding something?

Check out the Genesys Knowledge Network - your all-in-one access point for Genesys resources