Our Route Optimization API solves the so called vehicle routing problem fast. It calculates an optimal tour for a set of vehicles, services and constraints
This PHP package is automatically generated by the Swagger Codegen project:
- API version: 1.0
- Package version: 0.8-SNAPSHOT
- Build package: class io.swagger.codegen.languages.PhpClientCodegen
PHP 5.4.0 and later
To install the bindings via Composer, add the following to composer.json
:
{
"repositories": [
{
"type": "git",
"url": "https://github.com/graphhopper/directions-api-clients-route-optimization.git"
}
],
"require": {
"graphhopper/directions-api-clients-route-optimization": "*@dev"
}
}
Then run composer install
Download the files and include autoload.php
:
require_once('/path/to/SwaggerClient-php/autoload.php');
To run the unit tests:
composer install
./vendor/bin/phpunit
Please follow the installation procedure and then run the following:
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: api_key
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('key', 'Bearer');
$api_instance = new Swagger\Client\Api\SolutionApi();
$key = "key_example"; // string | your API key
$job_id = "job_id_example"; // string | Request solution with jobId
try {
$result = $api_instance->getSolution($key, $job_id);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling SolutionApi->getSolution: ', $e->getMessage(), PHP_EOL;
}
?>
All URIs are relative to https://graphhopper.com/api/1/vrp
Class | Method | HTTP request | Description |
---|---|---|---|
SolutionApi | getSolution | GET /solution/{jobId} | Return the solution associated to the jobId |
VrpApi | postVrp | POST /optimize | Solves vehicle routing problems |
- Activity
- Address
- Algorithm
- CostMatrix
- JobId
- ModelBreak
- Objective
- Relation
- Request
- Response
- Route
- Service
- Shipment
- Solution
- SolutionUnassigned
- Stop
- TimeWindow
- Vehicle
- VehicleType
- Type: API key
- API key parameter name: key
- Location: URL query string