API Workflows

The HERE platform allows users to work directly with the REST API. OLP CLI provides helper tools to facilitate direct calls to the REST API, such as:

For more details, see API Commands.

The following steps show how to combine the functionality of OLP CLI to fetch access token and list of endpoints with direct call to REST API by curl.

Get API Token

To get a new API token, enter the api token get command.

olp api token get --json

The command displays the following results.

{
    "accessToken": "eyJhbG...LMXA",
    "expiresAt": "2019-03-07T10:56:51.329Z"
}

List All API Endpoints

To list all endpoints offered by the HERE platform, use the api list command.

olp api list --json

The command displays the following results:

{"apis": [
    {
        "baseURL": "https://account.api.here.com",
        "api": "account",
        "version": "v1",
        "parameters": {}
    },
    {
        "baseURL": "https://artifact.api.platform.here.com/v1",
        "api": "artifact",
        "version": "v1",
        "parameters": {}
    },
    {
        "baseURL": "https://config.data.api.platform.here.com/config/v1",
        "api": "config",
        "version": "v1",
        "parameters": {}
    },
    {
        "baseURL": "https://api-lookup.data.api.platform.here.com/lookup/v1",
        "api": "lookup",
        "version": "v1",
        "parameters": {}
    },
    {
        "baseURL": "https://marketplace.api.platform.here.com/api/v1",
        "api": "marketplace",
        "version": "v1",
        "parameters": {}
    },
    {
        "baseURL": "https://pipelines.api.platform.here.com/pipeline-service",
        "api": "pipelines",
        "version": "v2",
        "parameters": {}
    }
]}

Call REST API with Curl

To get catalogs to which you have access, execute the following command:

Note

Download and install curl to execute the command below.


curl -k -s -H "Authorization: Bearer eyJhbG...LMXA" https://config.data.api.platform.here.com/config/v1/catalogs

This is equivalent to running the catalog list command.

The command displays results like below:


{
  "results": {
    "items": [
      {
        "title": "HERE - Sensor Sample Data",
        "hrn": "hrn:here:data::olp-here:sensor-sample-data",
        "href": "https://config.data.api.platform.here.com/config/v1/catalogs/hrn:here:data::olp-here:sensor-sample-data",
        "type": "urn:olp-types:catalog"
      },
      {
        "title": "HERE Live Weather Europe",
        "hrn": "hrn:here:data::olp-here:live-weather-eu",
        "href": "https://config.data.api.platform.here.com/config/v1/catalogs/hrn:here:data::olp-here:live-weather-eu",
        "type": "urn:olp-types:catalog"
      },
      {
        "title": "HERE Map Content",
        "hrn": "hrn:here:data::olp-here:rib-2",
        "href": "https://config.data.api.platform.here.com/config/v1/catalogs/hrn:here:data::olp-here:rib-2",
        "type": "urn:olp-types:catalog"
      }
    ]
  }
}

For more information on the APIs that the platform offers, see Data Hub API, Lookup API, and Pipeline API.

results matching ""

    No results matching ""