Legacy Dev Forum Posts

 View Only

Sign Up

Wrap up code and Notes using API

  • 1.  Wrap up code and Notes using API

    Posted 06-05-2025 19:07

    MaheshwarJD | 2021-02-01 13:17:03 UTC | #1

    Hi Team ,

    I am trying to find out if there is an API to get wrap up code and wrap up notes of voice calls based on ANI.

    Requirement is to display last 3 calls info [wrap up code & notes] for the given ANI number to Agent in a Screen pop.

    Please share your thoughts. Thanks in advance.


    Jerome.Saint-Marc | 2021-02-02 15:43:30 UTC | #2

    You should be able to achieve this using an Analytics Query for Conversation Details (POST /api/v2/analytics/conversations/details/query).

    You will have to parse the result to extract your WrapUp code and notes. Under the agent participant structure - "wrapUpCode" (for the id of the selected WrapUp Code) and "wrapUpNote"

    The request could use the following body.

    { "interval": "$$YourQueryInterval$$", "order": "desc", "orderBy": "conversationStart", "paging": { "pageSize": 3, "pageNumber": 1 }, "segmentFilters": [ { "type": "and", "predicates": [ { "type": "dimension", "dimension": "mediaType", "operator": "matches", "value": "voice" }, { "type": "dimension", "dimension": "purpose", "operator": "matches", "value": "agent" }, { "type": "dimension", "dimension": "ani", "operator": "matches", "value": "tel:$$YourCustomerPhone_number$$" } ] } ], "conversationFilters": [ { "type": "and", "predicates": [ { "type": "dimension", "dimension": "conversationEnd", "operator": "exists" } ] } ] }

    Few comments on this one:

    Replace $$YourQueryInterval$$ with the interval you want to query. Note that the maximum duration of the Interval is one month.

    I have set the "order" attribute to "desc" so that most recent conversations are at the beginning of the conversations array (most recent to oldest conversations)

    I have set "pageSize" to 3 to retrieve the last 3 voice calls (note that there may be 0, 1, 2 or 3 calls - depending on customer previous calls in the requested time interval).

    In my predicates (using "and" condition), I have checked: -- mediaType=voice (to avoid getting a web callback conversation) -- purpose=agent (to make sure this was a call which was connected to an agent - and not a call in self-service IVR/Bot or a call abandoned in a Queue before reaching an agent) -- ani=tel:$$YourCustomerPhone_number$$ (you may adapt this to your environment - in mine, the ANI will appear as "tel:+33123456789" in the conversation details) -- conversationEnd exists (to only retrieve previous ended/terminated calls and not the current one).

    Regards,


    system | 2021-03-04 15:43:35 UTC | #3

    This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.


    This post was migrated from the old Developer Forum.

    ref: 9856