|
| 1 | +# LaunchDarklyApi.AccessTokensApi |
| 2 | + |
| 3 | +All URIs are relative to *https://app.launchdarkly.com/api/v2* |
| 4 | + |
| 5 | +Method | HTTP request | Description |
| 6 | +------------- | ------------- | ------------- |
| 7 | +[**deleteToken**](AccessTokensApi.md#deleteToken) | **DELETE** /tokens/{tokenId} | Delete an access token by ID. |
| 8 | +[**getToken**](AccessTokensApi.md#getToken) | **GET** /tokens/{tokenId} | Get a single access token by ID. |
| 9 | +[**getTokens**](AccessTokensApi.md#getTokens) | **GET** /tokens | Returns a list of tokens in the account. |
| 10 | +[**patchToken**](AccessTokensApi.md#patchToken) | **PATCH** /tokens/{tokenId} | Modify an access tokenby ID. |
| 11 | +[**postToken**](AccessTokensApi.md#postToken) | **POST** /tokens | Create a new token. |
| 12 | +[**resetToken**](AccessTokensApi.md#resetToken) | **POST** /tokens/{tokenId}/reset | Reset an access token's secret key with an optional expiry time for the old key. |
| 13 | + |
| 14 | + |
| 15 | +<a name="deleteToken"></a> |
| 16 | +# **deleteToken** |
| 17 | +> deleteToken(tokenId) |
| 18 | +
|
| 19 | +Delete an access token by ID. |
| 20 | + |
| 21 | +### Example |
| 22 | +```javascript |
| 23 | +var LaunchDarklyApi = require('launchdarkly-api'); |
| 24 | +var defaultClient = LaunchDarklyApi.ApiClient.instance; |
| 25 | + |
| 26 | +// Configure API key authorization: Token |
| 27 | +var Token = defaultClient.authentications['Token']; |
| 28 | +Token.apiKey = 'YOUR API KEY'; |
| 29 | +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) |
| 30 | +//Token.apiKeyPrefix = 'Token'; |
| 31 | + |
| 32 | +var apiInstance = new LaunchDarklyApi.AccessTokensApi(); |
| 33 | + |
| 34 | +var tokenId = "tokenId_example"; // String | The access token ID. |
| 35 | + |
| 36 | + |
| 37 | +var callback = function(error, data, response) { |
| 38 | + if (error) { |
| 39 | + console.error(error); |
| 40 | + } else { |
| 41 | + console.log('API called successfully.'); |
| 42 | + } |
| 43 | +}; |
| 44 | +apiInstance.deleteToken(tokenId, callback); |
| 45 | +``` |
| 46 | + |
| 47 | +### Parameters |
| 48 | + |
| 49 | +Name | Type | Description | Notes |
| 50 | +------------- | ------------- | ------------- | ------------- |
| 51 | + **tokenId** | **String**| The access token ID. | |
| 52 | + |
| 53 | +### Return type |
| 54 | + |
| 55 | +null (empty response body) |
| 56 | + |
| 57 | +### Authorization |
| 58 | + |
| 59 | +[Token](../README.md#Token) |
| 60 | + |
| 61 | +### HTTP request headers |
| 62 | + |
| 63 | + - **Content-Type**: application/json |
| 64 | + - **Accept**: application/json |
| 65 | + |
| 66 | +<a name="getToken"></a> |
| 67 | +# **getToken** |
| 68 | +> Token getToken(tokenId) |
| 69 | +
|
| 70 | +Get a single access token by ID. |
| 71 | + |
| 72 | +### Example |
| 73 | +```javascript |
| 74 | +var LaunchDarklyApi = require('launchdarkly-api'); |
| 75 | +var defaultClient = LaunchDarklyApi.ApiClient.instance; |
| 76 | + |
| 77 | +// Configure API key authorization: Token |
| 78 | +var Token = defaultClient.authentications['Token']; |
| 79 | +Token.apiKey = 'YOUR API KEY'; |
| 80 | +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) |
| 81 | +//Token.apiKeyPrefix = 'Token'; |
| 82 | + |
| 83 | +var apiInstance = new LaunchDarklyApi.AccessTokensApi(); |
| 84 | + |
| 85 | +var tokenId = "tokenId_example"; // String | The access token ID. |
| 86 | + |
| 87 | + |
| 88 | +var callback = function(error, data, response) { |
| 89 | + if (error) { |
| 90 | + console.error(error); |
| 91 | + } else { |
| 92 | + console.log('API called successfully. Returned data: ' + data); |
| 93 | + } |
| 94 | +}; |
| 95 | +apiInstance.getToken(tokenId, callback); |
| 96 | +``` |
| 97 | + |
| 98 | +### Parameters |
| 99 | + |
| 100 | +Name | Type | Description | Notes |
| 101 | +------------- | ------------- | ------------- | ------------- |
| 102 | + **tokenId** | **String**| The access token ID. | |
| 103 | + |
| 104 | +### Return type |
| 105 | + |
| 106 | +[**Token**](Token.md) |
| 107 | + |
| 108 | +### Authorization |
| 109 | + |
| 110 | +[Token](../README.md#Token) |
| 111 | + |
| 112 | +### HTTP request headers |
| 113 | + |
| 114 | + - **Content-Type**: application/json |
| 115 | + - **Accept**: application/json |
| 116 | + |
| 117 | +<a name="getTokens"></a> |
| 118 | +# **getTokens** |
| 119 | +> Tokens getTokens(opts) |
| 120 | +
|
| 121 | +Returns a list of tokens in the account. |
| 122 | + |
| 123 | +### Example |
| 124 | +```javascript |
| 125 | +var LaunchDarklyApi = require('launchdarkly-api'); |
| 126 | +var defaultClient = LaunchDarklyApi.ApiClient.instance; |
| 127 | + |
| 128 | +// Configure API key authorization: Token |
| 129 | +var Token = defaultClient.authentications['Token']; |
| 130 | +Token.apiKey = 'YOUR API KEY'; |
| 131 | +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) |
| 132 | +//Token.apiKeyPrefix = 'Token'; |
| 133 | + |
| 134 | +var apiInstance = new LaunchDarklyApi.AccessTokensApi(); |
| 135 | + |
| 136 | +var opts = { |
| 137 | + 'showAll': true // Boolean | If set to true, and the authentication access token has the \"Admin\" role, personal access tokens for all members will be retrieved. |
| 138 | +}; |
| 139 | + |
| 140 | +var callback = function(error, data, response) { |
| 141 | + if (error) { |
| 142 | + console.error(error); |
| 143 | + } else { |
| 144 | + console.log('API called successfully. Returned data: ' + data); |
| 145 | + } |
| 146 | +}; |
| 147 | +apiInstance.getTokens(opts, callback); |
| 148 | +``` |
| 149 | + |
| 150 | +### Parameters |
| 151 | + |
| 152 | +Name | Type | Description | Notes |
| 153 | +------------- | ------------- | ------------- | ------------- |
| 154 | + **showAll** | **Boolean**| If set to true, and the authentication access token has the \"Admin\" role, personal access tokens for all members will be retrieved. | [optional] |
| 155 | + |
| 156 | +### Return type |
| 157 | + |
| 158 | +[**Tokens**](Tokens.md) |
| 159 | + |
| 160 | +### Authorization |
| 161 | + |
| 162 | +[Token](../README.md#Token) |
| 163 | + |
| 164 | +### HTTP request headers |
| 165 | + |
| 166 | + - **Content-Type**: application/json |
| 167 | + - **Accept**: application/json |
| 168 | + |
| 169 | +<a name="patchToken"></a> |
| 170 | +# **patchToken** |
| 171 | +> Token patchToken(tokenIdpatchDelta) |
| 172 | +
|
| 173 | +Modify an access tokenby ID. |
| 174 | + |
| 175 | +### Example |
| 176 | +```javascript |
| 177 | +var LaunchDarklyApi = require('launchdarkly-api'); |
| 178 | +var defaultClient = LaunchDarklyApi.ApiClient.instance; |
| 179 | + |
| 180 | +// Configure API key authorization: Token |
| 181 | +var Token = defaultClient.authentications['Token']; |
| 182 | +Token.apiKey = 'YOUR API KEY'; |
| 183 | +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) |
| 184 | +//Token.apiKeyPrefix = 'Token'; |
| 185 | + |
| 186 | +var apiInstance = new LaunchDarklyApi.AccessTokensApi(); |
| 187 | + |
| 188 | +var tokenId = "tokenId_example"; // String | The access token ID. |
| 189 | + |
| 190 | +var patchDelta = [new LaunchDarklyApi.PatchOperation()]; // [PatchOperation] | Requires a JSON Patch representation of the desired changes to the project. 'http://jsonpatch.com/' |
| 191 | + |
| 192 | + |
| 193 | +var callback = function(error, data, response) { |
| 194 | + if (error) { |
| 195 | + console.error(error); |
| 196 | + } else { |
| 197 | + console.log('API called successfully. Returned data: ' + data); |
| 198 | + } |
| 199 | +}; |
| 200 | +apiInstance.patchToken(tokenIdpatchDelta, callback); |
| 201 | +``` |
| 202 | + |
| 203 | +### Parameters |
| 204 | + |
| 205 | +Name | Type | Description | Notes |
| 206 | +------------- | ------------- | ------------- | ------------- |
| 207 | + **tokenId** | **String**| The access token ID. | |
| 208 | + **patchDelta** | [**[PatchOperation]**](PatchOperation.md)| Requires a JSON Patch representation of the desired changes to the project. 'http://jsonpatch.com/' | |
| 209 | + |
| 210 | +### Return type |
| 211 | + |
| 212 | +[**Token**](Token.md) |
| 213 | + |
| 214 | +### Authorization |
| 215 | + |
| 216 | +[Token](../README.md#Token) |
| 217 | + |
| 218 | +### HTTP request headers |
| 219 | + |
| 220 | + - **Content-Type**: application/json |
| 221 | + - **Accept**: application/json |
| 222 | + |
| 223 | +<a name="postToken"></a> |
| 224 | +# **postToken** |
| 225 | +> Token postToken(tokenBody) |
| 226 | +
|
| 227 | +Create a new token. |
| 228 | + |
| 229 | +### Example |
| 230 | +```javascript |
| 231 | +var LaunchDarklyApi = require('launchdarkly-api'); |
| 232 | +var defaultClient = LaunchDarklyApi.ApiClient.instance; |
| 233 | + |
| 234 | +// Configure API key authorization: Token |
| 235 | +var Token = defaultClient.authentications['Token']; |
| 236 | +Token.apiKey = 'YOUR API KEY'; |
| 237 | +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) |
| 238 | +//Token.apiKeyPrefix = 'Token'; |
| 239 | + |
| 240 | +var apiInstance = new LaunchDarklyApi.AccessTokensApi(); |
| 241 | + |
| 242 | +var tokenBody = new LaunchDarklyApi.TokenBody(); // TokenBody | Create a new access token. |
| 243 | + |
| 244 | + |
| 245 | +var callback = function(error, data, response) { |
| 246 | + if (error) { |
| 247 | + console.error(error); |
| 248 | + } else { |
| 249 | + console.log('API called successfully. Returned data: ' + data); |
| 250 | + } |
| 251 | +}; |
| 252 | +apiInstance.postToken(tokenBody, callback); |
| 253 | +``` |
| 254 | + |
| 255 | +### Parameters |
| 256 | + |
| 257 | +Name | Type | Description | Notes |
| 258 | +------------- | ------------- | ------------- | ------------- |
| 259 | + **tokenBody** | [**TokenBody**](TokenBody.md)| Create a new access token. | |
| 260 | + |
| 261 | +### Return type |
| 262 | + |
| 263 | +[**Token**](Token.md) |
| 264 | + |
| 265 | +### Authorization |
| 266 | + |
| 267 | +[Token](../README.md#Token) |
| 268 | + |
| 269 | +### HTTP request headers |
| 270 | + |
| 271 | + - **Content-Type**: application/json |
| 272 | + - **Accept**: application/json |
| 273 | + |
| 274 | +<a name="resetToken"></a> |
| 275 | +# **resetToken** |
| 276 | +> Token resetToken(tokenId, opts) |
| 277 | +
|
| 278 | +Reset an access token's secret key with an optional expiry time for the old key. |
| 279 | + |
| 280 | +### Example |
| 281 | +```javascript |
| 282 | +var LaunchDarklyApi = require('launchdarkly-api'); |
| 283 | +var defaultClient = LaunchDarklyApi.ApiClient.instance; |
| 284 | + |
| 285 | +// Configure API key authorization: Token |
| 286 | +var Token = defaultClient.authentications['Token']; |
| 287 | +Token.apiKey = 'YOUR API KEY'; |
| 288 | +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) |
| 289 | +//Token.apiKeyPrefix = 'Token'; |
| 290 | + |
| 291 | +var apiInstance = new LaunchDarklyApi.AccessTokensApi(); |
| 292 | + |
| 293 | +var tokenId = "tokenId_example"; // String | The access token ID. |
| 294 | + |
| 295 | +var opts = { |
| 296 | + 'expiry': 789 // Number | An expiration time for the old token key, expressed as a Unix epoch time in milliseconds. By default, the token will expire immediately. |
| 297 | +}; |
| 298 | + |
| 299 | +var callback = function(error, data, response) { |
| 300 | + if (error) { |
| 301 | + console.error(error); |
| 302 | + } else { |
| 303 | + console.log('API called successfully. Returned data: ' + data); |
| 304 | + } |
| 305 | +}; |
| 306 | +apiInstance.resetToken(tokenId, opts, callback); |
| 307 | +``` |
| 308 | + |
| 309 | +### Parameters |
| 310 | + |
| 311 | +Name | Type | Description | Notes |
| 312 | +------------- | ------------- | ------------- | ------------- |
| 313 | + **tokenId** | **String**| The access token ID. | |
| 314 | + **expiry** | **Number**| An expiration time for the old token key, expressed as a Unix epoch time in milliseconds. By default, the token will expire immediately. | [optional] |
| 315 | + |
| 316 | +### Return type |
| 317 | + |
| 318 | +[**Token**](Token.md) |
| 319 | + |
| 320 | +### Authorization |
| 321 | + |
| 322 | +[Token](../README.md#Token) |
| 323 | + |
| 324 | +### HTTP request headers |
| 325 | + |
| 326 | + - **Content-Type**: application/json |
| 327 | + - **Accept**: application/json |
| 328 | + |
0 commit comments