Genesys Cloud - Main

 View Only

Sign Up

  Thread closed by the administrator, not accepting new replies.
  • 1.  Webservices Integration Actions - dynamic URI and logging?

    Posted 10-01-2019 20:26
    No replies, thread closed.
    ​Hi

    Just looking at integration to a third party REST service and I understand I need to use the Webservices Data Actions integration.  What I'm unsure of is how to deal with the URL to that webservice being dynamic (ie the path to the endpoint will change for each call when it either passes in a phone number, account number or agent name in the URL rather than within the body.

    Also, where do you go to check the logging of call flows that use these so you can see what was returned for particular call?
    #Integrations
    #Routing(ACD/IVR)
    #Telephony
    #Unsure/Other

    ------------------------------
    VM
    NTT
    ------------------------------


  • 2.  RE: Webservices Integration Actions - dynamic URI and logging?

    Posted 10-02-2019 09:41
    No replies, thread closed.
    In the custom Action you create in the Admin settings, you need to configure the Input Contract with objects for whatever you want to include in the URL. This contract is for PureCloud Data Actions, but the idea is similar:

    Then in the Configuration you reference that object in the Request URL Template:

    In the Architect flow use a Call Data Action action to call your custom action, and use a variable to assign the value to the object you created in the custome action:


    There is no logging that you have access to where you can see what was returned for a particular call.  All you can do is run the Test functionality from within the custom action settings:


    ------------------------------
    George Ganahl GCP (PureCloud) ICCE CCXP
    Principal Technology Consultant
    Genesys
    ------------------------------



  • 3.  RE: Webservices Integration Actions - dynamic URI and logging?

    Posted 10-03-2019 04:41
    No replies, thread closed.
    ​Thanks George

    How do I determine what the  Output contract and response configuration should be?  I get back a non-nested set of 3 unnamed tag/values, eg

    "AA,123456,JOHNSMITH"

    ------------------------------
    Vaun McCarthy
    Dimension Data New Zealand Ltd.
    ------------------------------



  • 4.  RE: Webservices Integration Actions - dynamic URI and logging?

    Posted 10-03-2019 10:31
    No replies, thread closed.
    You'd have to set up the Translation Map under Configuration>Response to parse the return, somehow, and assign those three values to individual objects. 

    Using the Test functionality for my action, I can see that the JSON for my return looks like:

    {
      "presence": "On Queue"
    }

    So my Translation Map is straightforward:

    {
      "translationMap": {
        "presence": "$.presenceDefinition.systemPresence"
      },
      "translationMapDefaults": {},
      "successTemplate": "{\n   \"presence\": ${presence}\n}"
    }

    As is my Output Contract:
    {
      "$schema": "http://json-schema.org/draft-04/schema#",
      "title": "Get User Presence Response",
      "description": "Returns a user's presence.",
      "type": "object",
      "properties": {
        "presence": {
          "type": "string",
          "title": "Presence",
          "description": "The user's presence, which indicates whether the user can be reached in PureCloud."
        }
      }
    }


    The return property is nicely labeled, which made it easy to pull off. You can do a Google search, probably, and find some info on how to parse out the return you get into three pieces in your Translation Map.

    From the Resource Center at https://help.mypurecloud.com/articles/response-configuration-data-actions/

    Raw responses

    When an action executes for the data actions integrations, the entire output from the remote web service or your AWS Lambda function is called the raw response. However, raw responses do not necessarily match the format defined in the success schema for an action. If the raw response does not match, then you can use translation maps and success templates to reformat the data. 

    Translation maps

    Translation maps contain key-value pairs that map property names to the returned values (or object) from the evaluation of JSONPath expressions.

    Translation map defaults

    Translation map defaults contain key-value pairs that set translation map keys to a default value. The default value is used if the JSONPath expression configured in the translation map fails to resolve a value. Null values do not fall back to defaults.



    ------------------------------
    George Ganahl GCP (PureCloud) ICCE CCXP
    Principal Technology Consultant
    Genesys
    ------------------------------



  • 5.  RE: Webservices Integration Actions - dynamic URI and logging?

    Posted 10-03-2019 16:54
    No replies, thread closed.
    Thanks  yes it looks like I'm going to have to do additional work to parse that string of values into JSON objects.

    In your example, how did you locate a user_id value to use for testing?  Where are those stored?

    ------------------------------
    Vaun McCarthy
    Dimension Data New Zealand Ltd.
    ------------------------------



  • 6.  RE: Webservices Integration Actions - dynamic URI and logging?

    Posted 10-03-2019 17:44
    No replies, thread closed.
    An easy way is to click on a user in the directory and copy it from the URI in the address bar:



    ------------------------------
    George Ganahl GCP (PureCloud) ICCE CCXP
    Principal Technology Consultant
    Genesys
    ------------------------------