Legacy Dev Forum Posts

 View Only

Sign Up

Data table query not matching with adding format

  • 1.  Data table query not matching with adding format

    Posted 06-05-2025 18:25

    Ruud_Reinold | 2023-03-20 17:42:00 UTC | #1

    Hi all,

    I hope that someone from the Outbound Development team can help me out to understand why I am unable to add records to an existing Contact list please?

    I have a contact list with the following layout: Account Number,Customer Name,Arrears,Balance,Product,Phone number 1,Phone number 2,Phone number 3,ABANDONED,DNC Added 10470,Mr H Brown,203,7361,WTP,+447747457851,+447747457851,+447768530258

    The unique GUID is: 9cd6e815-0714-4b4d-a545-f47ad5a10803

    When I query the list using GET /api/v2/outbound/contactlists/{contactListId} - Get a dialer contact list.

    It returns me the same layout.

    When I query the only record in there using: POST /api/v2/outbound/contactlists/{contactListId}/contacts/bulk - Get contacts from a contact list.

    It returns me the data in the format: [ { "id": "10470", "contactListId": "9cd6e815-0714-4b4d-a545-f47ad5a10803", "data": { "Account Number": "10470", "Customer Name": "Mr H Brown", "Arrears": "203", "Balance": "7361", "Product": "WTP", "Phone number 1": "07747457851", "Phone number 2": "+447747457851", "Phone number 3": "+447768530258", "ABANDONED": "", "DNC Added": "" }, "callable": true, "phoneNumberStatus": { "Phone number 3": { "callable": true }, "Phone number 2": { "callable": true }, "Phone number 1": { "callable": true } }, "contactableStatus": { "Email": { "contactable": true } }, "selfUri": "/api/v2/outbound/contactlists/9cd6e815-0714-4b4d-a545-f47ad5a10803/contacts/10470" } ]

    When I try to add a record I notice it does not work and expects a different format? Notice the added "":{ entry at line 6 (- in bold -) [ { "id": "10470", "contactListId": "9cd6e815-0714-4b4d-a545-f47ad5a10803", "data": { "": { "Account Number": "10470", "Customer Name": "Mr H Brown", "Arrears": "203", "Balance": "7361", "Product": "WTP", "Phone number 1": "+447747457851", "Phone number 2": "+447747457851", "Phone number 3": "+447768530258", "ABANDONED": "", "DNC Added": "" } }, "callable": true, "phoneNumberStatus": { "Phone number 1": { "callable": true }, "Phone number 2": { "callable": true }, "Phone number 3": { "callable": true } }, "contactableStatus": { "Email": { "contactable": true } } } ]

    Why does the input generate the additional "":{} entry in the column list? Trying to remove it and the whole datablock get's removed and the API doesn’t accept this input either

    The addition fails with a 400 error: The contact columns do not match what is required in the list

    How do I add a record to the call list? I can’t find any additional help on this.


    Ruud_Reinold | 2023-03-23 16:20:08 UTC | #2

    I'm now having the same struggle with the POST API for Data Tables POST

    /api/v2/flows/datatables/{datatableId}/rows

    Create a new row entry for the datatable. Will add the passed in row entry to the datatable with the given datatableId after verifying it against the schema. The DataTableRow should be a json-ized' stream of key -> value pairs { "Field1": "XYZZY", "Field2": false, "KEY": "27272" }

    GET /api/v2/flows/datatables/{datatableId}/rows/{rowId}

    datatableId string, required: a9953fc3-b6c5-4fde-a819-92ba7b916b6c - id of datatable rowId string, required: ATTEMPT - The key for the row Returns:

    { "PHONE NUMBER": "tel:+447747457851", "LOGGED": "2023-03-23T15:46:08.639Z", "key": "ATTEMPT" }

    When I clear that entry out and put it back in I get an Error:

    datatableId string, required: a9953fc3-b6c5-4fde-a819-92ba7b916b6c - id of datatable

    Request Body { "ATTEMPT": { "PHONE NUMBER": "tel:+447747457851", "LOGGED": "2023-03-23T15:46:08.639Z", "key": "ATTEMPT" } }

    What do I miss here? I'm new to this and the only certified person in the company for Genesys core and dialler so no pressure to resolve these issues :slight_smile:


    Jerome.Saint-Marc | 2023-03-23 17:25:18 UTC | #3

    Hello,

    The correct body to create a new row with POST /api/v2/flows/datatables/{datatableId}/rows should be:

    { "PHONE NUMBER": "tel:+447747457851", "LOGGED": "2023-03-23T15:46:08.639Z", "key": "ATTEMPT" }

    Regards,


    Ruud_Reinold | 2023-03-23 17:11:40 UTC | #4

    Why doesn't the API explorer allow me to add that?

    It transforms it to this:

    In fact the OLD API explorer does allow that code.


    Jerome.Saint-Marc | 2023-03-23 17:19:01 UTC | #5

    Hello,

    The API definition might be incorrect/wrong for this endpoint. The API explorer leverages these definitions to determine the build of the Request Body. Please open a case with Genesys Cloud Care to report the incorrect API definition that's causing that format in API Explorer. The issue with the API definition has to be reported via Care to be investigated and fixed.

    Regards,


    Ruud_Reinold | 2023-03-23 17:25:08 UTC | #6

    Thanks You have saved my life today !


    Jerome.Saint-Marc | 2023-03-23 17:43:30 UTC | #7

    Hello,

    Regarding your question on adding a record on the contact list, I think it is the same API definition issue. I just created a contact list to test the API endpoint. The body should be:

    [ { "id": "10470", "contactListId": "9cd6e815-0714-4b4d-a545-f47ad5a10803", "data": { "Account Number": "10470", "Customer Name": "Mr H Brown", "Arrears": "203", "Balance": "7361", "Product": "WTP", "Phone number 1": "+447747457851", "Phone number 2": "+447747457851", "Phone number 3": "+447768530258", "ABANDONED": "", "DNC Added": "" }, "callable": true, "phoneNumberStatus": { "Phone number 3": { "callable": true }, "Phone number 2": { "callable": true }, "Phone number 1": { "callable": true } }, "contactableStatus": { "Email": { "contactable": true } } } ]

    If a contact already exists (the id=10470) in your calling list, this may generate an error I guess. So make sure to use a different/new contact when adding the record.

    Regards,


    Ruud_Reinold | 2023-03-23 17:56:16 UTC | #8

    Yes that is the same issue, I will send a detailed report to our reseller to raise it with Genesys.


    system | 2023-04-23 17:56:48 UTC | #9

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


    This post was migrated from the old Developer Forum.

    ref: 19002