I was curious if you had a chance to check out my update code and see if you could find any problems with it.
Original Message:
Sent: 08-12-2021 17:33
From: Mike McDonough
Subject: ICWS perform-call-list-query
Hello Eric,
Yeah, that has been very helpful! So I believe I'm getting close to having a good handle on this, although just a few last questions. Selects seem to be working well, but we're probably going to want to do some updates or inserts. Just starting with an update, sending in this statement didn't seem to work. Anything in there look obviously wrong to you? I got the familiar negative amount of records affected:
{
"connectionid": "{A0000000-0000-0000-0000-000000000000}",
"command": {
"contactlisttable": "UNCONTACTEDPREVIEW01",
"statement": "update UNCONTACTEDPREVIEW01 set status = ? where i3_identity = ?",
"commandtype": 2,
"dbcommandparameterlist": [
{
"value": "C",
"type" : "12"
},
{
"value": "672012623000000000",
"type" : "20"
}
],
"tabletype": 1
},
"displayname": "Berk"
}
------------------------------
Mike McDonough
Grantham University
Original Message:
Sent: 08-12-2021 16:03
From: Eric Berkshire
Subject: ICWS perform-call-list-query
Hi Mike,
After I updated you, I remembered that IA uses that same method to query the contact list. I tried a few of the pre-defined filters and was able to capture an example that also passes parameters. Using that information, I was able to get it to work. Here is an example:
{"connectionid":"{A0000000-0000-0000-0000-000000000000}","command":{"contactlisttable":"Berkshire","statement":"select top 100 i3_IDENTITY from BERK where attempts = ? and status = ?","commandtype":4,"dbcommandparameterlist":[{"value":"0","type":8,"size":0,"scale":0,"precision":0},{"value":"C","type":12,"size":0,"scale":0,"precision":0}],"tabletype":1},"displayname":"Berk"}
I hope that helps!
Regards,
Eric
------------------------------
Eric Berkshire
Original Message:
Sent: 08-12-2021 15:54
From: Eric Berkshire
Subject: ICWS perform-call-list-query
Hi Mike,
No luck so far on this. I might have more time tomorrow to dig into it, but so far no matter what I do I get 0 records back.
I did find that was it very helpful to turn dialertran logging to notes and look for "DialerTranObjectManager::run_general_call_list_query_impl() :" . I was originally sending the wrong type and receiving back a negative number for records affected.
Regards,
Eric
------------------------------
Eric Berkshire
Original Message:
Sent: 08-11-2021 17:03
From: Eric Berkshire
Subject: ICWS perform-call-list-query
Hi Mike,
Glad to hear my example helped.
Looking at the parameterlist, I agree that something isn't adding up. I'll see if I can dig in to that tomorrow.
Regards,
Eric
------------------------------
Eric Berkshire
Original Message:
Sent: 08-11-2021 16:06
From: Mike McDonough
Subject: ICWS perform-call-list-query
So as a follow up I'm trying to understand parameterization, and I'm not sure exactly how this would work. For example, what if you want to change the statement to "select top 100 * from UNCONTACTEDPREVIEW01 where attempts = @numOfAttempts", where @numberOfAttempts equals one. My first guess for how to do this was:
"command": {
"contactlisttable": "UNCONTACTEDPREVIEW01",
"statement": "select top 100 * from UNCONTACTEDPREVIEW01 where attempts = @numOfAttempts",
"commandtype": 4,
"dbcommandparameterlist": [
{
"numOfAttempts": {
"value": "1",
"type": 3
}
}
],
Or is the name used somewhere else? I'm not exactly sure what's needed there. Honestly I expected to see a ParameterName field like the OLE DB parameters would have. The list is unbounded, so if I had 5 different parameters to send, how would it differentiate between them?
------------------------------
Mike McDonough
Grantham University
Original Message:
Sent: 08-11-2021 15:21
From: Mike McDonough
Subject: ICWS perform-call-list-query
Good afternoon Eric,
Success! So after trying to change a lot of stuff in the statement, I decided to just copy/paste your JSON in there and immediately got a different response. After changing the statement and parameters to match my tables, I immediately got data back. Closely studying the JSON, I believe I see where I was going wrong. My connectionId was not enclosed in braces; it was just in quotes. The data type just shows String, so this was not immediately obvious why it requires those braces, and that's not very intuitive. Maybe an update to the documentation would be good?
Anyways, it's currently working, and now I'll experiment with some more complicated statements and try my hand at some parameterization. I'll let you know if I have any more issues. Thanks again for the help!
------------------------------
Mike McDonough
Grantham University
Original Message:
Sent: 08-11-2021 13:52
From: Eric Berkshire
Subject: ICWS perform-call-list-query
Hi Mike,
That is odd. I just did a quick test using:
{"connectionid":"{A0000000-0000-0000-0000-000000000000}","command":{"contactlisttable":"BERK","statement":"select top 100 * from BERK","commandtype":4,"dbcommandparameterlist":[],"tabletype":1},"displayname":"Berk"}
This returned the expected 100 rows in the 200 response. I'm not sure what the problem you're facing is. Let me think about this for a bit and if I can think of anything I'll let you know.
Thanks,
Eric
------------------------------
Eric Berkshire
Original Message:
Sent: 08-11-2021 12:33
From: Mike McDonough
Subject: ICWS perform-call-list-query
Good morning Eric,
Thanks for the help so far! I dropped the campaign from the body of the login request, got a 200 and successfully logged in. I'm now much further than I was before, so that's great!
Were you able to dig up any example calls? If the table matches the name of the call list, UncontactedPreview01, would you expect that initial JSON to return rows? Currently there are 21 in there, but when I make that select call I get the following 200 response:
{
"recordsaffected": -2147467259,
"errorMessage": "",
"records": []
}
------------------------------
Mike McDonough
Grantham University
Original Message:
Sent: 08-10-2021 18:46
From: Eric Berkshire
Subject: ICWS perform-call-list-query
I don't have any examples laying around. I've successfully used it before, so I might play around with it tomorrow and see if I can provide something for you.
As for the login, I would recommend giving the user the Seciruty Right for "Logon Campaign". With the logon campaign right, the first logon request logs in to Dialer. The initial log-in
request should not specify a campaign id. There will be an associated message with available campaigns that can be used to log in to specific campaigns after the initial log in. Since you're only needing perform the call list query though, we don't need to worry about logging in to a specific campaign. Establishing the initial dialer connection should be enough to cause Session Manager's Dialer Extension plugin to track the user's session in Dialer allowing for the call list query.
I hope that helps.
Thanks,
Eric
------------------------------
Eric Berkshire
Original Message:
Sent: 08-10-2021 18:08
From: Mike McDonough
Subject: ICWS perform-call-list-query
I got past the permission issues, but now I'm getting Campaign not found. I'm looking through that same xml file, and I thought I had the correct ID:
<cccampaignid display_name="UncontactedPreview01">{EB2013DC-07FA-475F-8C19-F809BB46F041}</cccampaignid>
Is there a way to list the campaigns through ICWS so I can make sure I'm getting the correct value?
------------------------------
Mike McDonough
Grantham University
Original Message:
Sent: 08-10-2021 17:15
From: Mike McDonough
Subject: ICWS perform-call-list-query
I had not tried logging into the dialer, no. Attempting now, and I'm having some issues with permissions doing so. I'm having someone check on that. In the meantime, do you see any issues with the rest of the request? Should the SQL statement I sent in work assuming that i3_identity is a column in the database for the UncontactedPreview01 table? How would I structure a statement that uses parameters from the dbcommandparameterlist? Do you have any examples of a working request using them?
Thanks!
------------------------------
Mike McDonough
Grantham University
Original Message:
Sent: 08-10-2021 16:53
From: Eric Berkshire
Subject: ICWS perform-call-list-query
Hi Mike,
Thanks for the info. That looks like the correct connection. That's going to correspond to the default connection in IA. The rest of what you're sending looks correct to me as well.
When I say log in to Dialer, I am talking about /icws/{sessionId}/dialer/log-in .Are you successfully able to log in to dialer before attempting to perform-call-list query?
Thanks,
Eric
------------------------------
Eric Berkshire
Original Message:
Sent: 08-10-2021 16:42
From: Mike McDonough
Subject: ICWS perform-call-list-query
Hello Eric,
Yeah, I was able to connect successfully. Added the session ID in the URL and the token to my headers.
Our test campaign is called UncontactedPreview01. In the file I had found this:
<DIALEROBJECT id="{ }" type="19" name="UncontactedPreview01" rev="0">
<PROPERTIES>
<connectionid display_name="[Default Connection]">{A0000000-0000-0000-0000-000000000000}</connectionid>
So A0000000-0000-0000-0000-000000000000 is what I was plugging in as the connectionid.
------------------------------
Mike McDonough
Grantham University
Original Message:
Sent: 08-10-2021 14:49
From: Eric Berkshire
Subject: ICWS perform-call-list-query
Hi Mike,
First off, are you performing a dialer log on before attempting the request? I assume yes as I believe you'll receive a different error if you haven't but wanted to start there.
Second, can you provide the details on the connection information you used from the xml?
Thanks,
Eric
------------------------------
Eric Berkshire
Original Message:
Sent: 08-10-2021 14:28
From: Mike McDonough
Subject: ICWS perform-call-list-query
I've been trying to use this service without any luck. Admittedly I may be sending in bad data for the request, but I can't find any examples of how to use it in the wild. The JSON I'm sending is as follows, where the connectionID I'm using is the one I found in the file dialer_config.xml:
{
"connectionid": "<connectionId>",
"command": {
"contactlisttable": "UncontactedPreview01",
"statement": "select i3_identity from UncontactedPreview01",
"commandtype": 4,
"tabletype": 1,
"dbcommandparameterlist": []
},
"displayname": "test"
}
All I seem to get back from making this call is the following, which is not very useful. Does anyone have any information on this specific call and what I'm doing wrong? Maybe examples of some SQL code they were able to get work in case mine is not the right format or something?
{
"errorId": "error.request.invalidRepresentation.malformed",
"errorCode": 0,
"message": "Invalid parameter value was specified."
}
#Integrations
------------------------------
Mike McDonough
Grantham University
------------------------------