Genesys Cloud - Main

 View Only

Sign Up

  Thread closed by the administrator, not accepting new replies.
  • 1.  API call for updating datatable

    Posted 12-14-2020 03:47
    No replies, thread closed.
    Hi Community,

    I am stuck With a API call issue, I have a tabel that i am trying to update.

    I give in this request:
    {"Blocked_Numbers":"+31612345678","Naam":"Test name"}

    And it gives me this output:
    {
    "message": "'' is too short\n\nFailed validating 'minLength' in schema['properties']['key']:\n {'$id': '/properties/key',\n 'displayOrder': 0,\n 'maxLength': 256,\n 'minLength': 1,\n 'title': 'Blocked_Numbers',\n 'type': 'string'}\n\nOn instance['key']:\n ''",
    "code": "flows.datatables.schema.exception",
    "status": 400,
    "messageParams": {},
    "contextId": "3936549f-2528-4659-a881-b4e753b59bf2",
    "details": [],
    "errors": []
    }


    The example states this:
    /api/v2/flows/datatables/{datatableId}/rows/{rowId}
    Updates a row with the given rowId (the value of the key field) to the new values. The DataTableRow should be a json-ized' stream of key -> value pairs { "Field1": "XYZZY", "Field2": false, "KEY": "27272" }

    What am i doing wrong?
    #ArchitectureandDesign

    ------------------------------
    Donny Willems
    KEMBIT B.V.
    ------------------------------


  • 2.  RE: API call for updating datatable

    Posted 12-14-2020 04:39
    No replies, thread closed.
    Hello @Donny Willems,

    Would it be possible to provide the structure or screenshot of the Datable you would like to update please ?

    Regards,

    CHARAF​

    ------------------------------
    Charaf Eddine Chemlal
    NTT France
    ------------------------------



  • 3.  RE: API call for updating datatable

    Posted 12-14-2020 04:41
    No replies, thread closed.

    Sure, it's a simple table that blocks phonenummers:



    ------------------------------
    Donny Willems
    KEMBIT B.V.
    ------------------------------



  • 4.  RE: API call for updating datatable

    Posted 12-14-2020 04:58
    No replies, thread closed.
    Thank you for providing your screenshot.

    As I can see, Blocked_Numbers is the Reference Key of your DataTable.

    In order to update the field Naamn you can use the API :/api/v2/flows/datatables/{datatableId}/rows/{rowId} 
    datatableId : Datatable ID you can gather in the URL when you open up the Datatable
    rowId : +3228085150

    in the Body, please include the Key as the following : 

    Results: 


    Hope it helps !

    Kind Regards,

    CHARAF


    ------------------------------
    Charaf Eddine Chemlal
    NTT France
    ------------------------------



  • 5.  RE: API call for updating datatable

    Posted 12-14-2020 05:17
    No replies, thread closed.

    I made a new entry for testing:

    Filled in this:

    Still gives me an error:


    ------------------------------
    Donny Willems
    KEMBIT B.V.
    ------------------------------



  • 6.  RE: API call for updating datatable

    Posted 12-14-2020 05:37
    Edited by Charaf Eddine Chemlal 12-14-2020 05:42
    No replies, thread closed.
    I have added a new entry as you did and I could update it without any problem.




    Result : 



    ------------------------------
    Charaf Eddine Chemlal
    NTT France
    ------------------------------