Hello,
we have implemented a PureCloud data action that just performs the /api/v2/analytics/conversations/{conversationId}/details, in order to retrieve the User Participants Id involved in the conversations.
It works and runs well by testing it in the Admin\Actions\Test (PureCloud interface). Neverthless, when we try to use it from a Script (custom action), an error occurs when storing the Participant Id value in the custom variable created at Script level
Input Contracts:
{ "$schema": "http://json-schema.org/draft-04/schema#", "title": "Conversation by ID", "description": "Conversation by ID", "type": "object", "required": [ "conversationId" ], "properties": { "conversationId": { "type": "string", "description": "conversationId" } } }
Output Contracts:
{ "$schema": "http://json-schema.org/draft-04/schema#", "title": "Output", "description": "", "type": "object", "properties": { "PARTICIPANT_ID": { "type": "string", "title": "participantId", "description": "participantId" }, "ANI": { "type": "string", "title": "ANI", "description": "ANI" } }
Request:
{ "requestUrlTemplate": "/api/v2/analytics/conversations/${input.conversationId}/details", "requestType": "GET", "headers": {}, "requestTemplate": "${input.rawRequest}" }
Response:
{ "translationMap": { "ANI": "$.participants[0].sessions[0].ani", "PARTICIPANT_ID": "$.participants[0].participantId" }, "successTemplate": "{\n \"ANI\": ${ANI}\n , \n \"PARTICIPANT_ID\": ${PARTICIPANT_ID}\n}" }
It perfectly runs in the PureCloud testing interface, but in the Script it only shows the ANI value, throwing an error while storing the value of PARTICIPANT_ID.
This is the configuration of Data Action calls at script level:
We would need to retrieve the Participants IDs in order to perform further automation through the Script, based on Participant IDs
Thank you very much for your help