2017 © Pedro Peláez
 

library here-php

PHP SDK for here.com API

image

lajosbencz/here-php

PHP SDK for here.com API

  • Friday, July 6, 2018
  • by lazos
  • Repository
  • 1 Watchers
  • 0 Stars
  • 3 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

here-php

This document describes the Geocoding and Search API., (*1)

Installation & Usage

Requirements

PHP 7.2 and later., (*2)

Composer

To install the bindings via Composer, add the following to composer.json:, (*3)

{
  "repositories": [
    {
      "type": "vcs",
      "url": "https://github.com/lajosbencz/here-php.git"
    }
  ],
  "require": {
    "lajosbencz/here-php": "*@dev"
  }
}

Then run composer install, (*4)

Manual Installation

Download the files and include autoload.php:, (*5)

<?php
require_once('/path/to/here-php/vendor/autoload.php');

Getting Started

Please follow the installation procedure and then run the following:, (*6)

<?php
require_once(__DIR__ . '/vendor/autoload.php');



// Configure API key authorization: apiKey
$config = Here\Configuration::getDefaultConfiguration()->setApiKey('apiKey', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Here\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer');

// Configure Bearer (JWT) authorization: bearerAuth
$config = Here\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Here\Api\DefaultApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$q = Berlin Pariser 20; // string | Enter a free-text query  Examples:  * `ber`, `berl`, `berli`, ...  * `berlin+p`, `berlin+paris`, `berlin+parise`, ...  * `berlin+pariser+20`   _Note: Whitespace, urls, email addresses, or other out-of-scope queries will yield no results._
$at = 'at_example'; // string | Specify the center of the search context expressed as coordinates.  Format: `{latitude},{longitude}`  Type: `{decimal},{decimal}`  Example: `-13.163068,-72.545128` (Machu Picchu Mountain, Peru)
$in = 'in_example'; // string | Search within a geographic area. This is a hard filter. Results will be returned if they are located within the specified area.  A geographic area can be   * a country (or multiple countries), provided as comma-separated [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) country codes     The country codes are to be provided in all uppercase.     Format: `countryCode:{countryCode}[,{countryCode}]*`     Examples:     * `countryCode:USA`     * `countryCode:CAN,MEX,USA`
$limit = 5; // int | Maximum number of results to be returned.
$types = array('types_example'); // string[] | BETA: Limit the result items to the specified types. Currently supported values of the type filter for Autocomplete:       | * `city` - restricting results to result type `locality` and locality type `city`       | * `postalCode` - restricting results to result type `locality` and locality type `postalCode`,       | * `area` - restricting results to result types: `locality` or `administrativeArea` including all the sub-types       |       |Provide one of the supported values or a comma separated list.       |       |
$lang = 'lang_example'; // string | Select the preferred response language for result rendering from a list of BCP47 compliant Language Codes. The autocomplete endpoint tries to detect the query language based on matching name variants and then chooses the same language for the response.  Therefore the end-user can see and recognize all the entered terms in the same language as in the query. The specified preferred language is used only for not matched address tokens and for matched address tokens in case of ambiguity
$x_request_id = 'x_request_id_example'; // string | Used to correlate requests with their responses within a customer's application, for logging and error reporting.  Format: Free string, but a valid UUIDv4 is recommended.

try {
    $result = $apiInstance->autocompleteGet($q, $at, $in, $limit, $types, $lang, $x_request_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling DefaultApi->autocompleteGet: ', $e->getMessage(), PHP_EOL;
}

API Endpoints

All URIs are relative to http://localhost, (*7)

Class Method HTTP request Description
DefaultApi autocompleteGet GET /autocomplete Autocomplete
DefaultApi autosuggestGet GET /autosuggest Autosuggest
DefaultApi browseGet GET /browse Browse
DefaultApi discoverGet GET /discover Discover
DefaultApi geocodeGet GET /geocode Geocode
DefaultApi lookupGet GET /lookup Lookup By ID
DefaultApi revgeocodeGet GET /revgeocode Reverse Geocode

Models

Authorization

apiKey

  • Type: API key
  • API key parameter name: apiKey
  • Location: URL query string

bearerAuth

  • Type: Bearer authentication (JWT)

Tests

To run the tests, use:, (*8)

composer install
vendor/bin/phpunit

Author

About this package

This PHP package is automatically generated by the OpenAPI Generator project:, (*9)

  • API version: 1.59
  • Build package: org.openapitools.codegen.languages.PhpClientCodegen

The Versions

06/07 2018

dev-master

9999999-dev

PHP SDK for here.com API

  Sources   Download

GPL-3.0

by Lajos Bencz

06/07 2018

v0.1.1

0.1.1.0

PHP SDK for here.com API

  Sources   Download

GPL-3.0

by Lajos Bencz

06/07 2018

v0.1.0

0.1.0.0

PHP SDK for here.com API

  Sources   Download

GPLv3

by Lajos Bencz