Delete /api/v1/routing/{routeModelId}/stops/{sourceReference}

Removes a stop from the routing model

Request parameters:

routeModelId

RouteModelId – (url) the route model returned from the POST endpoint

sourceReference

SourceReference- (url) the client’s unique id of the stop.

Sample code

C#
Java
NodeJS
PHP
Python
using System;
using System.Net.Http;
using System.Threading.Tasks;

class Program
{
    static async Task Main(string[] args)
    {
        // Define the endpoint URL with routeModelId and sourceReference directly in the path
        string endpoint = "https://api.locate2u.com/api/v1/routing/{routeModelId}/stops/{sourceReference}";

        // Define the bearer token
        string bearerToken = "YOUR_BEARER_TOKEN_HERE";

        // Create HttpClient instance
        using (HttpClient client = new HttpClient())
        {
            // Add bearer token to the request headers
            client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", bearerToken);

            // Send the DELETE request
            HttpResponseMessage response = await client.DeleteAsync(endpoint);

            // Check if request was successful
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine("Request successful");
            }
            else
            {
                Console.WriteLine($"Request failed with status code {response.StatusCode}");
            }
        }
    }
}

Response

Reponse:

Http 200
Http 422
Array of ErrorResponse Object