Genesys CTI User Forum

Genesys CTI User Forum => Genesys-related Development => Topic started by: Naveen Kancharla on May 16, 2016, 07:40:44 AM

Title: retrieve interaction histroy of particular user from ucs using SDK.
Post by: Naveen Kancharla on May 16, 2016, 07:40:44 AM
As per requirement i need to retrieve interaction history of particular user from ucs using SDK but without the use of sqlconnection???
Title: Re: retrieve interaction histroy of particular user from ucs using SDK.
Post by: Kubig on May 16, 2016, 07:46:24 AM
And what is not clear for you on this requirement? PSDK offer methods for these purposes.
Title: Re: retrieve interaction histroy of particular user from ucs using SDK.
Post by: Naveen Kancharla on May 16, 2016, 08:25:13 AM
thanks!! for quick rply. I'm new to genesys environment can u let me know the step to implement.
Title: Re: retrieve interaction histroy of particular user from ucs using SDK.
Post by: Kubig on May 16, 2016, 08:37:31 AM
Use the RequestSearch method which allow you to set query to the UCS database, where you can find all Genesys interactions by default. The RequestSearch accept the Lucene query as the parameter - so , there you can set the ownerID as the filter's parameter for example.
Title: Re: retrieve interaction histroy of particular user from ucs using SDK.
Post by: Naveen Kancharla on May 17, 2016, 11:25:07 AM
I'm using webApi developer guide 8.1, for retrieving Interaction from ucs. Under that "SimpleSamplesConstants" method is thier so where i have import it from???
Title: Re: retrieve interaction histroy of particular user from ucs using SDK.
Post by: Kubig on May 17, 2016, 11:27:49 AM
I do not think so that the WebAPI provides API for UCS (maybe I am wrong). From my point of view, the app based on PSDK meets your needs and the development will take a very short time (it is a few row of code)
Title: Re: retrieve interaction histroy of particular user from ucs using SDK.
Post by: Naveen Kancharla on May 17, 2016, 11:31:32 AM
Can u able to provide me code for it.....
Title: Re: retrieve interaction histroy of particular user from ucs using SDK.
Post by: Naveen Kancharla on May 17, 2016, 01:06:05 PM
SimpleSamplesConstants ssc = null;

try
{
ServiceInfo si = LoadBalancer.GetServiceInfo
(CfgAppType.CFGContactServer, ssc.TenantName);
tbServerName.Text = si.Host;
tbPort.Text = si.Port.ToString();
}
catch (LoadBalancerException e1)
{
ResultData.Text = "Contact server is not available at this time.
Please try it later.";
}

above code is from genesys documentation, if possible guide me how SimpleSamplesConstants  is retrieved in code.
Title: Re: retrieve interaction histroy of particular user from ucs using SDK.
Post by: Kubig on May 17, 2016, 01:58:25 PM
This code is for WebAPI, do not understand why still mixing these two things together. As I wrote, the WebAPI is not a best way for your needs. Just use the PSDK, connect to the UCS server and send the request like below (for imagine):

[code]
string query = "OwnerId:xxx";

RequestSearch reqSearch = new RequestSearch();
reqSearch.MaxResults = 100;
reqSearch.IndexName = "interaction";
reqSearch.Query = _query;

EventSearch eventSearch = (EventSearch)ConnectionFactory.GetUCSConnection().Request(reqSearch);

if ((int)eventSearch.FoundDocuments != 0)
            {
            //Do something
            }
[/code]

Of course you cannot copy&paste this code, but it is enough as the example, I guess.