1
Webservice API? WSDL Issue with SerachCriteria
Question asked by dhaddad - July 8, 2015 at 2:09 PM
Answered
I'm attempting to use the webservice, and having an issue:
 
It shows SearchCriteria as an array of string.
 
I've tried:
"IsOpen=True"
"'IsOpen='True"
"IsOpen = True"
"IsOpen=true"
" 'IsOpen'='True'
 
etc.etc, i cant get it to work. 
 
searchCriteria String[] A list of 'key=value' pairs that indicate the search parameters. Possible key names are:
  • BrandId
  • DateEndUtc
  • DateStartUtc
  • DepartmentId
  • EmailAddress
  • GroupId
  • HasResolution
  • IsActive
  • IsDeleted
  • IsOpen
  • IsSpam
  • MaxResults
  • Priority
  • ShowInFollowUpView
  • SortOrder
  • TicketNumber
  • UserId
To search by custom fields, pass in the id of the field as the key and the search term as the value (ie: 1 = 'value')

4 Replies

Reply to Thread
0
dhaddad Replied
July 9, 2015 at 12:17 PM
     
        Dim userName As String = "User"
        Dim Password As String = "Pass"
        Dim args As New ST.ArrayOfString
        args.Add("BrandId='1'")
        Dim CallWebService As New ST.svcTicketsSoapClient
        Dim sGetValue As ST.TicketInfoArrayResult = CallWebService.GetTicketsBySearch(userName, Password, args)
        sGetValue.Tickets.Count()
        Dim Tmp = sGetValue.Tickets.FirstOrDefault()
 
Im getting no tickets returned. Its not throwing an error. Ive tried BrandID, IsOpen, and IsActive with many different combinations of trying to pass the value in. 
 
sGetValue:
Message = ""
MessageField ""
Result = True
Result Code 0
Result Code Field 0
Result Field = True
Tickets = 0
0
dhaddad Replied
July 9, 2015 at 1:52 PM
I was able to get it working. Thanks for the help. Some comments / Questions, that may help others:
 
  • The user cannot be just an admin, it appears they have to be a member of both the employee  and manager group. Is this correct?
  • Is there a way to create a user that has API access that would not burn a license? It seems adding them to a manager role requires the agent role which requires license use.
  • We, as im sure many, use external authentication, so there is also the concern of it breaking when password changes.
Additionally, I'm not able to extract the subject of a ticket from anywhere. Ive reviewed the entire API. Ive tried: GetTicketConversationPartList, but it appears to not contain the initial subject from when the user submitted the ticket. 
 
The ticket item itself only contains the subject, but not the body. Was this intentional? 
0
Employee Replied
July 13, 2015 at 12:16 PM
Employee Post
Hello,
1. The admin does not have to be a manager but has to at least have the agent role to be able to see tickets. (you must be a agent to see tickets)
2. No i dont believe there is a way around this. The user must be at least an agent and can only search for tickets they can see (groups they are in) 
3. I seems there may be a concern if you are hardcoding the password. You may be able to write additional custom code to pass the password in from your provider. 

the subject of the ticket should be inside the TicketInfo object returned from GetTicketsBySearch OR when you call GetTicketConversationPartList the first item in the array, its description, is the subject.

To get details about a ticket message call GetTicketConversationPartList then use the partid as the messageid for GetTicketMessageHtml or GetTicketMessagePlainText
 
0
dhaddad Replied
July 13, 2015 at 12:51 PM
I was able to get it working, however either you are incorrect, or the documentation is incorrect. 
 
GetTciektsBySearch returns:
 
 <CustomerEmailAddress>string</CustomerEmailAddress>
            <ID>int</ID>
            <IdAgent>int</IdAgent>
            <IdCustomer>int</IdCustomer>
            <IdDepartment>int</IdDepartment>
            <IdGroup>int</IdGroup>
            <IsActive>boolean</IsActive>
            <IsDeleted>boolean</IsDeleted>
            <IsOpen>boolean</IsOpen>
            <IsPinnedToAgent>boolean</IsPinnedToAgent>
            <IsSpam>boolean</IsSpam>
            <LastReplyDateUtc>dateTime</LastReplyDateUtc>
            <Priority>int</Priority>
            <ReplyCountIn>int</ReplyCountIn>
            <ReplyCountOut>int</ReplyCountOut>
            <RequiresFollowUp>boolean</RequiresFollowUp>
            <ShowInFollowUpView>boolean</ShowInFollowUpView>
            <Subject>string</Subject>
            <TicketNumber>string</TicketNumber>
The Subject is the actual subject of the ticket, not the body\message\description. I was able to retrieve the description by using the conversation part list. 

Reply to Thread