AppSync / Client / create_api_key
create_api_key#
- AppSync.Client.create_api_key(**kwargs)#
Creates a unique key that you can distribute to clients who invoke your API.
See also: AWS API Documentation
Request Syntax
response = client.create_api_key( apiId='string', description='string', expires=123 )
- Parameters:
apiId (string) –
[REQUIRED]
The ID for your GraphQL API.
description (string) – A description of the purpose of the API key.
expires (integer) – From the creation time, the time after which the API key expires. The date is represented as seconds since the epoch, rounded down to the nearest hour. The default value for this parameter is 7 days from creation time. For more information, see .
- Return type:
dict
- Returns:
Response Syntax
{ 'apiKey': { 'id': 'string', 'description': 'string', 'expires': 123, 'deletes': 123 } }
Response Structure
(dict) –
apiKey (dict) –
The API key.
id (string) –
The API key ID.
description (string) –
A description of the purpose of the API key.
expires (integer) –
The time after which the API key expires. The date is represented as seconds since the epoch, rounded down to the nearest hour.
deletes (integer) –
The time after which the API key is deleted. The date is represented as seconds since the epoch, rounded down to the nearest hour.
Exceptions