Data Action JSON Output Different to Output in API Explorer

Hi there,

I'm trying to setup a data action using the conversation API: /api/v2/analytics/conversations/${input.conversationId}/details

When I run this in the API explorer I get a large amount of data however when I run it in the data action and select JSON to see the full output I get a strange stripped down version with a lot of missing data.

My oauth for the data action has full admin rights under the client credentials/roles for the oauth.

E.g

API explorer (snippet)
{
"conversationEnd": "2023-02-28T12:40:35.478Z",
"conversationId": "4951a442-20bb-4270-b1d0-d9ee98a7f8e3",
"conversationStart": "2023-02-28T12:39:43.559Z",
"divisionIds": [
"9a27f0f0-6afe-4a23-a4a9-534dbbbbba67",
"1497ae5c-4261-4a80-a1a7-ad7debec6dc3"
],
"mediaStatsMinConversationMos": 4.391134485955362,
"mediaStatsMinConversationRFactor": 81.49958038330078,
"originatingDirection": "inbound",
"participants": [
{
"externalContactId": "8e0a3748-082c-4579-b1d1-4f120688622d",
"participantId": "",
"participantName": "
",
"purpose": "customer",
"sessions": [
{
"agentBullseyeRing": 1,
"ani": "",
"direction": "inbound",
"dnis": "
",
"edgeId": "*****",
"mediaType": "voice",
"protocolCallId": "34b72b01548c6055547fa1ea01dbe6f2@212.70.186.52:5060",
"provider": "Edge",
"recording": true,
"remoteNameDisplayable": "*******",
"requestedRoutings": [

But in the JSON output:

{
"participants.sessions.segments.conference": [
[
[
false,
false
]
],
[
[
false,
false
]
],
[
[
false,
false
]
],
[
[
false,
false,
false
]
]
],
"participants.sessions.flow.exitReason": [
null,
[
"TRANSFER"
],
null,
null
],
"participants.sessions.metrics.value": [
[
[
1,
32086
]
],
[
[
1,
3237,
3072,
3072
]
],
[
[
1,
14587
]
],
[
[
4356,
14587,
14298,
14298,
20000,
33951
]
]
],

My question is why is displaying JSON like this?

Thank you in advance!

Cheers,
Martin

This is likely a configuration error of some sort for your data action. Can you share the templates please?

The JSON is being "flattened", so that it can be consumed by architect. If you uncheck the "flatten output" checkbox above the "Run Action" button, you will likely get output that looks like what you are expecting.

Flattening happened because architect couldn't handle complex objects. Now that Architect has JSON support, you could actually return part or all of the conversation object to architect and do further processing on it there. Take a look at $esc.jsonString on Velocity macros for data actions - Genesys Cloud Resource Center

--Jason

Thank you Jason this was it! I'm trying to pull specific values to form the output contracts - I'll give this a try now after deselecting flatten. I'll check the link as well.

Much appreciated!

Martin

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