deleteApikey
Delete an API key.
Delete an API key
/apikeys/{id}
Usage and SDK Samples
curl -X DELETE\
-H "Authorization: [[apiKey]]"\
-H "Content-Type: application/json"\
"https://elab.local:3148/api/v2/apikeys/{id}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ApiKeysApi;
import java.io.File;
import java.util.*;
public class ApiKeysApiExample {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure API key authorization: token
ApiKeyAuth token = (ApiKeyAuth) defaultClient.getAuthentication("token");
token.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//token.setApiKeyPrefix("Token");
ApiKeysApi apiInstance = new ApiKeysApi();
Integer id = 56; // Integer | ID of the API key
try {
apiInstance.deleteApikey(id);
} catch (ApiException e) {
System.err.println("Exception when calling ApiKeysApi#deleteApikey");
e.printStackTrace();
}
}
}
import io.swagger.client.api.ApiKeysApi;
public class ApiKeysApiExample {
public static void main(String[] args) {
ApiKeysApi apiInstance = new ApiKeysApi();
Integer id = 56; // Integer | ID of the API key
try {
apiInstance.deleteApikey(id);
} catch (ApiException e) {
System.err.println("Exception when calling ApiKeysApi#deleteApikey");
e.printStackTrace();
}
}
}
Configuration *apiConfig = [Configuration sharedConfig];
// Configure API key authorization: (authentication scheme: token)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"Authorization"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"Authorization"];
Integer *id = 56; // ID of the API key
ApiKeysApi *apiInstance = [[ApiKeysApi alloc] init];
// Delete an API key.
[apiInstance deleteApikeyWith:id
completionHandler: ^(NSError* error) {
if (error) {
NSLog(@"Error: %@", error);
}
}];
var ELabFtwRestApiV2Documentation = require('e_lab_ftw_rest_api_v2_documentation');
var defaultClient = ELabFtwRestApiV2Documentation.ApiClient.instance;
// Configure API key authorization: token
var token = defaultClient.authentications['token'];
token.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//token.apiKeyPrefix['Authorization'] = "Token"
var api = new ELabFtwRestApiV2Documentation.ApiKeysApi()
var id = 56; // {{Integer}} ID of the API key
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully.');
}
};
api.deleteApikey(id, callback);
using System;
using System.Diagnostics;
using elabapi_python.Api;
using elabapi_python.Client;
using elabapi_python.Model;
namespace Example
{
public class deleteApikeyExample
{
public void main()
{
// Configure API key authorization: token
Configuration.Default.ApiKey.Add("Authorization", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Configuration.Default.ApiKeyPrefix.Add("Authorization", "Bearer");
var apiInstance = new ApiKeysApi();
var id = 56; // Integer | ID of the API key
try
{
// Delete an API key.
apiInstance.deleteApikey(id);
}
catch (Exception e)
{
Debug.Print("Exception when calling ApiKeysApi.deleteApikey: " + e.Message );
}
}
}
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: token
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer');
$api_instance = new Swagger\Client\ApiApiKeysApi();
$id = 56; // Integer | ID of the API key
try {
$api_instance->deleteApikey($id);
} catch (Exception $e) {
echo 'Exception when calling ApiKeysApi->deleteApikey: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ApiKeysApi;
# Configure API key authorization: token
$WWW::SwaggerClient::Configuration::api_key->{'Authorization'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'Authorization'} = "Bearer";
my $api_instance = WWW::SwaggerClient::ApiKeysApi->new();
my $id = 56; # Integer | ID of the API key
eval {
$api_instance->deleteApikey(id => $id);
};
if ($@) {
warn "Exception when calling ApiKeysApi->deleteApikey: $@\n";
}
from __future__ import print_statement
import time
import elabapi_python
from elabapi_python.rest import ApiException
from pprint import pprint
# Configure API key authorization: token
elabapi_python.configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# elabapi_python.configuration.api_key_prefix['Authorization'] = 'Bearer'
# create an instance of the API class
api_instance = elabapi_python.ApiKeysApi()
id = 56 # Integer | ID of the API key
try:
# Delete an API key.
api_instance.delete_apikey(id)
except ApiException as e:
print("Exception when calling ApiKeysApi->deleteApikey: %s\n" % e)
Parameters
Name | Description |
---|---|
id* |
Integer
ID of the API key
Required
|