Need Help: for this API: /api/v2/conversations/{conversationId} Get conversation

I have a similar concern same as this: Fetching E-mail Address for Web Surveys

I want to get variables from the inbound call and use it in survey invite.
here is the sample response from the API
{
"id": "b1865db7-d8f0-4eba-8e44-8d6443b64daf",
"externalTag": "QUEUE TO TECH",
"startTime": "2023-08-04T08:42:30.382Z",
"endTime": "2023-08-04T08:43:50.397Z",
"address": "sip:69f007fa-6f4d-4acb-85bf-dd632ab8e264@127.0.0.1;language=en-US;user=ivr",
"participants": [
{
"id": "ea4022f2-2ef8-4d67-be99-006dbaa831de",
"startTime": "2023-08-04T08:42:30.376Z",
"endTime": "2023-08-04T08:43:45.953Z",
"connectedTime": "2023-08-04T08:42:30.716Z",
"name": "Mobile Number, Philippines",
"externalContactId": "6c18bc7a-90b8-429a-8deb-7d231359cada",
"queueId": "99dca803-1831-4f47-b8f8-28a325df3c1a",
"queueName": "TestTechnicalQueue",
"purpose": "customer",
"participantType": "External",
"address": "tel:+639923123412",
"ani": "tel:+639923123412",
"aniName": "",
"dnis": "tel:+6328672231",
"wrapupRequired": false,
"mediaRoles": [
"full"

in my case I would like to get the values for address or ani, but it is not reflecting in the output of data actions

Hi Ernest_John_Nuque,

It doesn't look like your output contract is configured to return participant addresses or anis.

In your output contract you likely want to add an array of name "participants"
That array contains an object (the name of the object doesn't matter)
The object has a string of "address" or "ani"

If you then rerun this test you should see a list of addresses or anis.

If you have already published this action then you will want to duplicate it so you will have an unpublished draft to work with.

If you need to filter down the list of anis/addresses to participants of a specific purpose then you will need to use a translation map to filter via JSONPath.

--Jason

Hi @Jason_Mathison ,

I did try to make changes and instead of using ani or address on participants I am trying to get variable values which is under participants.attributes

{
"id": "aac4776c-1bda-42e9-a609-8055ba2314fd",
"externalTag": "QUEUE TO TECH",
"startTime": "2023-08-08T04:22:01.237Z",
"address": "tel:+632867108",
"participants": [
{
"id": "332b11b0-4239-4682-8dc0-e8506cf9502c",
"startTime": "2023-08-08T04:22:01.237Z",
"connectedTime": "2023-08-08T04:22:01.721Z",
"name": "Mobile Number",
"externalContactId": "6c18bc7a-90b8-429a-8deb-7d231359cada",
"queueId": "99dca803-1831-4f47-b8f8-28a325df3c1a",
"queueName": "Technical",
"purpose": "customer",
"participantType": "External",
"address": "tel:+12345678",
"ani": "tel:+123456789",
"aniName": "Mobile Number",
"dnis": "tel:+632867108",
"wrapupRequired": false,
"mediaRoles": [
"full"
],
"attributes": {
"InboundANI": "+12345678",
"SMS MIN": "",
"SUB SET": "",
"SMSMEssage": "",
"SUB WRAP UP": "",
"ZONE": "3",
"FACILITY": "FTTX",
"PID": "12345678",
"TelephoneNumber": "",
"WrapUP": "",
"NODE NAME": "",
"SMS CATEGORY": "",
"MobileNumber": "",
"PLDTNUM": "12345678",
"scriptId": "f2341bd4-3ecd-4371-8b4d-f57c35c8f7ed",
"CITY": "MANILA",
"FT#": "",
"Remarks": "Remarks",
"ONU": "1000022233",
"HRC": "YES",
"SMS CANNED MESSAGE": "",
"ScreenPopName": "ePLDT Test Script",
"CVREAD": "NA"
},

here is the sample response from API explorer I want to get the value of variable "InboundANI"
but I cannot get it on map translation, do you have any example that you can share on how to properly extract variable values using this API /api/v2/conversations/{conversationI}?

here is the sample response on genesys call data

What you posted wasn't valid JSON, so I closed up the object like this:

{
	"id": "aac4776c-1bda-42e9-a609-8055ba2314fd",
	"externalTag": "QUEUE TO TECH",
	"startTime": "2023-08-08T04:22:01.237Z",
	"address": "tel:+632867108",
	"participants": [{
		"id": "332b11b0-4239-4682-8dc0-e8506cf9502c",
		"startTime": "2023-08-08T04:22:01.237Z",
		"connectedTime": "2023-08-08T04:22:01.721Z",
		"name": "Mobile Number",
		"externalContactId": "6c18bc7a-90b8-429a-8deb-7d231359cada",
		"queueId": "99dca803-1831-4f47-b8f8-28a325df3c1a",
		"queueName": "Technical",
		"purpose": "customer",
		"participantType": "External",
		"address": "tel:+12345678",
		"ani": "tel:+123456789",
		"aniName": "Mobile Number",
		"dnis": "tel:+632867108",
		"wrapupRequired": false,
		"mediaRoles": [
			"full"
		],
		"attributes": {
			"InboundANI": "+12345678",
			"SMS MIN": "",
			"SUB SET": "",
			"SMSMEssage": "",
			"SUB WRAP UP": "",
			"ZONE": "3",
			"FACILITY": "FTTX",
			"PID": "12345678",
			"TelephoneNumber": "",
			"WrapUP": "",
			"NODE NAME": "",
			"SMS CATEGORY": "",
			"MobileNumber": "",
			"PLDTNUM": "12345678",
			"scriptId": "f2341bd4-3ecd-4371-8b4d-f57c35c8f7ed",
			"CITY": "MANILA",
			"FT#": "",
			"Remarks": "Remarks",
			"ONU": "1000022233",
			"HRC": "YES",
			"SMS CANNED MESSAGE": "",
			"ScreenPopName": "ePLDT Test Script",
			"CVREAD": "NA"
		}
	}]
}

I used https://www.javainuse.com/jsonpath to come up with:

participants[*].attributes.InboundANI

This will return a list of that attributes for all participants. If you need to filter down you will need to replace the * with jsonpath to filter as desired.

--Jason

1 Like

thanks @Jason_Mathison ,I was able to get the variables from the participants.attribute I somehow able to understand it a little... I really appreciate your help cause for someone like me who is not really a dev this is a big help! :smiley:

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