createApiKey
Retrieve all the APIKeys for a given user UUID
/apiKey/{uuid}
Usage and SDK Samples
curl -X POST \
-H "X-API-KEY: [[apiKey]]" \
-H "X-API-TOKEN: [[apiKey]]" \
-H "Authorization: Bearer [[accessToken]]" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
"https://localhost:16001/api/v1/apiKey/{uuid}" \
-d '{
"lastUse" : 6,
"salt" : "salt",
"apiKey" : "apiKey",
"rights" : {
"acls" : [ {
"access" : "read",
"service" : "service"
}, {
"access" : "read",
"service" : "service"
} ]
},
"userUuid" : "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
"name" : "name",
"description" : "description",
"expiresOn" : 0,
"id" : "046b6c7f-0b8a-43b9-b35d-6489e6daee91"
}'
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.APITokensApi;
import java.io.File;
import java.util.*;
public class APITokensApiExample {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure API key authorization: ApiKeyAuth
ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth");
ApiKeyAuth.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.setApiKeyPrefix("Token");
// Configure API key authorization: ApiToken
ApiKeyAuth ApiToken = (ApiKeyAuth) defaultClient.getAuthentication("ApiToken");
ApiToken.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiToken.setApiKeyPrefix("Token");
// Configure Bearer (JWT) access token for authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
// Create an instance of the API class
APITokensApi apiInstance = new APITokensApi();
UUID uuid = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID |
ApiKeyEntry apiKeyEntry = ; // ApiKeyEntry |
try {
apiInstance.createApiKey(uuid, apiKeyEntry);
} catch (ApiException e) {
System.err.println("Exception when calling APITokensApi#createApiKey");
e.printStackTrace();
}
}
}
import org.openapitools.client.api.APITokensApi;
public class APITokensApiExample {
public static void main(String[] args) {
APITokensApi apiInstance = new APITokensApi();
UUID uuid = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID |
ApiKeyEntry apiKeyEntry = ; // ApiKeyEntry |
try {
apiInstance.createApiKey(uuid, apiKeyEntry);
} catch (ApiException e) {
System.err.println("Exception when calling APITokensApi#createApiKey");
e.printStackTrace();
}
}
}
Configuration *apiConfig = [Configuration sharedConfig];
// Configure API key authorization: (authentication scheme: ApiKeyAuth)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"X-API-KEY"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"X-API-KEY"];
// Configure API key authorization: (authentication scheme: ApiToken)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"X-API-TOKEN"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"X-API-TOKEN"];
// Configure Bearer (JWT) access token for authorization: bearerAuth
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
// Create an instance of the API class
APITokensApi *apiInstance = [[APITokensApi alloc] init];
UUID *uuid = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // (default to null)
ApiKeyEntry *apiKeyEntry = ; // (optional)
// Retrieve all the APIKeys for a given user UUID
[apiInstance createApiKeyWith:uuid
apiKeyEntry:apiKeyEntry
completionHandler: ^(NSError* error) {
if (error) {
NSLog(@"Error: %@", error);
}
}];
var UCentralSecurityApi = require('u_central_security_api');
var defaultClient = UCentralSecurityApi.ApiClient.instance;
// Configure API key authorization: ApiKeyAuth
var ApiKeyAuth = defaultClient.authentications['ApiKeyAuth'];
ApiKeyAuth.apiKey = "YOUR API KEY";
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.apiKeyPrefix['X-API-KEY'] = "Token";
// Configure API key authorization: ApiToken
var ApiToken = defaultClient.authentications['ApiToken'];
ApiToken.apiKey = "YOUR API KEY";
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiToken.apiKeyPrefix['X-API-TOKEN'] = "Token";
// Configure Bearer (JWT) access token for authorization: bearerAuth
var bearerAuth = defaultClient.authentications['bearerAuth'];
bearerAuth.accessToken = "YOUR ACCESS TOKEN";
// Create an instance of the API class
var api = new UCentralSecurityApi.APITokensApi()
var uuid = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {UUID}
var opts = {
'apiKeyEntry': // {ApiKeyEntry}
};
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully.');
}
};
api.createApiKey(uuid, opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
namespace Example
{
public class createApiKeyExample
{
public void main()
{
// Configure API key authorization: ApiKeyAuth
Configuration.Default.ApiKey.Add("X-API-KEY", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Configuration.Default.ApiKeyPrefix.Add("X-API-KEY", "Bearer");
// Configure API key authorization: ApiToken
Configuration.Default.ApiKey.Add("X-API-TOKEN", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Configuration.Default.ApiKeyPrefix.Add("X-API-TOKEN", "Bearer");
// Configure Bearer (JWT) access token for authorization: bearerAuth
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
// Create an instance of the API class
var apiInstance = new APITokensApi();
var uuid = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | (default to null)
var apiKeyEntry = new ApiKeyEntry(); // ApiKeyEntry | (optional)
try {
// Retrieve all the APIKeys for a given user UUID
apiInstance.createApiKey(uuid, apiKeyEntry);
} catch (Exception e) {
Debug.Print("Exception when calling APITokensApi.createApiKey: " + e.Message );
}
}
}
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: ApiKeyAuth
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKey('X-API-KEY', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-KEY', 'Bearer');
// Configure API key authorization: ApiToken
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKey('X-API-TOKEN', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-TOKEN', 'Bearer');
// Configure Bearer (JWT) access token for authorization: bearerAuth
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('', 'YOUR_ACCESS_TOKEN');
// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\APITokensApi();
$uuid = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID |
$apiKeyEntry = ; // ApiKeyEntry |
try {
$api_instance->createApiKey($uuid, $apiKeyEntry);
} catch (Exception $e) {
echo 'Exception when calling APITokensApi->createApiKey: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::APITokensApi;
# Configure API key authorization: ApiKeyAuth
$WWW::OPenAPIClient::Configuration::api_key->{'X-API-KEY'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::OPenAPIClient::Configuration::api_key_prefix->{'X-API-KEY'} = "Bearer";
# Configure API key authorization: ApiToken
$WWW::OPenAPIClient::Configuration::api_key->{'X-API-TOKEN'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::OPenAPIClient::Configuration::api_key_prefix->{'X-API-TOKEN'} = "Bearer";
# Configure Bearer (JWT) access token for authorization: bearerAuth
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::APITokensApi->new();
my $uuid = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID |
my $apiKeyEntry = WWW::OPenAPIClient::Object::ApiKeyEntry->new(); # ApiKeyEntry |
eval {
$api_instance->createApiKey(uuid => $uuid, apiKeyEntry => $apiKeyEntry);
};
if ($@) {
warn "Exception when calling APITokensApi->createApiKey: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: ApiKeyAuth
openapi_client.configuration.api_key['X-API-KEY'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# openapi_client.configuration.api_key_prefix['X-API-KEY'] = 'Bearer'
# Configure API key authorization: ApiToken
openapi_client.configuration.api_key['X-API-TOKEN'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# openapi_client.configuration.api_key_prefix['X-API-TOKEN'] = 'Bearer'
# Configure Bearer (JWT) access token for authorization: bearerAuth
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
# Create an instance of the API class
api_instance = openapi_client.APITokensApi()
uuid = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | (default to null)
apiKeyEntry = # ApiKeyEntry | (optional)
try:
# Retrieve all the APIKeys for a given user UUID
api_instance.create_api_key(uuid, apiKeyEntry=apiKeyEntry)
except ApiException as e:
print("Exception when calling APITokensApi->createApiKey: %s\n" % e)
extern crate APITokensApi;
pub fn main() {
let uuid = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID
let apiKeyEntry = ; // ApiKeyEntry
let mut context = APITokensApi::Context::default();
let result = client.createApiKey(uuid, apiKeyEntry, &context).wait();
println!("{:?}", result);
}
Scopes
Parameters
Name | Description |
---|---|
uuid* |
UUID
(uuid)
Required
|
Name | Description |
---|---|
apiKeyEntry |