![]() | |
Quote Rates |
SDK provides read access to the quote rate information of rated quotes. In other words it exposes similar functionality of viewing the quote rates during the rating workflow using the Epic UI except through an api.
SDK also provides write access to the manual quote.
This method is used to retrieve rates for a rated quote. It will show basic rate information for approved and declined rates. In other words, this method mimics the Epic behaviour of the following screen:
Can be accessed via the URI [Your_SDK_Service]/api/quote_rates?risk_variation_guid={risk_variation_guid}.
Request Parameters
risk_variation_guid
Type: System.String
The unique identifier specifing the risk variation for which to obtain the quote rates. Accepted values can be obtained from the quote risk variations.
Response
Status Code: 200
Resource Representation: QuoteRates
Examples
Get all quote rates.
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'Here we will get quote rates. 6Try 7 Dim sRiskVariationGuid As String = "6faad6a5-d4d2-4f1a-a3a7-6f61569c6bf2" 'This is the unique identifier of a risk variation. It can be obtained from the response of get risk variations. (Get /api/risk_variations?quote_guid={quote_guid}) 8 Dim sQuoteRatesURL As String = SDK_SERVICE_URI & "/api/quote_rates?risk_variation_guid=" & sRiskVariationGuid 9 Dim sQuoteRatesResponse As String 10 Using oWebclient As New WebClient 11 oWebclient.Encoding = Encoding.UTF8 12 With oWebclient.Headers 13 .Add("AuthenticationKey", AUTHENTICATION_KEY) 14 .Add("DatabaseName", DATABASE) 15 End With 16 Dim aQuoteRatesResponse As Byte() = oWebclient.DownloadData(sQuoteRatesURL) 17 sQuoteRatesResponse = oWebclient.Encoding.GetString(aQuoteRatesResponse) 18 End Using 19 Dim jss As New System.Web.Script.Serialization.JavaScriptSerializer 20 21 Dim dictGetQuoteRatesResponse As Dictionary(Of String, Object) = jss.Deserialize(Of Dictionary(Of String, Object))(sQuoteRatesResponse) 22 Dim lstApprovedRates As ArrayList = CType(dictGetQuoteRatesResponse("quotes"), ArrayList) 23 For Each dictApprovedQuoteRate As Dictionary(Of String, Object) In lstApprovedRates 24 Console.WriteLine("Quote Rate Id: " & dictApprovedQuoteRate("quote_rate_guid").ToString) 25 Console.WriteLine("Insurer: " & dictApprovedQuoteRate("insurer").ToString) 26 Console.WriteLine("Premium: " & dictApprovedQuoteRate("premium").ToString) 27 Next 28 29 Dim lstDeclinedItems As ArrayList = CType(dictGetQuoteRatesResponse("declines"), ArrayList) 30 For Each dictApprovedQuoteRate As Dictionary(Of String, Object) In lstDeclinedItems 31 Console.WriteLine("Quote Rate Id: " & dictApprovedQuoteRate("quote_rate_guid").ToString) 32 Console.WriteLine("Insurer: " & dictApprovedQuoteRate("insurer").ToString) 33 Console.WriteLine("Reason: " & String.Join(", ", dictApprovedQuoteRate("reason_for_decline"))) 34 Next 35 36Catch ex As WebException 37 Dim sStatusCode As String = ex.Status.ToString 38 Dim sError As String = New IO.StreamReader(ex.Response.GetResponseStream).ReadToEnd 39 Console.WriteLine("Status Code: &" & sStatusCode & ", Error: " & sError) 40Catch ex As Exception 41 Console.WriteLine(ex.Message) 42End Try
This method is used to retrieve information about a specified quote rate. It includes information about the risk detail. In other words, this method mimics the Epic behaviour of the following screens:
Can be accessed via the URI [Your_SDK_Service]/api/quote_rates/{{quote_rate_guid}}?risk_variation_guid={risk_variation_guid}.
Request Parameters
quote_rate_guid
Type: System.String
The unique identifier specifing the quote rate for which to obtain information from. Accepted values can be obtained from the quote rates.
risk_variation_guid
Type: System.String
The unique identifier specifing the risk variation for which to obtain the quote rates. Accepted values can be obtained from the quote risk variations.
Response
Status Code: 200
Resource Representation: System.String
Resource Representation: Rating
Examples
Get details for a quote rate.
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'Here we will output all the quote rate detail of the first approved quote rate 6Try 7 Dim sRiskVariationGuid As String = "6faad6a5-d4d2-4f1a-a3a7-6f61569c6bf2" 'This is the unique identifier of a risk variation. It can be obtained from the response of get risk variations. (Get /api/risk_variations?quote_guid={quote_guid}) 8 Dim sQuoteRatesURL As String = SDK_SERVICE_URI & "/api/quote_rates?risk_variation_guid=" & sRiskVariationGuid 9 Dim sQuoteRatesResponse As String 10 Using oWebclient As New WebClient 11 oWebclient.Encoding = Encoding.UTF8 12 With oWebclient.Headers 13 .Add("AuthenticationKey", AUTHENTICATION_KEY) 14 .Add("DatabaseName", DATABASE) 15 End With 16 Dim aQuoteRatesResponse As Byte() = oWebclient.DownloadData(sQuoteRatesURL) 17 sQuoteRatesResponse = oWebclient.Encoding.GetString(aQuoteRatesResponse) 18 End Using 19 Dim jss As New System.Web.Script.Serialization.JavaScriptSerializer 20 Dim dictGetQuoteRatesResponse As Dictionary(Of String, Object) = jss.Deserialize(Of Dictionary(Of String, Object))(sQuoteRatesResponse) 21 Dim lstApprovedRates As ArrayList = CType(dictGetQuoteRatesResponse("quotes"), ArrayList) 22 Dim dictFirstApprovedRate As Dictionary(Of String, Object) = CType(lstApprovedRates(0), Dictionary(Of String, Object)) 23 24 Dim sQuoteRateDetailURL As String = SDK_SERVICE_URI & dictFirstApprovedRate("quote_rate_uri").ToString 25 Dim sQuoteRateDetailResponse As String 26 Using oWebclient As New WebClient 27 oWebclient.Encoding = Encoding.UTF8 28 With oWebclient.Headers 29 .Add("AuthenticationKey", AUTHENTICATION_KEY) 30 .Add("DatabaseName", DATABASE) 31 End With 32 Dim aQuoteRateDetailResponse As Byte() = oWebclient.DownloadData(sQuoteRateDetailURL) 33 sQuoteRateDetailResponse = oWebclient.Encoding.GetString(aQuoteRateDetailResponse) 34 End Using 35 Console.WriteLine(sQuoteRateDetailResponse) 36 37Catch ex As WebException 38 Dim sStatusCode As String = ex.Status.ToString 39 Dim sError As String = New IO.StreamReader(ex.Response.GetResponseStream).ReadToEnd 40 Console.WriteLine("Status Code: &" & sStatusCode & ", Error: " & sError) 41Catch ex As Exception 42 Console.WriteLine(ex.Message) 43End Try
This method is used to insert a manual quote. This returns the quote detail guid of the inserted manual quote. The quote detail guid is a unique identifier of the manual quote. In other words, this method mimics the Epic behaviour of the following screens:
Can be accessed via the URI [Your_SDK_Service]/api/quote_rates.
Request Body
Resource Representation: ManualQuoteRequest
Response
Status Code: 201
Resource Representation: ManualQuoteResponse
Examples
Insert a manual quote.
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'Here we will insert a new manual quote for a UK Touring Caravan policy. 6Try 7 Dim sManualQuotesUrl As String = SDK_SERVICE_URI & "/api/quot_rates" 8 9 Dim sRiskVariationGuid As String = "5d77e272-030e-4ab9-8699-027ce6b236a7" 'A risk variation guid can be obtained from the Quote Search api. 10 Dim dictRequest As New Dictionary(Of String, Object) From { 11 {"risk_variation_guid", sRiskVariationGuid}, 12 {"insurer", "UK insurer"}, 13 {"product_description", "UK manual quote product description"}, 14 {"underwriting_premium_include_ipt", 100}, 15 {"ipt_rate", 12}, 16 {"notes", "UK manual quote notes"} 17 } 18 19 Dim jss As New System.Web.Script.Serialization.JavaScriptSerializer 20 Dim sManualQuoteInsertRequestBody As String = jss.Serialize(dictRequest) 21 22 Dim sManualQuoteInsertResponse As String 23 Using oWebclient As New WebClient 24 oWebclient.Encoding = Encoding.UTF8 25 With oWebclient.Headers 26 .Add("AuthenticationKey", AUTHENTICATION_KEY) 27 .Add("DatabaseName", DATABASE) 28 .Add("Content-type", "application/json") 29 End With 30 Dim aManualQuoteInsertResponse As Byte() = oWebclient.UploadData(sManualQuotesUrl, "POST", Encoding.ASCII.GetBytes(sManualQuoteInsertRequestBody)) 31 sManualQuoteInsertResponse = oWebclient.Encoding.GetString(aManualQuoteInsertResponse) 32 End Using 33 Dim oManualQuoteInsertResponse As ManualQuoteInsertResponse = jss.Deserialize(Of ManualQuoteInsertResponse)(sManualQuoteInsertResponse) 34 Console.WriteLine("Quote Detail Guid: " & oManualQuoteInsertResponse.quote_detail_guid) 35 36Catch ex As WebException 37 Dim sStatusCode As String = ex.Status.ToString 38 Dim sError As String = New IO.StreamReader(ex.Response.GetResponseStream).ReadToEnd 39 Console.WriteLine("Status Code: " & sStatusCode & ", Error: " & sError) 40Catch ex As Exception 41 Console.WriteLine(ex.Message) 42End Try