Skip to content

Latest commit

 

History

History
743 lines (551 loc) · 21.1 KB

AdminApi.md

File metadata and controls

743 lines (551 loc) · 21.1 KB

AdminApi

All URIs are relative to https://v2.namsor.com/NamSorAPIv2

Method HTTP request Description
anonymize GET /api2/json/anonymize/{source}/{anonymized} Activate/deactivate anonymization for a source.
anonymize1 GET /api2/json/anonymize/{source}/{anonymized}/{token} Activate/deactivate anonymization for a source.
apiKeyInfo GET /api2/json/apiKeyInfo Read API Key info.
apiStatus GET /api2/json/apiStatus Prints the current status of the classifiers. A classifier name in apiStatus corresponds to a service name in apiServices.
apiUsage GET /api2/json/apiUsage Print current API usage.
apiUsageHistory GET /api2/json/apiUsageHistory Print historical API usage.
apiUsageHistoryAggregate GET /api2/json/apiUsageHistoryAggregate Print historical API usage (in an aggregated view, by service, by day/hour/min).
availableServices GET /api2/json/apiServices List of classification services and usage cost in Units per classification (default is 1=ONE Unit). Some API endpoints (ex. Corridor) combine multiple classifiers.
disable GET /api2/json/disable/{source}/{disabled} Activate/deactivate an API Key.
learnable GET /api2/json/learnable/{source}/{learnable}/{token} Activate/deactivate learning from a source.
learnable1 GET /api2/json/learnable/{source}/{learnable} Activate/deactivate learning from a source.
regions GET /api2/json/regions Print basic source statistics.
softwareVersion GET /api2/json/softwareVersion Get the current software version
taxonomyClasses GET /api2/json/taxonomyClasses/{classifierName} Print the taxonomy classes valid for the given classifier.

anonymize

anonymize(source, anonymized)

Activate/deactivate anonymization for a source.

Example

// Import classes:
//import com.namsor.sdk2.invoke.ApiClient;
//import com.namsor.sdk2.invoke.ApiException;
//import com.namsor.sdk2.invoke.Configuration;
//import com.namsor.sdk2.invoke.auth.*;
//import com.namsor.sdk2.api.AdminApi;

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");

AdminApi apiInstance = new AdminApi();
String source = "source_example"; // String | 
Boolean anonymized = true; // Boolean | 
try {
    apiInstance.anonymize(source, anonymized);
} catch (ApiException e) {
    System.err.println("Exception when calling AdminApi#anonymize");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
source String
anonymized Boolean

Return type

null (empty response body)

Authorization

api_key

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

anonymize1

APIKeyOut anonymize1(source, anonymized, token)

Activate/deactivate anonymization for a source.

Example

// Import classes:
//import com.namsor.sdk2.invoke.ApiClient;
//import com.namsor.sdk2.invoke.ApiException;
//import com.namsor.sdk2.invoke.Configuration;
//import com.namsor.sdk2.invoke.auth.*;
//import com.namsor.sdk2.api.AdminApi;

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");

AdminApi apiInstance = new AdminApi();
String source = "source_example"; // String | 
Boolean anonymized = true; // Boolean | 
String token = "token_example"; // String | 
try {
    APIKeyOut result = apiInstance.anonymize1(source, anonymized, token);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling AdminApi#anonymize1");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
source String
anonymized Boolean
token String

Return type

APIKeyOut

Authorization

api_key

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

apiKeyInfo

APIKeyOut apiKeyInfo()

Read API Key info.

Example

// Import classes:
//import com.namsor.sdk2.invoke.ApiClient;
//import com.namsor.sdk2.invoke.ApiException;
//import com.namsor.sdk2.invoke.Configuration;
//import com.namsor.sdk2.invoke.auth.*;
//import com.namsor.sdk2.api.AdminApi;

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");

AdminApi apiInstance = new AdminApi();
try {
    APIKeyOut result = apiInstance.apiKeyInfo();
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling AdminApi#apiKeyInfo");
    e.printStackTrace();
}

Parameters

This endpoint does not need any parameter.

Return type

APIKeyOut

Authorization

api_key

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

apiStatus

APIClassifiersStatusOut apiStatus()

Prints the current status of the classifiers. A classifier name in apiStatus corresponds to a service name in apiServices.

Example

// Import classes:
//import com.namsor.sdk2.invoke.ApiClient;
//import com.namsor.sdk2.invoke.ApiException;
//import com.namsor.sdk2.invoke.Configuration;
//import com.namsor.sdk2.invoke.auth.*;
//import com.namsor.sdk2.api.AdminApi;

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");

AdminApi apiInstance = new AdminApi();
try {
    APIClassifiersStatusOut result = apiInstance.apiStatus();
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling AdminApi#apiStatus");
    e.printStackTrace();
}

Parameters

This endpoint does not need any parameter.

Return type

APIClassifiersStatusOut

Authorization

api_key

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

apiUsage

APIPeriodUsageOut apiUsage()

Print current API usage.

Example

// Import classes:
//import com.namsor.sdk2.invoke.ApiClient;
//import com.namsor.sdk2.invoke.ApiException;
//import com.namsor.sdk2.invoke.Configuration;
//import com.namsor.sdk2.invoke.auth.*;
//import com.namsor.sdk2.api.AdminApi;

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");

AdminApi apiInstance = new AdminApi();
try {
    APIPeriodUsageOut result = apiInstance.apiUsage();
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling AdminApi#apiUsage");
    e.printStackTrace();
}

Parameters

This endpoint does not need any parameter.

Return type

APIPeriodUsageOut

Authorization

api_key

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

apiUsageHistory

APIUsageHistoryOut apiUsageHistory()

Print historical API usage.

Example

// Import classes:
//import com.namsor.sdk2.invoke.ApiClient;
//import com.namsor.sdk2.invoke.ApiException;
//import com.namsor.sdk2.invoke.Configuration;
//import com.namsor.sdk2.invoke.auth.*;
//import com.namsor.sdk2.api.AdminApi;

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");

AdminApi apiInstance = new AdminApi();
try {
    APIUsageHistoryOut result = apiInstance.apiUsageHistory();
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling AdminApi#apiUsageHistory");
    e.printStackTrace();
}

Parameters

This endpoint does not need any parameter.

Return type

APIUsageHistoryOut

Authorization

api_key

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

apiUsageHistoryAggregate

APIUsageAggregatedOut apiUsageHistoryAggregate()

Print historical API usage (in an aggregated view, by service, by day/hour/min).

Example

// Import classes:
//import com.namsor.sdk2.invoke.ApiClient;
//import com.namsor.sdk2.invoke.ApiException;
//import com.namsor.sdk2.invoke.Configuration;
//import com.namsor.sdk2.invoke.auth.*;
//import com.namsor.sdk2.api.AdminApi;

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");

AdminApi apiInstance = new AdminApi();
try {
    APIUsageAggregatedOut result = apiInstance.apiUsageHistoryAggregate();
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling AdminApi#apiUsageHistoryAggregate");
    e.printStackTrace();
}

Parameters

This endpoint does not need any parameter.

Return type

APIUsageAggregatedOut

Authorization

api_key

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

availableServices

APIServicesOut availableServices()

List of classification services and usage cost in Units per classification (default is 1=ONE Unit). Some API endpoints (ex. Corridor) combine multiple classifiers.

Example

// Import classes:
//import com.namsor.sdk2.invoke.ApiClient;
//import com.namsor.sdk2.invoke.ApiException;
//import com.namsor.sdk2.invoke.Configuration;
//import com.namsor.sdk2.invoke.auth.*;
//import com.namsor.sdk2.api.AdminApi;

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");

AdminApi apiInstance = new AdminApi();
try {
    APIServicesOut result = apiInstance.availableServices();
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling AdminApi#availableServices");
    e.printStackTrace();
}

Parameters

This endpoint does not need any parameter.

Return type

APIServicesOut

Authorization

api_key

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

disable

disable(source, disabled)

Activate/deactivate an API Key.

Example

// Import classes:
//import com.namsor.sdk2.invoke.ApiClient;
//import com.namsor.sdk2.invoke.ApiException;
//import com.namsor.sdk2.invoke.Configuration;
//import com.namsor.sdk2.invoke.auth.*;
//import com.namsor.sdk2.api.AdminApi;

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");

AdminApi apiInstance = new AdminApi();
String source = "source_example"; // String | The API Key to set as enabled/disabled.
Boolean disabled = true; // Boolean | 
try {
    apiInstance.disable(source, disabled);
} catch (ApiException e) {
    System.err.println("Exception when calling AdminApi#disable");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
source String The API Key to set as enabled/disabled.
disabled Boolean

Return type

null (empty response body)

Authorization

api_key

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

learnable

APIKeyOut learnable(source, learnable, token)

Activate/deactivate learning from a source.

Example

// Import classes:
//import com.namsor.sdk2.invoke.ApiClient;
//import com.namsor.sdk2.invoke.ApiException;
//import com.namsor.sdk2.invoke.Configuration;
//import com.namsor.sdk2.invoke.auth.*;
//import com.namsor.sdk2.api.AdminApi;

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");

AdminApi apiInstance = new AdminApi();
String source = "source_example"; // String | The API Key to set as learnable/non learnable.
Boolean learnable = true; // Boolean | 
String token = "token_example"; // String | 
try {
    APIKeyOut result = apiInstance.learnable(source, learnable, token);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling AdminApi#learnable");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
source String The API Key to set as learnable/non learnable.
learnable Boolean
token String

Return type

APIKeyOut

Authorization

api_key

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

learnable1

learnable1(source, learnable)

Activate/deactivate learning from a source.

Example

// Import classes:
//import com.namsor.sdk2.invoke.ApiClient;
//import com.namsor.sdk2.invoke.ApiException;
//import com.namsor.sdk2.invoke.Configuration;
//import com.namsor.sdk2.invoke.auth.*;
//import com.namsor.sdk2.api.AdminApi;

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");

AdminApi apiInstance = new AdminApi();
String source = "source_example"; // String | The API Key to set as learnable/non learnable.
Boolean learnable = true; // Boolean | 
try {
    apiInstance.learnable1(source, learnable);
} catch (ApiException e) {
    System.err.println("Exception when calling AdminApi#learnable1");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
source String The API Key to set as learnable/non learnable.
learnable Boolean

Return type

null (empty response body)

Authorization

api_key

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

regions

RegionOut regions()

Print basic source statistics.

Example

// Import classes:
//import com.namsor.sdk2.invoke.ApiClient;
//import com.namsor.sdk2.invoke.ApiException;
//import com.namsor.sdk2.invoke.Configuration;
//import com.namsor.sdk2.invoke.auth.*;
//import com.namsor.sdk2.api.AdminApi;

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");

AdminApi apiInstance = new AdminApi();
try {
    RegionOut result = apiInstance.regions();
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling AdminApi#regions");
    e.printStackTrace();
}

Parameters

This endpoint does not need any parameter.

Return type

RegionOut

Authorization

api_key

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

softwareVersion

SoftwareVersionOut softwareVersion()

Get the current software version

Example

// Import classes:
//import com.namsor.sdk2.invoke.ApiClient;
//import com.namsor.sdk2.invoke.ApiException;
//import com.namsor.sdk2.invoke.Configuration;
//import com.namsor.sdk2.invoke.auth.*;
//import com.namsor.sdk2.api.AdminApi;

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");

AdminApi apiInstance = new AdminApi();
try {
    SoftwareVersionOut result = apiInstance.softwareVersion();
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling AdminApi#softwareVersion");
    e.printStackTrace();
}

Parameters

This endpoint does not need any parameter.

Return type

SoftwareVersionOut

Authorization

api_key

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

taxonomyClasses

APIClassifierTaxonomyOut taxonomyClasses(classifierName)

Print the taxonomy classes valid for the given classifier.

Example

// Import classes:
//import com.namsor.sdk2.invoke.ApiClient;
//import com.namsor.sdk2.invoke.ApiException;
//import com.namsor.sdk2.invoke.Configuration;
//import com.namsor.sdk2.invoke.auth.*;
//import com.namsor.sdk2.api.AdminApi;

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");

AdminApi apiInstance = new AdminApi();
String classifierName = "classifierName_example"; // String | 
try {
    APIClassifierTaxonomyOut result = apiInstance.taxonomyClasses(classifierName);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling AdminApi#taxonomyClasses");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
classifierName String

Return type

APIClassifierTaxonomyOut

Authorization

api_key

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json