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.
import java.math.*
import java.util.*
import net.servicestack.client.*


open class ValidateWaypoints : ApiServiceRequest(), ILogRequest
{
    /**
    * Array of waypoints
    */
    @ApiMember(Description="Array of waypoints", IsRequired=true)
    var Waypoints:ArrayList<RequestQuoteWaypoint> = ArrayList<RequestQuoteWaypoint>()

    /**
    * Set this to true to prevent while testing the API.
    */
    @ApiMember(Description="Set this to true to prevent while testing the API.", IsRequired=true)
    var Test:Boolean? = null
}

open class ApiServiceRequest : IServiceRequest, IHasApiKey
{
    /**
    * The API Key required for authentication
    */
    @ApiMember(DataType="string", Description="The API Key required for authentication", IsRequired=true)
    var ApiKey:String? = null
}

open class RequestQuoteWaypoint : IRequestWaypoint
{
    /**
    * Number of waypoint for ordering
    */
    @ApiMember(Description="Number of waypoint for ordering", IsRequired=true)
    var WaypointNumber:Int? = null

    /**
    * Waypoint Latitude
    */
    @ApiMember(Description="Waypoint Latitude", IsRequired=true)
    var Latitude:Double? = null

    /**
    * Waypoint Longitude
    */
    @ApiMember(Description="Waypoint Longitude", IsRequired=true)
    var Longitude:Double? = null

    /**
    * Name of contact person at waypoint
    */
    @ApiMember(Description="Name of contact person at waypoint", IsRequired=true)
    var ContactName:String? = null

    /**
    * Telephone number of contact person at waypoint
    */
    @ApiMember(Description="Telephone number of contact person at waypoint", IsRequired=true)
    var ContactNumber:String? = null

    /**
    * Instructions for driver to follow at waypoint
    */
    @ApiMember(Description="Instructions for driver to follow at waypoint", IsRequired=true)
    var DeliveryInstructions:String? = null

    /**
    * Waypoint address
    */
    @ApiMember(Description="Waypoint address", IsRequired=true)
    var Address:String? = null
}

open class ValidateWaypointsResponse : ApiServiceResponse()
{
    /**
    * List with validation information for each waypoint
    */
    @ApiMember(Description="List with validation information for each waypoint")
    var WaypointValidations:ArrayList<WaypointValidationInformation> = ArrayList<WaypointValidationInformation>()

    /**
    * The total distance for the order
    */
    @ApiMember(Description="The total distance for the order")
    var TotalDistance:Double? = null

    /**
    * The total distance for the order, formatted as a string
    */
    @ApiMember(Description="The total distance for the order, formatted as a string")
    var TotalDistanceValue:String? = null

    /**
    * List of information for pricing etc between each waypoint
    */
    @ApiMember(Description="List of information for pricing etc between each waypoint")
    var Waypoints:ArrayList<WaypointQuoteInformation> = ArrayList<WaypointQuoteInformation>()

    /**
    * Is there an issue for the waypoints details specified?
    */
    @ApiMember(Description="Is there an issue for the waypoints details specified?")
    var WaypointIssue:Boolean? = null
}

open class ApiServiceResponse : IServiceResponse
{
    /**
    * Information about the response.
    */
    @ApiMember(Description="Information about the response.", IsRequired=true)
    var Description:String? = null

    /**
    * Heading or summary of the response.
    */
    @ApiMember(Description="Heading or summary of the response.", IsRequired=true)
    var Heading:String? = null

    /**
    * Did the intended operation for this response complete successfully?
    */
    @ApiMember(DataType="boolean", Description="Did the intended operation for this response complete successfully?", IsRequired=true)
    var WasSuccessful:Boolean? = null
}

open class WaypointValidationInformation
{
    var WaypointNumber:Int? = null
    var IsValid:Boolean? = null
    var ErrorMessages:ArrayList<String> = ArrayList<String>()
}

open class WaypointQuoteInformation : LinkedWaypoint()
{
    /**
    * Distance between waypoints as a number
    */
    @ApiMember(Description="Distance between waypoints as a number")
    var Distance:Double? = null

    /**
    * String formatted distance
    */
    @ApiMember(Description="String formatted distance")
    var DistanceValue:String? = null

    var WaypointValid:Boolean? = null
    var Message:String? = null
    var ErrorDetails:ArrayList<String> = ArrayList<String>()
    /**
    * Caculated price between waypoints excluding vat
    */
    @ApiMember(Description="Caculated price between waypoints excluding vat")
    var Price:BigDecimal? = null

    /**
    * Price excluding vat formatted as a string rand value
    */
    @ApiMember(Description="Price excluding vat formatted as a string rand value")
    var PriceValue:String? = null

    /**
    * The price between waypoints including vat
    */
    @ApiMember(Description="The price between waypoints including vat")
    var PriceWithVAT:BigDecimal? = null

    /**
    * The price including vat formatted as a rand value string
    */
    @ApiMember(Description="The price including vat formatted as a rand value string")
    var PriceValueWithVAT:String? = null
}

open class LinkedWaypoint
{
    var FromWaypointNumber:Int? = null
    var ToWaypointNumber:Int? = null
    var FromLatitude:Double? = null
    var FromLongitude:Double? = null
    var ToLatitude:Double? = null
    var ToLongitude:Double? = null
}

Kotlin 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.)