Get usage by organization

The Usage API allows you to query usage for your organization(s), and uses a realm ID for each organization. Additional filters can be added using query parameters, to query by app ID, project HRN, or billing tag. When filters are added, the response includes elements which match the filter criteria.

There is a groupBy feature which allows you to group usage data together in the response by selecting a category, such as location services, content, SDKs, pipelines, or data. By default, there is the groupBy appId, name, and billingTag, which means that all of these properties are included in the response.

Billable usage is calculated at the hour level. The API supports detail at the levels of summarized, hour, day and month, with the default level set to summarized. The principle must be part of the organization requesting usage. The maximum time range that can be queried is 95 days.

API response records are sorted alphabetically in ascending order by subscription ID, category, and charge item (differentiates features within the same service and is linked to the corresponding charge).

Request

This example uses org123456789 as the realmId.

    GET https://usage.bam.api.here.com/v2/usage/realms/org123456789

Parameters

The parameters shown here are necessary for this request. For a complete list of parameters, see the Tutorials overview.

realmId required string [ 5 .. 30 ] characters
Example: org123456789
Your org ID.
startDate
required
string
Example: startDate=yyyy-MM-dd'T'HH:mm:ss
The start date for a search.
endDate
required
string
Example: endDate=yyyy-MM-dd'T'HH:mm:ss
>End date for a search.
featureId string less than or equal to 256 characters
Example: featureId=hrn:here:service::org123456789:search-geocoding-1
Feature HRN.
appId string less than or equal to 128 characters
Example: appId=j1dasda012edasfgne
Client application ID. This is the application ID which was created in the platform.
channelId string
Enum: "hot" "cold"
Example: channelId=cold
When this parameter is provided, the results are filtered by the ID identifying the channel used for the usage reporting. A cold channel is a new billing data processing pipeline, whereas the hot channel is the old billing data processing pipeline. ChannelId is used for testing purposes.
projectHrn string less than or equal to 256 characters
Example: projectHrn=hrn:here:authorization::myrealm:project/my-project-0000
The HRN which identifies the project.
billingTag string less than or equal to 500 characters
Example: billingTag=testtag
Billing tags are used for combining costs on your invoices.
category string less than or equal to 128 characters
Example: category=Pipelines
The category is the name of the service you have selected, such as location services, content, SDKs, data, or pipelines, for which you are billed.
limit integer [ 1 .. 100 ]
Default: 100
The number of records returned. The default and maximum is 100 records.
offset integer greater than or equal to 0
Default: 0
The offset determines the current page number on the search results view.
detailLevel string
Enum: "summarized" "hour" "day" "month"
Example: detailLevel=hour
You can use this query parameter to select one of the levels of detail to view in your usage records. Levels of detail include: summarized, hour, day, or month. The summarized detail level shows you a summary of your usage and is the default. The usageDateTime field value is not present if detailLevel is set to summarized.
groupBy string less than or equal to 256 characters
Example: groupBy=appId, billingTag, project, resource
The groupBy parameter is a comma seperated list of parameters which combine as groups. Supported values are project, billingTag, appId, featureId, and subscription ID. The default groupBy parameters are featureId and subscription ID. When groupBy parameters are added in the query, they are added to featureId and subscription ID.
usageFields Array of strings
Enum:
realmId: Organization ID.
featureId: Feature HRN.
billingSubscriptionId: The subscription ID for your organization.
billingChargeNumber: Unique charge identifier that maps to corresponding service usage costs. This number is combined with corresponding usage value to compute billable costs.
category: The product category, such as pipelines, data, content, SDKs, and location services.
name: The name of the organization.
valueDriver: The unit of usage value. For example, GB or Transactions.
usageValue: Numerical metric to measure customer usage for a particular service.
billableValue: The amount of billable usage accrued.
resource: All the usage data statistics retrieved and presented to the user.
Example: usageFields=realmId,featureId,category
A set of unique/distinct usage field names which are used to filter responses.
Example: usageFields=realmId,featureId,category
A set of unique/distinct usage field names which are used to filter responses.

Header parameters

X-Request-ID string
User-provided token that can be used to trace a request or a group of requests sent to the service.
X-Correlation-ID
required
string
Auto-generated ID, which uniquely identifies the request, available in the response. When contacting the support with an inquiry regarding a specific request, provide the value of this header; This will help troubleshooting the issue.

Response: HTTP 200 OK

{
    "total": 10,
    "limit": 2,
    "items":[
    {
      "realmId": "org123456789",
      "featureId": "hrn:here:service::org123456789:search-geocoding-1",
      "billingSubscriptionId": "A-S00000021",
      "billingChargeNumber": "C-00011212",
      "category": "service",
      "name": "Geocoder Autosuggest",
      "valueDriver": "Transactions",
      "usageValue": "10",
      "billableValue": "10"
    },
    {
      "realmId": "org123456789",
      "featureId": "hrn:here:service::org123456789:search-geocoding-1",
      "billingSubscriptionId": "A-S00000021",
      "billingChargeNumber": "C-0001124",
      "category": "service",
      "name": "Lane attributes",
      "valueDriver": "GB",
      "usageValue": "10",
      "billableValue": "10"
    }
  ], 
    "nextOffset": 1,
    "lastOffset": 4
}

More information can be found in the Usage API Reference.

results matching ""

    No results matching ""