Click or drag to resize

Quote Search

SDK provides the ability to search for quotes for the particular client. This exposes similar functionality as clicking the Quote selector for the particular client in Epic UI.
Post /api/quote_search

This method is used to retrieve summary for all quotes based on a specified search criteria.

Quote Search States

Can be accessed via the URI [Your_SDK_Service]/api/quote_search.

Request Body

User can get all the related quotes summary by providing in the body of the request client_guid (required parameter) and any of optional parameters which include quote_status, application_type, entered_at and additional 6 parameters used to filter quotes by risk detail address fields: risk_detail_address_line_1, risk_detail_address_line_2, risk_detail_address_line_3, risk_detail_address_line_4, risk_detail_address_line_5, risk_detail_postcode .

  • Resource Representation: QuoteFilter

Response

  • Status Code: 200

    Type: List(Of QuoteSummary)

    A list of quote summaries that match search criteria.

Examples

Get Quote with multiple filter items

VB
 1' Dim SDK_SERVICE_URI As New Uri("https://Fully_Qualified_Service_Computer_Name/SDK_Service")
 2' Constant DATABASE preset to current database name
 3' Constant AUTHENTICATION_KEY set to current authentication key
 4
 5'This sample will retrieve existing quotes of the specified Uk House application type. 
 6'Also the quotes are filtered by whether they were entered during a specified date range. 
 7'And finally they are filted by whether the quotes contain a maching addess and postcode in the risk information of the current risk variation of the quote.
 8Try
 9  Dim sUrl As String = SDK_SERVICE_URI & "/api/quote_search"
10
11  'Filter for quotes that are of the UK House application type. Equals implies a full string match.
12  Dim dictApplicationType As New Dictionary(Of String, Object) From {
13                     {"filter_value", "Uk House"},
14                     {"comparison_type_code", "0"} 'code for 'Equals'. can be obtained from Post /api/lookup_search/comparison_type
15              }
16
17  'Filter for quotes that were entered after may 5th 2020. Within Range is the only valid comparison type in this case.
18  Dim dictEnteredAt As New Dictionary(Of String, Object) From {
19                     {"filter_value", "2020-05-05T12:21:00Z"},
20                     {"comparison_type_code", "3"}, 'code for 'Within Range'. can be obtained from Post /api/lookup_search/comparison_type
21                     {"filter_value_2", Nothing}
22              }
23
24  'Filter for quotes where the current riskvariation has risk detail with an address 1 value that matches the specified string. Contains implies a partial string match.
25  Dim dictRiskDetailAddressLine1 As New Dictionary(Of String, Object) From {
26                     {"filter_value", "123 First street"},
27                     {"comparison_type_code", "1"} 'code for 'Contains'. can be obtained from Post /api/lookup_search/comparison_type
28              }
29
30  'Filter for quotes where the current riskvariation has risk detail with a postcode value that matches the specified string. Approximate Contains implies a fuzzy partial string match.
31  Dim dictRiskDetailPostcode As New Dictionary(Of String, Object) From {
32                     {"filter_value", "12345"},
33                     {"comparison_type_code", "2"} 'code for 'Approximate Contains'. can be obtained from Post /api/lookup_search/comparison_type
34              }
35
36  Dim dictRequest As New Dictionary(Of String, Object) From {
37                     {"client_guid", "DE5F8ACB-2FC9-449F-8516-AFC0613F57FD"}, 'Client guids can be obtained from Get_Cleint.
38                     {"application_type", dictApplicationType},
39                     {"entered_at", dictEnteredAt},
40                     {"risk_detail_address_line_1", dictRiskDetailAddressLine1},
41                     {"risk_detail_postcode", dictRiskDetailPostcode}
42              }
43
44  Dim jss As New System.Web.Script.Serialization.JavaScriptSerializer
45  Dim sRequestBody As String = jss.Serialize(dictRequest)
46
47  Dim sResponse As String
48  Using oWebclient As New WebClient
49    oWebclient.Encoding = Encoding.UTF8
50    With oWebclient.Headers
51      .Add("AuthenticationKey", AUTHENTICATION_KEY)
52      .Add("DatabaseName", DATABASE)
53      .Add("Content-type", "application/json")
54    End With
55    Dim aResponse As Byte() = oWebclient.UploadData(sUrl, "POST", Encoding.ASCII.GetBytes(sRequestBody))
56    sResponse = oWebclient.Encoding.GetString(aResponse)
57  End Using
58
59  Dim lstQuotes As List(Of Dictionary(Of String, Object)) = jss.Deserialize(Of List(Of Dictionary(Of String, Object)))(sResponse)
60  For Each dictPolicy As Dictionary(Of String, Object) In lstQuotes
61    Console.WriteLine("Quote Guid: " & dictPolicy("quote_guid").ToString)
62    Console.WriteLine("Quote Description: " & dictPolicy("description").ToString)
63    Console.WriteLine("Quote Status: " & dictPolicy("status").ToString)
64    Console.WriteLine()
65  Next
66
67Catch ex As WebException
68  Dim sStatusCode As String = ex.Status.ToString
69  Dim sError As String = New IO.StreamReader(ex.Response.GetResponseStream).ReadToEnd
70  Console.WriteLine("Status Code: " & sStatusCode & ", Error: " & sError)
71Catch ex As Exception
72  Console.WriteLine(ex.Message)
73End Try
See Also