Skip to content

Latest commit

 

History

History
213 lines (133 loc) · 5.36 KB

File metadata and controls

213 lines (133 loc) · 5.36 KB

\RouteOptimizationAPIApi

All URIs are relative to https://graphhopper.com/api/1

Method HTTP request Description
AsyncVRP Post /vrp/optimize POST route optimization problem (batch mode)
GetSolution Get /vrp/solution/{jobId} GET the solution (batch mode)
SolveVRP Post /vrp POST route optimization problem

AsyncVRP

JobId AsyncVRP(ctx).Request(request).Execute()

POST route optimization problem (batch mode)

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    request := *openapiclient.NewRequest() // Request | The request that contains the problem to be solved.

    configuration := openapiclient.NewConfiguration()
    api_client := openapiclient.NewAPIClient(configuration)
    resp, r, err := api_client.RouteOptimizationAPIApi.AsyncVRP(context.Background()).Request(request).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `RouteOptimizationAPIApi.AsyncVRP``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `AsyncVRP`: JobId
    fmt.Fprintf(os.Stdout, "Response from `RouteOptimizationAPIApi.AsyncVRP`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiAsyncVRPRequest struct via the builder pattern

Name Type Description Notes
request Request The request that contains the problem to be solved.

Return type

JobId

Authorization

api_key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetSolution

Response GetSolution(ctx, jobId).Execute()

GET the solution (batch mode)

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    jobId := "jobId_example" // string | Request solution with jobId

    configuration := openapiclient.NewConfiguration()
    api_client := openapiclient.NewAPIClient(configuration)
    resp, r, err := api_client.RouteOptimizationAPIApi.GetSolution(context.Background(), jobId).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `RouteOptimizationAPIApi.GetSolution``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `GetSolution`: Response
    fmt.Fprintf(os.Stdout, "Response from `RouteOptimizationAPIApi.GetSolution`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
jobId string Request solution with jobId

Other Parameters

Other parameters are passed through a pointer to a apiGetSolutionRequest struct via the builder pattern

Name Type Description Notes

Return type

Response

Authorization

api_key

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

SolveVRP

Response SolveVRP(ctx).Request(request).Execute()

POST route optimization problem

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    request := *openapiclient.NewRequest() // Request | The request that contains the vehicle routing problem to be solved.

    configuration := openapiclient.NewConfiguration()
    api_client := openapiclient.NewAPIClient(configuration)
    resp, r, err := api_client.RouteOptimizationAPIApi.SolveVRP(context.Background()).Request(request).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `RouteOptimizationAPIApi.SolveVRP``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `SolveVRP`: Response
    fmt.Fprintf(os.Stdout, "Response from `RouteOptimizationAPIApi.SolveVRP`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiSolveVRPRequest struct via the builder pattern

Name Type Description Notes
request Request The request that contains the vehicle routing problem to be solved.

Return type

Response

Authorization

api_key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]