API Commands

The Open Location Platform Command Line Interface (OLP CLI) supports the following OLP API commands:

api token get

Returns an access token that allows safe and secure communication with the Open Location Platform 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 OLP 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 OLP 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, OLP access tokens have a limited lifetime. The expiresAt field in the output above specifies the token's expiration date. If you try to call OLP 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 Open Location 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 OLP 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 ""