api
api
The OLP CLI supports the following HERE API commands:
- get token for API access
- list general, platform-wide APIs
- show service information
api token get
Returns an access token that allows safe and secure communication with the HERE API.
olp api token getOptional 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 theolpcli.inifile.--scope <project HRN>Specifies the project HRN to use as the scope in the request. The value specified with--scopeoverrides any value forhere.token.scopeprovided in the credentials file used for the command.--jsonDisplays the command result in JSON format.--quietDisplays 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 --jsonOutput:
{
"accessToken": "eyJhbGciOiJSUz...omKF5Mg-sBjryw",
"expiresAt": "2019-02-19T16:17:26.388Z"
}
NoteAccess token expiration
Note that, for security reasons, HERE access tokens have a limited lifetime. The
expiresAtfield in the output above specifies the token's expiration date. If you try to call HERE APIs with an outdated token, you get a401 Unauthorizederror. In this case, you should obtain a new token by rerunning theolp api token getcommand.
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 theolpcli.inifile.--jsonDisplays the command result in JSON format.--quietDisplays 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 --jsonOutput:
{
"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 theolpcli.inifile.--jsonDisplays the command result in JSON format.--quietReduces 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-cd164f2ce35fOutput:
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 trackingOutput:
serviceId SERVICE-b470f80f-726d-41e8-8b5a-cd164f2ce35f
serviceIdAlias tracking
resourceTypes adminportal, tracking, lastmile
allowedActions
action resourceRequired
create true
read true
update true
delete trueUpdated 21 days ago