Genesys Cloud - Main

 View Only

Sign Up

  Thread closed by the administrator, not accepting new replies.
  • 1.  Integration/ Data Action/ JSON Mapping - Issue

    Posted 08-14-2018 05:12
    No replies, thread closed.
    Hello Everyone,

    I would like to ask about JSON mapping to dynamic number of objects.
    How this can be done? Any example/ resources?

    As an example, we can use the following URL "https://jsonplaceholder.typicode.com/posts?userId=1" with the Postman with GET method, the response would be something similar to the following:

    [ { "userId": 1,
    "id": 1,
    "title": "sunt aut facere repellat provident occaecati excepturi optio reprehenderit",
    "body": "quia et suscipit\nsuscipit" },
    {
    "userId": 1,
    "id": 2,
    "title": "qui est esse",
    "body": "est rerum tempore vitae\nsequi sint "
    }
    ]

    So, as you can see, there are multiple objects,. However, the error message I always get from PureCloud is:
    {
    "status": 400,
    "code": "invalid.extraction.into.translation.map",
    "message": "There was an issue extracting a value from the remote endpoint's response into the response translation map. Cause: Expected to find an object with property ['id'] in path $ but found 'java.util.ArrayList'. This is not a json object according to the JsonProvider: 'com.jayway.jsonpath.spi.json.JsonSmartJsonProvider'.",
    "messageParams": {},
    "contextId": "65e04558-8c48-43ef-b281-5b15e70e6f93",
    "details": [],
    "errors": []
    }

    On other hand, when I work only with single object, in which the response does not start with "[", it works successfully.

    Please, any idea, or suggestion can be helpful.

    Thank you,




    ------------------------------
    Ali Aljohani
    Jathwa Technology Solutions
    ------------------------------


  • 2.  RE: Integration/ Data Action/ JSON Mapping - Issue

    Posted 08-14-2018 13:10
    No replies, thread closed.
    You would probably get the best help and answers by posting in the forum at developer.mypurecloud.com.

    I know there are folks here who can and will probably answer, but the developer forum is ideal.

    ------------------------------
    George Ganahl
    Principal Program Manager
    Genesys
    ------------------------------



  • 3.  RE: Integration/ Data Action/ JSON Mapping - Issue

    Posted 08-16-2018 03:06
    No replies, thread closed.
    Thank you George.

    I always forget about this forum.
    I will post my question there.

    Thank you again.
    Best Regards,


    ------------------------------
    Ali Aljohani
    Jathwa Technology Solutions
    ------------------------------



  • 4.  RE: Integration/ Data Action/ JSON Mapping - Issue

    Posted 08-19-2018 06:39
    No replies, thread closed.
    Ali,

    Did it resolve?

    If not please share your request/response form the configuration tab of your actions. I ran into similar problem a few days back I was able to resolve it by tweaking the TranslationMap.

    ------------------------------
    Cheers,
    Sajid Abbas Malek
    Al-Futtaim Technologies -
    ------------------------------



  • 5.  RE: Integration/ Data Action/ JSON Mapping - Issue

    Posted 08-19-2018 07:48
    No replies, thread closed.
    I think you need to specify your response type as "array" in the contract and use json path expression $[*].title in your translationmap to get all the titles from the response. 



    ------------------------------
    Cheers,
    Sajid Abbas Malek
    Al-Futtaim Technologies -
    ------------------------------