Enables scripted content fragments to use API keys
Properties
| Name | Access | Type | Description |
|---|---|---|---|
| Current | Read | ApiKey | Current |
Methods
Create
Creates a new API Key
Velocity
#set($apiKeyResponse = $core_v2_apiKey.Create($name, "%{ Enabled = $enabledArg, ScopeIds = $scopeIdsArg, SecretKey = $secretKeyArg }"))JavaScript
var apiKeyResponse = core_v2_apiKey.Create(name, { Enabled: enabledArg, ScopeIds: scopeIdsArg, SecretKey: secretKeyArg });Parameters
| Name | Type | Description | Required | Default | Options |
|---|---|---|---|---|---|
| name | String | Name of the API Key | Required | ||
| options | Options | Set of optional parameters including: | Required | ||
| Enabled | Boolean | If the key is enabled or not | Optional | ||
| ScopeIds | String | A comma seperated list of the scopes that will enabled for this key. | Optional | ||
| SecretKey | String | Secret value to set the API key to | Optional |
Returns
Delete
Deletes an API Key
Velocity
#set($additionalInfoResponse = $core_v2_apiKey.Delete($id))
JavaScript
var additionalInfoResponse = core_v2_apiKey.Delete(id);
Parameters
| Name | Type | Description | Required | Default | Options |
|---|---|---|---|---|---|
| id | Int32 | Id of the API Key to delete | Required |
Returns
List
List Overload 1
Lists API Keys
Velocity
#set($pagedListResponse = $core_v2_apiKey.List())
JavaScript
var pagedListResponse = core_v2_apiKey.List();
List Overload 2
Lists API Keys
Velocity
#set($pagedListResponse = $core_v2_apiKey.List("%{ PageIndex = $pageIndexArg, PageSize = $pageSizeArg }"))JavaScript
var pagedListResponse = core_v2_apiKey.List({ PageIndex: pageIndexArg, PageSize: pageSizeArg });Parameters
| Name | Type | Description | Required | Default | Options |
|---|---|---|---|---|---|
| options | Options | Set of optional parameters including: | Required | ||
| PageIndex | Int32 | Zero-based Page Index | Optional | ||
| PageSize | Int32 | Results per page | Optional |
Returns
Update
Updates an API Key
Velocity
#set($apiKeyResponse = $core_v2_apiKey.Update($id, "%{ Enabled = $enabledArg, Name = $nameArg, Regenerate = $regenerateArg, ScopeIds = $scopeIdsArg, SecretKey = $secretKeyArg }"))JavaScript
var apiKeyResponse = core_v2_apiKey.Update(id, { Enabled: enabledArg, Name: nameArg, Regenerate: regenerateArg, ScopeIds: scopeIdsArg, SecretKey: secretKeyArg });Parameters
| Name | Type | Description | Required | Default | Options |
|---|---|---|---|---|---|
| id | Int32 | Id | Required | ||
| options | Options | Set of optional parameters including: | Required | ||
| Enabled | Boolean | If the key is enabled or not | Optional | ||
| Name | String | Name of the key | Optional | ||
| Regenerate | Boolean | When true, the SecretKey will be regenerated | Optional | ||
| ScopeIds | String | A comma seperated list of the scopes that will enabled for this key. To clear all scopes, pass an empty string. | Optional | ||
| SecretKey | String | Secret value to set the API key to | Optional |