Genesys Cloud - Main

 View Only

Sign Up

  Thread closed by the administrator, not accepting new replies.
  • 1.  Add new contact to Contactlist via API

    Posted 05-18-2021 06:58
    Edited by Dennies Salenga 05-18-2021 06:58
    No replies, thread closed.
    Hi, I'm currently making a dataAction that will add a contact to a outbound contactlist by using the API "/api/v2/outbound/contactlists/{contactListId}/contact"  with the following  

    [
    {
    "id": "x00001",
    "contactListId": "0x0x0x0x-0x0x-0x00-x000-x0x0xxx0000",
    "data":
    {
    "Customer_Name":"${input.Customer_Name}",
    "Customer_Phone":"${input.Customer_Phone}",
    "Notes":"${input.Notes}"
    },
    "callable": true,
    "phoneNumberStatus": {"callable": true}
    }
    ]

    But I been stuck for sometime now because of the following error when ever I tried to test/run it.

    {
      "message": "The request could not be understood by the server due to malformed syntax.",
      "code": "bad.request",
      "status": 400,
      "messageParams": {},
      "contextId": "e7d8a712-3588-4297-bfa5-04746d4659e3",
      "details": [
        {
          "errorCode": "ACTION.REMOTE_ENDPOINT"
        }
      ],
      "errors": [
        {
          "message": "REST call for action execute failed. Message:Request to backend service failed.  Response from web service: {\"message\":\"The request could not be understood by the server due to malformed syntax.\",\"code\":\"bad.request\",\"status\":400,\"contextId\":\"777b1937-4bf0-49c1-bcda-fb6de3c7ccf9\",\"details\":[],\"errors\":[]} [e7d8a712-3588-4297-bfa5-04746d4659e3]",
          "code": "BAD_REQUEST",
          "status": 400,
          "messageParams": {},
          "details": [],
          "errors": []
        }
      ]
    }

    Is there someone who is kindly enough to help me point out my mistake or guide me on what should I do in order to fix the error.
    Thanks

    #Outbound

    ------------------------------
    Dennies Salenga
    ------------------------------


  • 2.  RE: Add new contact to Contactlist via API

    Posted 05-18-2021 07:19
    No replies, thread closed.
    Hi Dennies,

    It seems like something wrong with values you passing into request body.
    Can be something wrong with "id", "contactListId". Also you can try to put true as "true".

    ------------------------------
    Taras Buha
    taras@noralogix.com
    www.noralogix.com
    ------------------------------



  • 3.  RE: Add new contact to Contactlist via API

    Posted 05-18-2021 07:41
    No replies, thread closed.
    Hi Taras,

    Thank you very much for your reply, really do appreciate it.
    I have checked the value that I am passing to the "id" & "contactListId" so far it looks fine though, I also tried to put " besides the true but still the same..

    ------------------------------
    Dennies Salenga
    JUMA AL MAJID EST.
    ------------------------------



  • 4.  RE: Add new contact to Contactlist via API

    Posted 05-18-2021 10:50
    No replies, thread closed.
    You need to make sure your Data set is exactly the same - even if they are empty sets.  I like to export a contact and then use that output for my input when inserting into the list.

    ------------------------------
    Robert Wakefield-Carl
    Avtex Solutions, LLC
    Contact Center Innovation Architect
    robertwc@avtex.com
    https://www.Avtex.com
    https://RobertWC.Blogspot.com
    ------------------------------



  • 5.  RE: Add new contact to Contactlist via API

    Posted 05-18-2021 17:45
    No replies, thread closed.
    I also found that the phoneNumberStatus object needs to have the column name of the phone number included in this format:

    "phoneNumberStatus": { "Customer_Phone": {"callable": true} }

    Including the column name fixed that same error for me.

    From the Schema def:
    phoneNumberStatus - (Map<string, object>) A map of phone number columns to PhoneNumberStatuses, which indicate if the phone number is callable or not.

    ------------------------------
    Jonathan Slovacek
    Sr. Systems Architect
    ------------------------------



  • 6.  RE: Add new contact to Contactlist via API

    Posted 05-19-2021 00:46
    No replies, thread closed.
    Hi Jonathan, 

    Thanks a million! I tried following your suggestion of adding "phoneNumberStatus": { "Customer_Phone": {"callable": true} } and  it works like a charm.
    Cheers!

    ------------------------------
    Dennies Salenga
    ------------------------------