cancel
Showing results forĀ 
Search instead forĀ 
Did you mean:Ā 
cancel
1646
Views
0
Helpful
13
Replies

Callback report API

Callback report API needed which will return processed (success/ failed) callback request from system.

1 Accepted Solution

Accepted Solutions

Arunabh Bhattacharjee
Cisco Employee
Cisco Employee

Hi Dimple,

The HTTP node was misconfigured, it needs to have the JSON parse - one cannot set that to null.

Also you cannot have comments in there because it is a string value.

Also you have to

escape quotes i.e \"something\"

You may use something like GraphQL to JSON to help with the same

I have corrected the script and here is the sample script - please convert the .TXT to .JSON 

 

Please correct - Data center - from US1 to ANZ1

and Org Id, Token etc 

Thanks & Regards,

Arunabh.

View solution in original post

13 Replies 13

Arunabh Bhattacharjee
Cisco Employee
Cisco Employee

Hi Dimple,

Is this query regarding the search API? 

If yes, then please use this example posted on Github for callback reporting data.

https://github.com/CiscoDevNet/webex-contact-center-api-samples/blob/main/graphql-sample/callbackFilter.graphql

Since this is powered by GraphQL - you can remove/adjust the filters and add more fields you want in the task details.

Thanks & Regards,

Arunabh.

Hi Arunabh,

Thanks for your reply.

We are looking for a workaround, to prevent duplicate ANI from Callback list, until callback has been processed on that ANI. So we need some API which will either show unprocessed callback list or processed callback list, so we can check ANI through that API before making callback request on same number. Also please do share postman request snips that will be easier to understand.

Looking forward for your response.

Regrads

Dimple Saggi

 

Hi Arunabh,

I do have tried graphql at search API, is there any way we can call this API from http request node from IVR Callflow?

Looking forward for your reply.

Hi @DimpleSaggi04773 ,

 

is there any way we can call this API from http request node from IVR Callflow:

Answer is not a direct way today. Workarounds have to be used to do so.

One will need to host a token management service middleware to be able to call it.

So short answer is: today there is no straight forward way. If you want to view more details on the workaround you can refer to the token management example - https://github.com/CiscoDevNet/webex-contact-center-api-samples/tree/main/token-app-sample

we have used such services to call APIs using flow. Again, this is a workaround. The feature is still on the roadmap.

 

Hi Arunabh,

I understand Token management can't be direct, but my question was on Search Tasks API , how to call that API with graphql query from http node (or postman) 

Menas what would be the values for query parameter:

curl --request POST \
--url 'https://api.wxcc-anz1.cisco.com/search?orgId=97cdbf45-ebe2-4687-8341-44d5c7abf101' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer YOUR_TOKEN' \
--header 'Content-Type: application/json' \
--data '
{
"query": "",
"extensions": {
"persistedQuery": {
"version": "",
"sha256Hash": ""
}
}
}
'

Looking forward for your response.

Hi Dimple,

Postman has native support for GraphQL
You can convert the GraphQL query to curl and that will be stringified under the query object.

An example:

curl --location --request POST 'https://api.wxcc-us1.cisco.com/search' \
--header 'Authorization: Bearer \
--header 'Content-Type: application/json' \
--data-raw '{"query":"{task(from:1663732800000, to:1664241412732) {tasks{id}}} ","variables":{}}'

The query for callback fields for example will be like so

curl --location --request POST 'https://api.wxcc-us1.cisco.com/search' \
--header 'Authorization: Bearer \
--header 'Content-Type: application/json' \
--data-raw '{"query":"{\n #FILTER: Get the Task details using CallBack filters and logical operators to match a condition\n task(\n # NOTE: from and to are mandatory arguments that take the Epoch timestamp in milliseconds\n from: 1663732800000 #This can be set to Date.now() - (days * 24 * 60 * 60 * 1000) for lookback in days\n to: 1664315734533 #This can be set to Date.now() in millis\n #Add a filter that checks if a Callback was made and with a status\n ) {\n tasks {\n callbackData {\n callbackRequestTime\n callbackConnectTime\n callbackNumber\n callbackStatus\n callbackOrigin\n callbackType\n }\n }\n }\n}","variables":{}}'


This is by pasting this example ā€“ https://github.com/CiscoDevNet/webex-contact-center-api-samples/blob/main/graphql-sample/callbackFilter.graphql

Into graphQL on postman and then converting it to a raw request to display the curl.

This is what you would configure in the HTTP Client node on flow designer.

Hi Arunabh,

Thanks for your reply.

I found postman help too, but getting 500 error code while search API from http request node from callflow. 

DimpleSaggi04773_1-1664323896483.png

 

DimpleSaggi04773_2-1664323926477.png

 

I do have uploaded callflow json file, please remove postfix .txt from file, as system didn't allow me to upload json file here.

Please correct me if HttpRequest node need different settings

Hi Arunabh,

I am looking forward for your response.

Thanks

Dimple Saggi

Arunabh Bhattacharjee
Cisco Employee
Cisco Employee

Hi Dimple,

The HTTP node was misconfigured, it needs to have the JSON parse - one cannot set that to null.

Also you cannot have comments in there because it is a string value.

Also you have to

escape quotes i.e \"something\"

You may use something like GraphQL to JSON to help with the same

I have corrected the script and here is the sample script - please convert the .TXT to .JSON 

 

Please correct - Data center - from US1 to ANZ1

and Org Id, Token etc 

Thanks & Regards,

Arunabh.

Hi Arunabh,

Thanks for your reply.

I have tested your callflow too, now I am getting 401 error code, I do have updated orgid & token & ANI according to my test environment. But still no luck. Please guide.

please convert the .TXT to .JSON 

Hi Dimple as mentioned also please check the datacenter url

I had tested it on US1 so it is api.wxcc-us1.Cisco.com

The 401 will be because the token needs to match the org and datacenter url

I.e api.wxcc-anz1.Cisco.com

Thanks & Regards
Arunabh.

Hi Arunabh,

Appreciate your patience.

Sorry for that mistake, now I am getting 404 error code.

please convert the .TXT to .JSON 

Arunabh Bhattacharjee
Cisco Employee
Cisco Employee

Hi @DimpleSaggi04773 

That is because you have set the url to 

It has to have a path i.e /search

 

https://api.wxcc-anz1.cisco.com

 

needs to be 

https://api.wxcc-anz1.cisco.com/search

Hence the 404 - URL not found

https://developer.webex-cx.com/documentation/search/v1/search-tasks

 

Regards,

Arunabh.