Genesys Cloud - Developer Community!

 View Only

Sign Up

How to create a Contract for a data action Output

  • 1.  How to create a Contract for a data action Output

    Posted 11 hours ago
      |   view attached

    Hi all, I struggle a little to get the results back in a data action output from the API call.

    API used  Get /api/v2/users/{userId}?expand=authorization

    The returned data is:  "authorization": { "roles": [ { "id": "ecc22cf2-f769-420d-81b3-f89867558c2f", "name": "admin" }, { "id": "86d9a533-bce0-4da3-95f7-5d1f9673006b", "name": "employee" } ],

    In the contract I have this:

    {  "title": "output", "type": "object", "additionalProperties": true, "properties": { 
    "authorization": {"type": "object", "properties": {"roles": {"type": "array", "items": {"type": "object", "properties": {"id": {"type": "string"},  "name": {"type": "string"}
    }}}}}}}

     

    When I run the test, it comes back with no data (attached screenshot) where the API explorer does have the above listed output.
    Where do I go wrong here please?


    #DataActions
    #PlatformAPI

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