Filter Data in a REST API Call

You can use the Filter option to invoke an API call by specifying the search criteria in the GET request and retrieve data pertaining to the specific filter. The basic pattern for specifying the search criteria is as follows:

The following search criteria explain, how to filter tickets with ticket type as Service Request and the age range is between 0-2 days.

((NonTranslatedTicketStatus ne 'Archive' and NonTranslatedTicketStatus ne 'Request - Delete' and NonTranslatedTicketStatus ne 'Closed') and
(OrgStatus eq 0) and (((TypeName eq 'service request') and (TicketAgingRange eq '0-2 days'))))

Where:

Filter ConditionDescription
nenot equal
eqequal

How to Retrieve Filter Data Using REST

To invoke an API call by specifying the search criteria in the GET method, you need to copy the search text from ISM.


The following steps describe the process to copy the search text from ISM to invoke an API call using the text in Swagger:

  1. Log in to ISM with valid credentials.
  2. In the Ticket Center, click Filter and set the search criteria based on your requirement.
    Note: This is also applicable to Advanced Ticket Center. To filter data using Advanced Ticket Center, you must select a View and then follow the process explained below.
  3. Click F12 or right-click and select Inspect Element from the context menu.
  4. Click the Network tab.
  5. On the Name column, select the row to view the data as below.:
  6. Copy the Request URL. See the highlighted text above which you must copy.
  7. Open a URL encoder. For example, you can use the https://meyerweb.com/eric/tools/dencoder/ website for URL Decoder/Encoder and paste the request URL. URL Decoder/Encoder is an easy-to-use online tool to simplify or convert any string to URL encoded format.
  8. Click Decode.
  9. Copy the decoded data from the text box.
  10. Log in to Swagger. You can access Swagger using the ISM environment followed by the swagger URL as follows: https://<datacenter>.serviceaide.com/csmconnector/swagger-ui.html. For more information, see REST APIs.
  11. Open the required ticket controller such as Service-Request-Controller.
  12. Select GET/  ServiceRequest.
  13. Specify the required parameters such as csm_app_url, user_auth_token, slice_token, webservice_user_name, and webservice_user_password.
  14. Paste the decoded data in the Filter field such as below:
  15. Click Try it Out to retrieve the data.

The following example displays the search result.: 





© 2019 Serviceaide 1-650-206-8988 http://www.serviceaide.com info@serviceaide.com