Skip to main content

keys

Creates, updates, deletes, gets or lists a keys resource.

Overview

Namekeys
TypeResource
Idgoogle.apigee.keys

Fields

NameDatatypeDescription
apiProductsarrayOutput only. List of API products and its status for which the credential can be used. Note: Use UpdateAppGroupAppKeyApiProductRequest API to make the association after the consumer key and secret are created.
attributesarrayList of attributes associated with the credential.
consumerKeystringImmutable. Consumer key.
consumerSecretstringSecret key.
expiresAtstringOutput only. Time the AppGroup app expires in milliseconds since epoch.
expiresInSecondsstringImmutable. Expiration time, in seconds, for the consumer key. If not set or left to the default value of -1, the API key never expires. The expiration time can't be updated after it is set.
issuedAtstringOutput only. Time the AppGroup app was created in milliseconds since epoch.
scopesarrayScopes to apply to the app. The specified scope names must already be defined for the API product that you associate with the app.
statusstringStatus of the credential. Valid values include approved or revoked.

Methods

NameAccessible byRequired ParamsDescription
organizations_appgroups_apps_keys_getSELECTappgroupsId, appsId, keysId, organizationsIdGets details for a consumer key for a AppGroup app, including the key and secret value, associated API products, and other information.
organizations_developers_apps_keys_getSELECTappsId, developersId, keysId, organizationsIdGets details for a consumer key for a developer app, including the key and secret value, associated API products, and other information.
organizations_appgroups_apps_keys_createINSERTappgroupsId, appsId, organizationsIdCreates a custom consumer key and secret for a AppGroup app. This is particularly useful if you want to migrate existing consumer keys and secrets to Apigee from another system. Consumer keys and secrets can contain letters, numbers, underscores, and hyphens. No other special characters are allowed. To avoid service disruptions, a consumer key and secret should not exceed 2 KBs each. Note: When creating the consumer key and secret, an association to API products will not be made. Therefore, you should not specify the associated API products in your request. Instead, use the ProductizeAppGroupAppKey API to make the association after the consumer key and secret are created. If a consumer key and secret already exist, you can keep them or delete them using the DeleteAppGroupAppKey API.
organizations_developers_apps_keys_createINSERTappsId, developersId, organizationsIdCreates a custom consumer key and secret for a developer app. This is particularly useful if you want to migrate existing consumer keys and secrets to Apigee from another system. Consumer keys and secrets can contain letters, numbers, underscores, and hyphens. No other special characters are allowed. To avoid service disruptions, a consumer key and secret should not exceed 2 KBs each. Note: When creating the consumer key and secret, an association to API products will not be made. Therefore, you should not specify the associated API products in your request. Instead, use the UpdateDeveloperAppKey API to make the association after the consumer key and secret are created. If a consumer key and secret already exist, you can keep them or delete them using the DeleteDeveloperAppKey API. Note: All keys start out with status=approved, even if status=revoked is passed when the key is created. To revoke a key, use the UpdateDeveloperAppKey API.
organizations_appgroups_apps_keys_deleteDELETEappgroupsId, appsId, keysId, organizationsIdDeletes an app's consumer key and removes all API products associated with the app. After the consumer key is deleted, it cannot be used to access any APIs.
organizations_developers_apps_keys_deleteDELETEappsId, developersId, keysId, organizationsIdDeletes an app's consumer key and removes all API products associated with the app. After the consumer key is deleted, it cannot be used to access any APIs. Note: After you delete a consumer key, you may want to: 1. Create a new consumer key and secret for the developer app using the CreateDeveloperAppKey API, and subsequently add an API product to the key using the UpdateDeveloperAppKey API. 2. Delete the developer app, if it is no longer required.
organizations_developers_apps_keys_replace_developer_app_keyREPLACEappsId, developersId, keysId, organizationsIdUpdates the scope of an app. This API replaces the existing scopes with those specified in the request. Include or exclude any existing scopes that you want to retain or delete, respectively. The specified scopes must already be defined for the API products associated with the app. This API sets the scopes element under the apiProducts element in the attributes of the app.

SELECT examples

Gets details for a consumer key for a AppGroup app, including the key and secret value, associated API products, and other information.

SELECT
apiProducts,
attributes,
consumerKey,
consumerSecret,
expiresAt,
expiresInSeconds,
issuedAt,
scopes,
status
FROM google.apigee.keys
WHERE appgroupsId = '{{ appgroupsId }}'
AND appsId = '{{ appsId }}'
AND keysId = '{{ keysId }}'
AND organizationsId = '{{ organizationsId }}';

INSERT example

Use the following StackQL query and manifest file to create a new keys resource.

/*+ create */
INSERT INTO google.apigee.keys (
appgroupsId,
appsId,
organizationsId,
scopes,
expiresInSeconds,
consumerSecret,
consumerKey,
attributes,
status
)
SELECT
'{{ appgroupsId }}',
'{{ appsId }}',
'{{ organizationsId }}',
'{{ scopes }}',
'{{ expiresInSeconds }}',
'{{ consumerSecret }}',
'{{ consumerKey }}',
'{{ attributes }}',
'{{ status }}'
;

REPLACE example

Replaces all fields in the specified keys resource.

/*+ update */
REPLACE google.apigee.keys
SET
consumerKey = '{{ consumerKey }}',
apiProducts = '{{ apiProducts }}',
consumerSecret = '{{ consumerSecret }}',
issuedAt = '{{ issuedAt }}',
scopes = '{{ scopes }}',
status = '{{ status }}',
expiresAt = '{{ expiresAt }}',
attributes = '{{ attributes }}',
expiresInSeconds = '{{ expiresInSeconds }}'
WHERE
appsId = '{{ appsId }}'
AND developersId = '{{ developersId }}'
AND keysId = '{{ keysId }}'
AND organizationsId = '{{ organizationsId }}';

DELETE example

Deletes the specified keys resource.

/*+ delete */
DELETE FROM google.apigee.keys
WHERE appgroupsId = '{{ appgroupsId }}'
AND appsId = '{{ appsId }}'
AND keysId = '{{ keysId }}'
AND organizationsId = '{{ organizationsId }}';