createLicenseKey
Create a license key
Customer support creates a license key directly for a server (e.g. based on IP address)
/licensekeys
Usage and SDK Samples
curl -X POST "https://reseller-api.bitninja.io/v1/licensekeys"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.LicenseKeysApi;
import java.io.File;
import java.util.*;
public class LicenseKeysApiExample {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure OAuth2 access token for authorization: reseller_api_auth
OAuth reseller_api_auth = (OAuth) defaultClient.getAuthentication("reseller_api_auth");
reseller_api_auth.setAccessToken("YOUR ACCESS TOKEN");
LicenseKeysApi apiInstance = new LicenseKeysApi();
NewLicenseKey body = ; // NewLicenseKey | Server whom the license has to be attached
try {
apiInstance.createLicenseKey(body);
} catch (ApiException e) {
System.err.println("Exception when calling LicenseKeysApi#createLicenseKey");
e.printStackTrace();
}
}
}
import io.swagger.client.api.LicenseKeysApi;
public class LicenseKeysApiExample {
public static void main(String[] args) {
LicenseKeysApi apiInstance = new LicenseKeysApi();
NewLicenseKey body = ; // NewLicenseKey | Server whom the license has to be attached
try {
apiInstance.createLicenseKey(body);
} catch (ApiException e) {
System.err.println("Exception when calling LicenseKeysApi#createLicenseKey");
e.printStackTrace();
}
}
}
Configuration *apiConfig = [Configuration sharedConfig];
// Configure OAuth2 access token for authorization: (authentication scheme: reseller_api_auth)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
NewLicenseKey *body = ; // Server whom the license has to be attached
LicenseKeysApi *apiInstance = [[LicenseKeysApi alloc] init];
// Create a license key
[apiInstance createLicenseKeyWith:body
completionHandler: ^(NSError* error) {
if (error) {
NSLog(@"Error: %@", error);
}
}];
var BitNinjaioResellerApi = require('bit_ninjaio_reseller_api');
var defaultClient = BitNinjaioResellerApi.ApiClient.instance;
// Configure OAuth2 access token for authorization: reseller_api_auth
var reseller_api_auth = defaultClient.authentications['reseller_api_auth'];
reseller_api_auth.accessToken = "YOUR ACCESS TOKEN"
var api = new BitNinjaioResellerApi.LicenseKeysApi()
var body = ; // {NewLicenseKey} Server whom the license has to be attached
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully.');
}
};
api.createLicenseKey(body, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;
namespace Example
{
public class createLicenseKeyExample
{
public void main()
{
// Configure OAuth2 access token for authorization: reseller_api_auth
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new LicenseKeysApi();
var body = new NewLicenseKey(); // NewLicenseKey | Server whom the license has to be attached
try
{
// Create a license key
apiInstance.createLicenseKey(body);
}
catch (Exception e)
{
Debug.Print("Exception when calling LicenseKeysApi.createLicenseKey: " + e.Message );
}
}
}
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: reseller_api_auth
Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$api_instance = new Swagger\Client\Api\LicenseKeysApi();
$body = ; // NewLicenseKey | Server whom the license has to be attached
try {
$api_instance->createLicenseKey($body);
} catch (Exception $e) {
echo 'Exception when calling LicenseKeysApi->createLicenseKey: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::LicenseKeysApi;
# Configure OAuth2 access token for authorization: reseller_api_auth
$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
my $api_instance = WWW::SwaggerClient::LicenseKeysApi->new();
my $body = WWW::SwaggerClient::Object::NewLicenseKey->new(); # NewLicenseKey | Server whom the license has to be attached
eval {
$api_instance->createLicenseKey(body => $body);
};
if ($@) {
warn "Exception when calling LicenseKeysApi->createLicenseKey: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure OAuth2 access token for authorization: reseller_api_auth
swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
# create an instance of the API class
api_instance = swagger_client.LicenseKeysApi()
body = # NewLicenseKey | Server whom the license has to be attached
try:
# Create a license key
api_instance.create_license_key(body)
except ApiException as e:
print("Exception when calling LicenseKeysApi->createLicenseKey: %s\n" % e)
Parameters
Name | Description |
---|---|
body * |