GuidesChangelogData Inspector Library API Reference
Guides

api

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://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://pipelines.api.platform.here.com/pipeline-service",
            "api": "pipelines",
            "version": "v2",
            "parameters": {}
        }
    ]
}

olp api service show

Shows service information for given service ID or service ID alias. Note, to get service ID or service ID alias, use the olp resource type list command

olp api service show --service-id <serviceId> [command parameters]
olp api service show --service-id-alias <serviceIdAlias> [command parameters]

Required parameters:

  • Only one of the following parameters:
    • --service-id <serviceId> The ID of the service.
    • --service-id-alias <serviceAlias> The ID alias of the service.

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 HERE 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 Reduces the output to essential values only, in this case it's an empty string.

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

Example:

The command below shows service info for given service ID. The output is in verbose format.

olp api service show --service-id SERVICE-b470f80f-726d-41e8-8b5a-cd164f2ce35f

Output:

serviceId       SERVICE-b470f80f-726d-41e8-8b5a-cd164f2ce35f
serviceIdAlias  tracking
resourceTypes   adminportal, tracking, lastmile
allowedActions
   action       resourceRequired
   create       true
   read         true
   update       true
   delete       true

Example:

The command below shows service info given serviceIdAlias. The output is in verbose format.

olp api service show --service-id-alias tracking

Output:

serviceId       SERVICE-b470f80f-726d-41e8-8b5a-cd164f2ce35f
serviceIdAlias  tracking
resourceTypes   adminportal, tracking, lastmile
allowedActions
   action       resourceRequired
   create       true
   read         true
   update       true
   delete       true