Search for content

API Key Management and Usage

The Account API provides the possibility to manage API keys and to track the usage of your PTV Developer subscriptions programmatically. Of course, you can still do this within your account by using the API keys app and the usage monitor app.

In general, all methods of the Account API need a master API key for authentication. Only paid subscriptions are allowed to have multiple API keys and provide this master API key.

How to get a master API key

If you have a paid PTV Developer subscription allowing multiple API keys, you can create a master API key in the API keys app of your account.

 

Master Key Create

 

Within the app, just select the tab 'Master API key' and push the button 'Create master API Key'. Once created, copy the master API key to the clipboard and use it for authentication of your Account API requests as query parameter or in the header.

 

Master Key Use

 

Please note that you do do not mix up the master API key with standard API keys. The Account API requires for authentication the master API key and all other APIs require the standard API keys. Otherwise you get the error code GENERAL_FORBIDDEN with the description "Insufficient access rights".

API Key Management

The Account API provides the possibility to create, update and delete API keys with the typical CRUD operations:

  • createApiKey: Create a new API key.
  • getApiKeys: Get all API keys of the current subscription.
  • updateApiKey: Update the description of an API key.
  • deleteApiKey: Delete an API key.

Please note that the description of an API key does not have to be unique within a PTV Developer subscription. To simplify the handling, it is recommended to do so.

In general, you can only manage API keys that are not deleted, but you get their usage.

For further details please refer to the Account API reference.

Usage

The Account API provides the possibility to track the usage of your PTV Developer subscriptions with this method:

  • getUsage: Retrieve the usage for the given period.

The usage can be requested for any time period with a limit of 60 days or for the current billing period. The response is hierarchically structured:

  • Level 1: List of all API keys including deleted API keys and if available the master API key
  • Level 2: List of all services (per API key)
  • Level 3: List of all days with the charged transactions and the number of sent requests (per API key and per service)

In general, API keys are only returned with the first letters due to security reasons. Moreover, the total usage for the requested period, for each API key and for each service is also available in the response. Deleted API keys are marked. Please note that the response only contains the days with a non-zero usage.

For further details please refer to the Account API reference.