| POST | /quote/validatewaypoints | Validate the waypoints for a client. |
|---|
Imports System
Imports System.Collections
Imports System.Collections.Generic
Imports System.Runtime.Serialization
Imports ServiceStack
Imports ServiceStack.DataAnnotations
Imports WebService.ClientServiceModel
Imports WebService.ClientServiceModel.Base
Imports BusinessLogic.Entities
Namespace Global
Namespace BusinessLogic.Entities
Public Partial Class LinkedWaypoint
Public Overridable Property FromWaypointNumber As Integer
Public Overridable Property ToWaypointNumber As Integer
Public Overridable Property FromLatitude As Double
Public Overridable Property FromLongitude As Double
Public Overridable Property ToLatitude As Double
Public Overridable Property ToLongitude As Double
End Class
End Namespace
Namespace WebService.ClientServiceModel
Public Partial Class RequestQuoteWaypoint
Implements IRequestWaypoint
'''<Summary>
'''Number of waypoint for ordering
'''</Summary>
<ApiMember(Description:="Number of waypoint for ordering", IsRequired:=true)>
Public Overridable Property WaypointNumber As Integer
'''<Summary>
'''Waypoint Latitude
'''</Summary>
<ApiMember(Description:="Waypoint Latitude", IsRequired:=true)>
Public Overridable Property Latitude As Double
'''<Summary>
'''Waypoint Longitude
'''</Summary>
<ApiMember(Description:="Waypoint Longitude", IsRequired:=true)>
Public Overridable Property Longitude As Double
'''<Summary>
'''Name of contact person at waypoint
'''</Summary>
<ApiMember(Description:="Name of contact person at waypoint", IsRequired:=true)>
Public Overridable Property ContactName As String
'''<Summary>
'''Telephone number of contact person at waypoint
'''</Summary>
<ApiMember(Description:="Telephone number of contact person at waypoint", IsRequired:=true)>
Public Overridable Property ContactNumber As String
'''<Summary>
'''Instructions for driver to follow at waypoint
'''</Summary>
<ApiMember(Description:="Instructions for driver to follow at waypoint", IsRequired:=true)>
Public Overridable Property DeliveryInstructions As String
'''<Summary>
'''Waypoint address
'''</Summary>
<ApiMember(Description:="Waypoint address", IsRequired:=true)>
Public Overridable Property Address As String
End Class
Public Partial Class ValidateWaypoints
Inherits ApiServiceRequest
Implements ILogRequest
Public Sub New()
Waypoints = New List(Of RequestQuoteWaypoint)
End Sub
'''<Summary>
'''Array of waypoints
'''</Summary>
<ApiMember(Description:="Array of waypoints", IsRequired:=true)>
Public Overridable Property Waypoints As List(Of RequestQuoteWaypoint)
'''<Summary>
'''Set this to true to prevent while testing the API.
'''</Summary>
<ApiMember(Description:="Set this to true to prevent while testing the API.", IsRequired:=true)>
Public Overridable Property Test As Boolean
End Class
Public Partial Class ValidateWaypointsResponse
Inherits ApiServiceResponse
Public Sub New()
WaypointValidations = New List(Of WaypointValidationInformation)
Waypoints = New List(Of WaypointQuoteInformation)
End Sub
'''<Summary>
'''List with validation information for each waypoint
'''</Summary>
<ApiMember(Description:="List with validation information for each waypoint")>
Public Overridable Property WaypointValidations As List(Of WaypointValidationInformation)
'''<Summary>
'''The total distance for the order
'''</Summary>
<ApiMember(Description:="The total distance for the order")>
Public Overridable Property TotalDistance As Double
'''<Summary>
'''The total distance for the order, formatted as a string
'''</Summary>
<ApiMember(Description:="The total distance for the order, formatted as a string")>
Public Overridable Property TotalDistanceValue As String
'''<Summary>
'''List of information for pricing etc between each waypoint
'''</Summary>
<ApiMember(Description:="List of information for pricing etc between each waypoint")>
Public Overridable Property Waypoints As List(Of WaypointQuoteInformation)
'''<Summary>
'''Is there an issue for the waypoints details specified?
'''</Summary>
<ApiMember(Description:="Is there an issue for the waypoints details specified?")>
Public Overridable Property WaypointIssue As Boolean
End Class
Public Partial Class WaypointQuoteInformation
Inherits LinkedWaypoint
Public Sub New()
ErrorDetails = New List(Of String)
End Sub
'''<Summary>
'''Distance between waypoints as a number
'''</Summary>
<ApiMember(Description:="Distance between waypoints as a number")>
Public Overridable Property Distance As Double
'''<Summary>
'''String formatted distance
'''</Summary>
<ApiMember(Description:="String formatted distance")>
Public Overridable Property DistanceValue As String
Public Overridable Property WaypointValid As Boolean
Public Overridable Property Message As String
Public Overridable Property ErrorDetails As List(Of String)
'''<Summary>
'''Caculated price between waypoints excluding vat
'''</Summary>
<ApiMember(Description:="Caculated price between waypoints excluding vat")>
Public Overridable Property Price As Decimal
'''<Summary>
'''Price excluding vat formatted as a string rand value
'''</Summary>
<ApiMember(Description:="Price excluding vat formatted as a string rand value")>
Public Overridable Property PriceValue As String
'''<Summary>
'''The price between waypoints including vat
'''</Summary>
<ApiMember(Description:="The price between waypoints including vat")>
Public Overridable Property PriceWithVAT As Decimal
'''<Summary>
'''The price including vat formatted as a rand value string
'''</Summary>
<ApiMember(Description:="The price including vat formatted as a rand value string")>
Public Overridable Property PriceValueWithVAT As String
End Class
Public Partial Class WaypointValidationInformation
Public Sub New()
ErrorMessages = New List(Of String)
End Sub
Public Overridable Property WaypointNumber As Integer
Public Overridable Property IsValid As Boolean
Public Overridable Property ErrorMessages As List(Of String)
End Class
End Namespace
Namespace WebService.ClientServiceModel.Base
Public Partial Class ApiServiceRequest
Implements IServiceRequest
Implements IHasApiKey
'''<Summary>
'''The API Key required for authentication
'''</Summary>
<ApiMember(DataType:="string", Description:="The API Key required for authentication", IsRequired:=true)>
Public Overridable Property ApiKey As String
End Class
Public Partial Class ApiServiceResponse
Implements IServiceResponse
'''<Summary>
'''Information about the response.
'''</Summary>
<ApiMember(Description:="Information about the response.", IsRequired:=true)>
Public Overridable Property Description As String
'''<Summary>
'''Heading or summary of the response.
'''</Summary>
<ApiMember(Description:="Heading or summary of the response.", IsRequired:=true)>
Public Overridable Property Heading As String
'''<Summary>
'''Did the intended operation for this response complete successfully?
'''</Summary>
<ApiMember(DataType:="boolean", Description:="Did the intended operation for this response complete successfully?", IsRequired:=true)>
Public Overridable Property WasSuccessful As Boolean
End Class
End Namespace
End Namespace
To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /quote/validatewaypoints HTTP/1.1
Host: api.1fetch.co.za
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length
{"Waypoints":[{"WaypointNumber":0,"Latitude":0,"Longitude":0,"ContactName":"String","ContactNumber":"String","DeliveryInstructions":"String","Address":"String"}],"Test":false,"ApiKey":"String"}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length
{Unable to show example output for type 'ValidateWaypointsResponse' using the custom 'other' filter}One or more errors occurred. (Object reference not set to an instance of an object.)