activateAdmin
Reactivate admin
/tenants/{tenant}/admins/{userId}/activate
Usage and SDK Samples
curl -X POST \
-H "X-API-Token: [[apiKey]]" \
"https://{tenant}.aptem.co.uk/api/1.0/tenants/{tenant}/admins/{userId}/activate"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.AdminsApi;
import java.io.File;
import java.util.*;
public class AdminsApiExample {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure API key authorization: api_key
ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key");
api_key.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.setApiKeyPrefix("Token");
// Create an instance of the API class
AdminsApi apiInstance = new AdminsApi();
String tenant = tenant_example; // String | The tenant name
Integer userId = 56; // Integer | User Id of the admin to activate
try {
apiInstance.activateAdmin(tenant, userId);
} catch (ApiException e) {
System.err.println("Exception when calling AdminsApi#activateAdmin");
e.printStackTrace();
}
}
}
import 'package:openapi/api.dart';
final api_instance = DefaultApi();
final String tenant = new String(); // String | The tenant name
final Integer userId = new Integer(); // Integer | User Id of the admin to activate
try {
final result = await api_instance.activateAdmin(tenant, userId);
print(result);
} catch (e) {
print('Exception when calling DefaultApi->activateAdmin: $e\n');
}
import org.openapitools.client.api.AdminsApi;
public class AdminsApiExample {
public static void main(String[] args) {
AdminsApi apiInstance = new AdminsApi();
String tenant = tenant_example; // String | The tenant name
Integer userId = 56; // Integer | User Id of the admin to activate
try {
apiInstance.activateAdmin(tenant, userId);
} catch (ApiException e) {
System.err.println("Exception when calling AdminsApi#activateAdmin");
e.printStackTrace();
}
}
}
Configuration *apiConfig = [Configuration sharedConfig];
// Configure API key authorization: (authentication scheme: api_key)
[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"];
// Create an instance of the API class
AdminsApi *apiInstance = [[AdminsApi alloc] init];
String *tenant = tenant_example; // The tenant name (default to null)
Integer *userId = 56; // User Id of the admin to activate (default to null)
// Reactivate admin
[apiInstance activateAdminWith:tenant
userId:userId
completionHandler: ^(NSError* error) {
if (error) {
NSLog(@"Error: %@", error);
}
}];
var AptemPublicApi = require('aptem_public_api');
var defaultClient = AptemPublicApi.ApiClient.instance;
// Configure API key authorization: api_key
var api_key = defaultClient.authentications['api_key'];
api_key.apiKey = "YOUR API KEY";
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix['X-API-Token'] = "Token";
// Create an instance of the API class
var api = new AptemPublicApi.AdminsApi()
var tenant = tenant_example; // {String} The tenant name
var userId = 56; // {Integer} User Id of the admin to activate
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully.');
}
};
api.activateAdmin(tenant, userId, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
namespace Example
{
public class activateAdminExample
{
public void main()
{
// Configure API key authorization: api_key
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");
// Create an instance of the API class
var apiInstance = new AdminsApi();
var tenant = tenant_example; // String | The tenant name (default to null)
var userId = 56; // Integer | User Id of the admin to activate (default to null)
try {
// Reactivate admin
apiInstance.activateAdmin(tenant, userId);
} catch (Exception e) {
Debug.Print("Exception when calling AdminsApi.activateAdmin: " + e.Message );
}
}
}
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: api_key
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');
// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\AdminsApi();
$tenant = tenant_example; // String | The tenant name
$userId = 56; // Integer | User Id of the admin to activate
try {
$api_instance->activateAdmin($tenant, $userId);
} catch (Exception $e) {
echo 'Exception when calling AdminsApi->activateAdmin: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::AdminsApi;
# Configure API key authorization: api_key
$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";
# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::AdminsApi->new();
my $tenant = tenant_example; # String | The tenant name
my $userId = 56; # Integer | User Id of the admin to activate
eval {
$api_instance->activateAdmin(tenant => $tenant, userId => $userId);
};
if ($@) {
warn "Exception when calling AdminsApi->activateAdmin: $@\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: api_key
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'
# Create an instance of the API class
api_instance = openapi_client.AdminsApi()
tenant = tenant_example # String | The tenant name (default to null)
userId = 56 # Integer | User Id of the admin to activate (default to null)
try:
# Reactivate admin
api_instance.activate_admin(tenant, userId)
except ApiException as e:
print("Exception when calling AdminsApi->activateAdmin: %s\n" % e)
extern crate AdminsApi;
pub fn main() {
let tenant = tenant_example; // String
let userId = 56; // Integer
let mut context = AdminsApi::Context::default();
let result = client.activateAdmin(tenant, userId, &context).wait();
println!("{:?}", result);
}
Scopes
Parameters
Name | Description |
---|---|
tenant* |
String
The tenant name
Required
|
userId* |
Integer
(int32)
User Id of the admin to activate
Required
|