api

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 Displays the command result in JSON format.
  • --quiet Displays the base URLs, 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

Note 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 olp api token get command.

api list

Lists all APIs offered by 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 Displays the command result in JSON format.
  • --quiet Displays the base URLs, 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://elb.cn-northwest-1.account.hereapi.cn",
            "api": "account",
            "version": "v1",
            "parameters": {}
        },
        {
            "baseURL": "https://elb.cn-northwest-1.account.hereapi.cn/authorization/v1.1",
            "api": "account",
            "version": "v1.1",
            "parameters": {}
        },
        {
            "baseURL": "https://artifact.api.platform.hereolp.cn/v1",
            "api": "artifact",
            "version": "v1",
            "parameters": {}
        },
        {
            "baseURL": "https://config.data.api.platform.hereolp.cn/config/v1",
            "api": "config",
            "version": "v1",
            "parameters": {}
        },
        {
            "baseURL": "https://api-lookup.data.api.platform.hereolp.cn/lookup/v1",
            "api": "lookup",
            "version": "v1",
            "parameters": {}
        },
        {
            "baseURL": "https://pipelines.api.platform.hereolp.cn/pipeline-service",
            "api": "pipelines",
            "version": "v2",
            "parameters": {}
        }
    ]
}

results matching ""

    No results matching ""