Skip to content

Latest commit

 

History

History
369 lines (246 loc) · 11.6 KB

File metadata and controls

369 lines (246 loc) · 11.6 KB

SpectrumVoip\\NetSapiens\AuthenticationAPIKeyMachine2MachineApi

All URIs are relative to https://ns-api.com/ns-api/v2, except if the operation defines another base path.

Method HTTP request Description
createApikey() POST /apikeys Create API Key
readApikey() GET /apikeys/{key_id} Read Info on specific APIKey via Key ID
readApikeys() GET /apikeys#1 Read API Keys under your account
readMyApikey() GET /apikeys/~ Read API Key info on your API Key
revokeApikey() DELETE /apikeys/{key_id} Revoke API Key
updateApikey() PUT /apikeys/{key_id} Update API Key

createApikey()

createApikey($create_apikey_request): \SpectrumVoip\\\\NetSapiens\Model\CreateApikey200Response

Create API Key

This is a limited action and will require special access to create API keys.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer authorization: bearerAuth
$config = SpectrumVoip\\\\NetSapiens\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new SpectrumVoip\\\\NetSapiens\Api\AuthenticationAPIKeyMachine2MachineApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$create_apikey_request = {"description":"Myomp ApiKey 2","domain":"apidog.ApiReseller","reseller":"ApiReseller","readonly":"no","ip-address":"10.211.55.0/24,127.0.0.1","user-scope":"Office Manager","can-create-keys":"no"}; // \SpectrumVoip\\\\NetSapiens\Model\CreateApikeyRequest

try {
    $result = $apiInstance->createApikey($create_apikey_request);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AuthenticationAPIKeyMachine2MachineApi->createApikey: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
create_apikey_request \SpectrumVoip\\NetSapiens\Model\CreateApikeyRequest [optional]

Return type

\SpectrumVoip\\NetSapiens\Model\CreateApikey200Response

Authorization

bearerAuth

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

readApikey()

readApikey($key_id): \SpectrumVoip\\\\NetSapiens\Model\ReadApikeys200ResponseInner[]

Read Info on specific APIKey via Key ID

This action will show apikeys that have been generated by your current APIkey and that you have access to update or revoke as needed. > Note: # and anything after is NOT needed, its just to allow multiple examples for the same path/method.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer authorization: bearerAuth
$config = SpectrumVoip\\\\NetSapiens\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new SpectrumVoip\\\\NetSapiens\Api\AuthenticationAPIKeyMachine2MachineApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$key_id = nsr_XDS9kzKV; // string | 

try {
    $result = $apiInstance->readApikey($key_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AuthenticationAPIKeyMachine2MachineApi->readApikey: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
key_id string

Return type

\SpectrumVoip\\NetSapiens\Model\ReadApikeys200ResponseInner[]

Authorization

bearerAuth

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

readApikeys()

readApikeys(): \SpectrumVoip\\\\NetSapiens\Model\ReadApikeys200ResponseInner[]

Read API Keys under your account

This action will show apikeys that have been generated by your current APIkey and that you have access to update or revoke as needed. > Note: # and anything after is NOT needed, its just to allow multiple examples for the same path/method.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer authorization: bearerAuth
$config = SpectrumVoip\\\\NetSapiens\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new SpectrumVoip\\\\NetSapiens\Api\AuthenticationAPIKeyMachine2MachineApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);

try {
    $result = $apiInstance->readApikeys();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AuthenticationAPIKeyMachine2MachineApi->readApikeys: ', $e->getMessage(), PHP_EOL;
}

Parameters

This endpoint does not need any parameter.

Return type

\SpectrumVoip\\NetSapiens\Model\ReadApikeys200ResponseInner[]

Authorization

bearerAuth

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

readMyApikey()

readMyApikey(): \SpectrumVoip\\\\NetSapiens\Model\ApiKey

Read API Key info on your API Key

This parameter-less action will return the information on the API key being used for the request giving confirmation on access levels allowed.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer authorization: bearerAuth
$config = SpectrumVoip\\\\NetSapiens\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new SpectrumVoip\\\\NetSapiens\Api\AuthenticationAPIKeyMachine2MachineApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);

try {
    $result = $apiInstance->readMyApikey();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AuthenticationAPIKeyMachine2MachineApi->readMyApikey: ', $e->getMessage(), PHP_EOL;
}

Parameters

This endpoint does not need any parameter.

Return type

\SpectrumVoip\\NetSapiens\Model\ApiKey

Authorization

bearerAuth

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

revokeApikey()

revokeApikey($key_id): \SpectrumVoip\\\\NetSapiens\Model\SuccessResponse

Revoke API Key

This is a limited action and will require special access to revoke API keys. Revoking the apikey will remove the key from the DB and any Cache stoping access immediately.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer authorization: bearerAuth
$config = SpectrumVoip\\\\NetSapiens\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new SpectrumVoip\\\\NetSapiens\Api\AuthenticationAPIKeyMachine2MachineApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$key_id = nsr_hTd6kA9I; // string | 

try {
    $result = $apiInstance->revokeApikey($key_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AuthenticationAPIKeyMachine2MachineApi->revokeApikey: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
key_id string

Return type

\SpectrumVoip\\NetSapiens\Model\SuccessResponse

Authorization

bearerAuth

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

updateApikey()

updateApikey($key_id, $update_apikey_request): \SpectrumVoip\\\\NetSapiens\Model\SuccessResponse

Update API Key

This is a limited action and will require special access to create API keys. The Update is even more limited only allowing the change of the description and IP restrictions. You will not be able to change the scope, access rights or any premissions. A new apikey would need to be created in those cases.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer authorization: bearerAuth
$config = SpectrumVoip\\\\NetSapiens\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new SpectrumVoip\\\\NetSapiens\Api\AuthenticationAPIKeyMachine2MachineApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$key_id = nss_gPGEUWBI; // string | 
$update_apikey_request = {"description":"my OMP test (updated2)","ip-address":"10.211.55.0/24,127.0.0.1"}; // \SpectrumVoip\\\\NetSapiens\Model\UpdateApikeyRequest

try {
    $result = $apiInstance->updateApikey($key_id, $update_apikey_request);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AuthenticationAPIKeyMachine2MachineApi->updateApikey: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
key_id string
update_apikey_request \SpectrumVoip\\NetSapiens\Model\UpdateApikeyRequest [optional]

Return type

\SpectrumVoip\\NetSapiens\Model\SuccessResponse

Authorization

bearerAuth

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]