Genesys Cloud - Main

 View Only
Discussion Thread View
  • 1.  API Explorer and Data Actions

    Posted 03-23-2023 12:34

    I've a bit of a struggle understanding the formatting in the API explorer between GET and POST commands and the translation into Data Actions that work with the API's

    I'm trying to add a new record to  a data table using 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" }

    When I use the Get command I get a specific layout of that table like this:

    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 from the data table so it's not having any entries and try to recreate it using the POST command I get an 400 Error:

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

    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"
    }
    }

    Where do I go wrong here?

    The Table layout is extremely simple:

    Name: OBD LIST RESET ALERT

    Division:  Telecoms

    Notes (optional): 

    Reference Key Label: ATTEMPT

    Custom Fields:

         Phone Number:

         LOGGED:

    I would be grateful if one can explain where I am going wrong. I'm new to this and the API course did not give me enough insight to understand where I am making a mistake.


    #Unsure/Other

    ------------------------------
    Ruud Reinold
    BNP Paribas Personal Finance UK
    ------------------------------


  • 2.  RE: API Explorer and Data Actions

    Posted 03-23-2023 15:22

    Hi Ruud

    I recognize your name; were we in the same API class early Dec last year? I hope all is good in your world. I agree there is a lot more to learn than the course covered.

    Seems like you have changed the schema in the Request Body of Post API that's why you are getting 400 error. Can you try this in the Request Body to create the record.

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

    Cheers



    ------------------------------
    Muhammad Zubair Awan
    ------------------------------



  • 3.  RE: API Explorer and Data Actions

    Posted 03-24-2023 05:16
    Yes, we were in the same class last year.
    It seems that there is a difference between the older and newer API explorer versions when you look at the request body that's why I ran into these issues because I'm using the newer version. I need to write it up next week and talk to my reseller so that they can raise it with Genesys. Lesson learned to compare the two versions of API explorers 


    Kind regards,
    Ruud Reinold

    Telecom Manager
    BNP Paribas Personal Finance UK
    *********************************************************************  BNP Paribas Personal Finance is a trading style of Creation Financial Services Limited. Registration Number: England 1091883. Registered Office: Chadwick House, Blenheim Court, Solihull, West Midlands, B91 2AA. Creation Financial Services Limited is authorised and regulated by the Financial Conduct Authority.  BNP Paribas Personal Finance is a trading style of Creation Consumer Finance Limited.  Registration Number: NI32565. Registered Office: 4th – 6th Floor, Wellington Buildings, 2-4 Wellington Street, Belfast, BT1 6HT. Creation Consumer Finance Limited is authorised and regulated by the Financial Conduct Authority.  This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom it is addressed. Any views or options presented are solely those of the author and do not necessarily represent those of BNP Paribas Personal Finance. Internet communications are not secure and therefore BNP Paribas Personal Finance does not accept legal responsibility for the contents of this message. If you are not the intended recipient, you are hereby notified that you have received this e-mail in error and that any use, disclosure, dissemination, forwarding, printing, or copying of this e-mail is strictly prohibited.  BNP Paribas Personal Finance will not be liable for direct, special, indirect or consequential damage arising from alterations of the contents of this message by a third party or as a result of any VIRUS being passed on.  Any pricing details or other offers delivered via e-mail are not binding on BNP Paribas Personal Finance. If appropriate, an official quotation confirming pricing and bearing an authorisation signature will be provided by post or fax on request.  If you have received this e-mail in error, please notify the sender immediately and delete the e-mail without taking any copies or forwarding it elsewhere.  ********************************************************************* 





  • 4.  RE: API Explorer and Data Actions

    Posted 03-24-2023 15:12

    I see what you mean. Yes the schema looks incorrect in the new API Explorer 

    Cheers
    Zubair



    ------------------------------
    Muhammad Zubair Awan
    ------------------------------



Need Help finding something?

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