BmltClient-ApiClient
view release on metacpan or search on metacpan
docs/RootServerApi.md view on Meta::CPAN
[bmltToken](../README.md#bmltToken)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **auth_token**
> Token auth_token(token_credentials => $token_credentials)
Creates a token
Exchange credentials for a new token
### Example
```perl
use Data::Dumper;
use BmltClient::RootServerApi;
my $api_instance = BmltClient::RootServerApi->new(
);
my $token_credentials = BmltClient::Object::TokenCredentials->new(); # TokenCredentials | User credentials
eval {
my $result = $api_instance->auth_token(token_credentials => $token_credentials);
print Dumper($result);
};
if ($@) {
warn "Exception when calling RootServerApi->auth_token: $@\n";
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**token_credentials** | [**TokenCredentials**](TokenCredentials.md)| User credentials |
### Return type
[**Token**](Token.md)
### Authorization
No authorization required
### HTTP request headers
lib/BmltClient/RootServerApi.pm view on Meta::CPAN
}
my $_response_object = $self->{api_client}->deserialize('Token', $response);
return $_response_object;
}
#
# auth_token
#
# Creates a token
#
# @param TokenCredentials $token_credentials User credentials (required)
{
my $params = {
'token_credentials' => {
data_type => 'TokenCredentials',
description => 'User credentials',
required => '1',
},
};
__PACKAGE__->method_documentation->{ 'auth_token' } = {
summary => 'Creates a token',
params => $params,
returns => 'Token',
};
}
# @return Token
#
sub auth_token {
my ($self, %args) = @_;
# verify the required parameter 'token_credentials' is set
unless (exists $args{'token_credentials'}) {
croak("Missing the required parameter 'token_credentials' when calling auth_token");
}
# parse inputs
my $_resource_path = '/api/v1/auth/token';
my $_method = 'POST';
my $query_params = {};
my $header_params = {};
my $form_params = {};
# 'Accept' and 'Content-Type' header
my $_header_accept = $self->{api_client}->select_header_accept('application/json');
if ($_header_accept) {
$header_params->{'Accept'} = $_header_accept;
}
$header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json');
my $_body_data;
# body params
if ( exists $args{'token_credentials'}) {
$_body_data = $args{'token_credentials'};
}
# authentication setting, if any
my $auth_settings = [qw()];
# make the API Call
my $response = $self->{api_client}->call_api($_resource_path, $_method,
$query_params, $form_params,
$header_params, $_body_data, $auth_settings);
if (!$response) {
openapi.json view on Meta::CPAN
{"openapi":"3.0.0","info":{"title":"BMLT","description":"BMLT Admin API Documentation","license":{"name":"MIT","url":"https://github.com/bmlt-enabled/bmlt-root-server/blob/main/LICENSE"},"version":"1.0.0"},"paths":{"/api/v1/formats":{"get":{"tags":["...
t/RootServerApiTest.t view on Meta::CPAN
#
# auth_refresh test
#
# uncomment below and update the test
#my $auth_refresh_result = $api->auth_refresh();
#
# auth_token test
#
# uncomment below and update the test
#my $auth_token_token_credentials = undef; # replace NULL with a proper value
#my $auth_token_result = $api->auth_token(token_credentials => $auth_token_token_credentials);
#
# create_format test
#
# uncomment below and update the test
#my $create_format_format_create = undef; # replace NULL with a proper value
#my $create_format_result = $api->create_format(format_create => $create_format_format_create);
#
# create_meeting test
( run in 0.248 second using v1.01-cache-2.11-cpan-a5abf4f5562 )