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.
using System;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization;
using ServiceStack;
using ServiceStack.DataAnnotations;
using WebService.ClientServiceModel;
using WebService.ClientServiceModel.Base;
using BusinessLogic.Entities;

namespace BusinessLogic.Entities
{
    public partial class LinkedWaypoint
    {
        public virtual int FromWaypointNumber { get; set; }
        public virtual int ToWaypointNumber { get; set; }
        public virtual double FromLatitude { get; set; }
        public virtual double FromLongitude { get; set; }
        public virtual double ToLatitude { get; set; }
        public virtual double ToLongitude { get; set; }
    }

}

namespace WebService.ClientServiceModel
{
    public partial class RequestQuoteWaypoint
        : IRequestWaypoint
    {
        ///<summary>
        ///Number of waypoint for ordering
        ///</summary>
        [ApiMember(Description="Number of waypoint for ordering", IsRequired=true)]
        public virtual int WaypointNumber { get; set; }

        ///<summary>
        ///Waypoint Latitude
        ///</summary>
        [ApiMember(Description="Waypoint Latitude", IsRequired=true)]
        public virtual double Latitude { get; set; }

        ///<summary>
        ///Waypoint Longitude
        ///</summary>
        [ApiMember(Description="Waypoint Longitude", IsRequired=true)]
        public virtual double Longitude { get; set; }

        ///<summary>
        ///Name of contact person at waypoint
        ///</summary>
        [ApiMember(Description="Name of contact person at waypoint", IsRequired=true)]
        public virtual string ContactName { get; set; }

        ///<summary>
        ///Telephone number of contact person at waypoint
        ///</summary>
        [ApiMember(Description="Telephone number of contact person at waypoint", IsRequired=true)]
        public virtual string ContactNumber { get; set; }

        ///<summary>
        ///Instructions for driver to follow at waypoint
        ///</summary>
        [ApiMember(Description="Instructions for driver to follow at waypoint", IsRequired=true)]
        public virtual string DeliveryInstructions { get; set; }

        ///<summary>
        ///Waypoint address
        ///</summary>
        [ApiMember(Description="Waypoint address", IsRequired=true)]
        public virtual string Address { get; set; }
    }

    public partial class ValidateWaypoints
        : ApiServiceRequest, ILogRequest
    {
        public ValidateWaypoints()
        {
            Waypoints = new List<RequestQuoteWaypoint>{};
        }

        ///<summary>
        ///Array of waypoints
        ///</summary>
        [ApiMember(Description="Array of waypoints", IsRequired=true)]
        public virtual List<RequestQuoteWaypoint> Waypoints { 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)]
        public virtual bool Test { get; set; }
    }

    public partial class ValidateWaypointsResponse
        : ApiServiceResponse
    {
        public ValidateWaypointsResponse()
        {
            WaypointValidations = new List<WaypointValidationInformation>{};
            Waypoints = new List<WaypointQuoteInformation>{};
        }

        ///<summary>
        ///List with validation information for each waypoint
        ///</summary>
        [ApiMember(Description="List with validation information for each waypoint")]
        public virtual List<WaypointValidationInformation> WaypointValidations { get; set; }

        ///<summary>
        ///The total distance for the order
        ///</summary>
        [ApiMember(Description="The total distance for the order")]
        public virtual double TotalDistance { 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")]
        public virtual string TotalDistanceValue { get; set; }

        ///<summary>
        ///List of information for pricing etc between each waypoint
        ///</summary>
        [ApiMember(Description="List of information for pricing etc between each waypoint")]
        public virtual List<WaypointQuoteInformation> Waypoints { get; set; }

        ///<summary>
        ///Is there an issue for the waypoints details specified?
        ///</summary>
        [ApiMember(Description="Is there an issue for the waypoints details specified?")]
        public virtual bool WaypointIssue { get; set; }
    }

    public partial class WaypointQuoteInformation
        : LinkedWaypoint
    {
        public WaypointQuoteInformation()
        {
            ErrorDetails = new List<string>{};
        }

        ///<summary>
        ///Distance between waypoints as a number
        ///</summary>
        [ApiMember(Description="Distance between waypoints as a number")]
        public virtual double Distance { get; set; }

        ///<summary>
        ///String formatted distance
        ///</summary>
        [ApiMember(Description="String formatted distance")]
        public virtual string DistanceValue { get; set; }

        public virtual bool WaypointValid { get; set; }
        public virtual string Message { get; set; }
        public virtual List<string> ErrorDetails { get; set; }
        ///<summary>
        ///Caculated price between waypoints excluding vat
        ///</summary>
        [ApiMember(Description="Caculated price between waypoints excluding vat")]
        public virtual decimal Price { get; set; }

        ///<summary>
        ///Price excluding vat formatted as a string rand value
        ///</summary>
        [ApiMember(Description="Price excluding vat formatted as a string rand value")]
        public virtual string PriceValue { get; set; }

        ///<summary>
        ///The price between waypoints including vat
        ///</summary>
        [ApiMember(Description="The price between waypoints including vat")]
        public virtual decimal PriceWithVAT { 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")]
        public virtual string PriceValueWithVAT { get; set; }
    }

    public partial class WaypointValidationInformation
    {
        public WaypointValidationInformation()
        {
            ErrorMessages = new List<string>{};
        }

        public virtual int WaypointNumber { get; set; }
        public virtual bool IsValid { get; set; }
        public virtual List<string> ErrorMessages { get; set; }
    }

}

namespace WebService.ClientServiceModel.Base
{
    public partial class ApiServiceRequest
        : IServiceRequest, IHasApiKey
    {
        ///<summary>
        ///The API Key required for authentication
        ///</summary>
        [ApiMember(DataType="string", Description="The API Key required for authentication", IsRequired=true)]
        public virtual string ApiKey { get; set; }
    }

    public partial class ApiServiceResponse
        : IServiceResponse
    {
        ///<summary>
        ///Information about the response.
        ///</summary>
        [ApiMember(Description="Information about the response.", IsRequired=true)]
        public virtual string Description { get; set; }

        ///<summary>
        ///Heading or summary of the response.
        ///</summary>
        [ApiMember(Description="Heading or summary of the response.", IsRequired=true)]
        public virtual string Heading { 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)]
        public virtual bool WasSuccessful { get; set; }
    }

}

C# ValidateWaypoints DTOs

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

HTTP + CSV

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: 1fetch.api.client.prod.86degrees.com 
Accept: text/csv
Content-Type: text/csv
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/csv
Content-Length: length

{Unable to show example output for type 'ValidateWaypointsResponse' using the custom 'csv' filter}One or more errors occurred. (Object reference not set to an instance of an object.)