API Commands

The OLP CLI supports the following HERE API commands:

api token get

Returns an access token that allows safe and secure communication with the HERE API.

olp api token get

Optional parameters:

  • --credentials <path to credentials file> The name of a credentials file to use with the command. Credentials files are downloaded separately from the platform portal.
  • --profile <profile name> The name of the credentials profile to use from the olpcli.ini file.
  • --scope <project HRN> Specifies the project HRN to use as the scope in the request. The value specified with --scope overrides any value for here.token.scope provided in the credentials file used for the command.
  • --json Display the command result in JSON format.
  • --quiet Display the base URL, each on a new line.

Example:

The command below gets the access token you can use to call HERE APIs.

olp api token get --json

Output:

{
    "accessToken": "eyJhbGciOiJSUz...omKF5Mg-sBjryw",
    "expiresAt": "2019-02-19T16:17:26.388Z"
}

Note: Access token expiration

Please mind that, for security reasons, HERE access tokens have a limited lifetime. The expiresAt field in the output above specifies the token's expiration date. If you try to call HERE APIs with an outdated token, you get a 401 Unauthorized error. In this case, you should obtain a new token by rerunning the api token get command.

api list

Lists all APIs offered by the the HERE platform.

olp api list [command options]

Optional parameters:

  • --credentials <path to credentials file> The name of a credentials file to use with the command. Credentials files are downloaded separately from the platform portal.
  • --profile <profile name> The name of the credentials profile to use from the olpcli.ini file.
  • --json Display the command result in JSON format.
  • --quiet Display the base URL, each on a new line.

For more information on using credentials and profiles, see Credentials Setup.

Example:

The command below lists all available APIs.

olp api list --json

Output:

{
    "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": {}
        }
    ]
}

results matching ""

    No results matching ""