1Fetch Client API

<back to all web services

ValidateWaypoints

The following routes are available for this service:
POST/quote/validatewaypointsValidate the waypoints for a client.
namespace WebService.ClientServiceModel

open System
open System.Collections
open System.Collections.Generic
open System.Runtime.Serialization
open ServiceStack
open ServiceStack.DataAnnotations

    [<AllowNullLiteral>]
    type ApiServiceResponse() = 
        ///<summary>
        ///Information about the response.
        ///</summary>
        [<ApiMember(Description="Information about the response.", IsRequired=true)>]
        member val Description:String = null with get,set

        ///<summary>
        ///Heading or summary of the response.
        ///</summary>
        [<ApiMember(Description="Heading or summary of the response.", IsRequired=true)>]
        member val Heading:String = null with get,set

        ///<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)>]
        member val WasSuccessful:Boolean = new Boolean() with get,set

    [<AllowNullLiteral>]
    type WaypointValidationInformation() = 
        member val WaypointNumber:Int32 = new Int32() with get,set
        member val IsValid:Boolean = new Boolean() with get,set
        member val ErrorMessages:ResizeArray<String> = new ResizeArray<String>() with get,set

    [<AllowNullLiteral>]
    type LinkedWaypoint() = 
        member val FromWaypointNumber:Int32 = new Int32() with get,set
        member val ToWaypointNumber:Int32 = new Int32() with get,set
        member val FromLatitude:Double = new Double() with get,set
        member val FromLongitude:Double = new Double() with get,set
        member val ToLatitude:Double = new Double() with get,set
        member val ToLongitude:Double = new Double() with get,set

    [<AllowNullLiteral>]
    type WaypointQuoteInformation() = 
        inherit LinkedWaypoint()
        ///<summary>
        ///Distance between waypoints as a number
        ///</summary>
        [<ApiMember(Description="Distance between waypoints as a number")>]
        member val Distance:Double = new Double() with get,set

        ///<summary>
        ///String formatted distance
        ///</summary>
        [<ApiMember(Description="String formatted distance")>]
        member val DistanceValue:String = null with get,set

        member val WaypointValid:Boolean = new Boolean() with get,set
        member val Message:String = null with get,set
        member val ErrorDetails:ResizeArray<String> = new ResizeArray<String>() with get,set
        ///<summary>
        ///Caculated price between waypoints excluding vat
        ///</summary>
        [<ApiMember(Description="Caculated price between waypoints excluding vat")>]
        member val Price:Decimal = new Decimal() with get,set

        ///<summary>
        ///Price excluding vat formatted as a string rand value
        ///</summary>
        [<ApiMember(Description="Price excluding vat formatted as a string rand value")>]
        member val PriceValue:String = null with get,set

        ///<summary>
        ///The price between waypoints including vat
        ///</summary>
        [<ApiMember(Description="The price between waypoints including vat")>]
        member val PriceWithVAT:Decimal = new Decimal() with get,set

        ///<summary>
        ///The price including vat formatted as a rand value string
        ///</summary>
        [<ApiMember(Description="The price including vat formatted as a rand value string")>]
        member val PriceValueWithVAT:String = null with get,set

    [<AllowNullLiteral>]
    type ValidateWaypointsResponse() = 
        inherit ApiServiceResponse()
        ///<summary>
        ///List with validation information for each waypoint
        ///</summary>
        [<ApiMember(Description="List with validation information for each waypoint")>]
        member val WaypointValidations:ResizeArray<WaypointValidationInformation> = new ResizeArray<WaypointValidationInformation>() with get,set

        ///<summary>
        ///The total distance for the order
        ///</summary>
        [<ApiMember(Description="The total distance for the order")>]
        member val TotalDistance:Double = new Double() with get,set

        ///<summary>
        ///The total distance for the order, formatted as a string
        ///</summary>
        [<ApiMember(Description="The total distance for the order, formatted as a string")>]
        member val TotalDistanceValue:String = null with get,set

        ///<summary>
        ///List of information for pricing etc between each waypoint
        ///</summary>
        [<ApiMember(Description="List of information for pricing etc between each waypoint")>]
        member val Waypoints:ResizeArray<WaypointQuoteInformation> = new ResizeArray<WaypointQuoteInformation>() with get,set

        ///<summary>
        ///Is there an issue for the waypoints details specified?
        ///</summary>
        [<ApiMember(Description="Is there an issue for the waypoints details specified?")>]
        member val WaypointIssue:Boolean = new Boolean() with get,set

    [<AllowNullLiteral>]
    type ApiServiceRequest() = 
        ///<summary>
        ///The API Key required for authentication
        ///</summary>
        [<ApiMember(DataType="string", Description="The API Key required for authentication", IsRequired=true)>]
        member val ApiKey:String = null with get,set

    [<AllowNullLiteral>]
    type RequestQuoteWaypoint() = 
        ///<summary>
        ///Number of waypoint for ordering
        ///</summary>
        [<ApiMember(Description="Number of waypoint for ordering", IsRequired=true)>]
        member val WaypointNumber:Int32 = new Int32() with get,set

        ///<summary>
        ///Waypoint Latitude
        ///</summary>
        [<ApiMember(Description="Waypoint Latitude", IsRequired=true)>]
        member val Latitude:Double = new Double() with get,set

        ///<summary>
        ///Waypoint Longitude
        ///</summary>
        [<ApiMember(Description="Waypoint Longitude", IsRequired=true)>]
        member val Longitude:Double = new Double() with get,set

        ///<summary>
        ///Name of contact person at waypoint
        ///</summary>
        [<ApiMember(Description="Name of contact person at waypoint", IsRequired=true)>]
        member val ContactName:String = null with get,set

        ///<summary>
        ///Telephone number of contact person at waypoint
        ///</summary>
        [<ApiMember(Description="Telephone number of contact person at waypoint", IsRequired=true)>]
        member val ContactNumber:String = null with get,set

        ///<summary>
        ///Instructions for driver to follow at waypoint
        ///</summary>
        [<ApiMember(Description="Instructions for driver to follow at waypoint", IsRequired=true)>]
        member val DeliveryInstructions:String = null with get,set

        ///<summary>
        ///Waypoint address
        ///</summary>
        [<ApiMember(Description="Waypoint address", IsRequired=true)>]
        member val Address:String = null with get,set

    [<AllowNullLiteral>]
    type ValidateWaypoints() = 
        inherit ApiServiceRequest()
        ///<summary>
        ///Array of waypoints
        ///</summary>
        [<ApiMember(Description="Array of waypoints", IsRequired=true)>]
        member val Waypoints:ResizeArray<RequestQuoteWaypoint> = new ResizeArray<RequestQuoteWaypoint>() with get,set

        ///<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)>]
        member val Test:Boolean = new Boolean() with get,set

F# ValidateWaypoints DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other

HTTP + 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.)