getAccessToken
Retrieves the access token for public API requests
Retrieves the access token for public API requests
/oauth/token
Usage and SDK Samples
curl -X POST\
-H "Accept: application/json"\
-H "Content-Type: application/x-www-form-urlencoded"\
"https://virtserver.swaggerhub.com/jokerjmv/AVMG_Authorizer/1.0.0/oauth/token"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.AuthorizationApi;
import java.io.File;
import java.util.*;
public class AuthorizationApiExample {
public static void main(String[] args) {
AuthorizationApi apiInstance = new AuthorizationApi();
String grantType = grantType_example; // String |
String clientId = clientId_example; // String |
String clientSecret = clientSecret_example; // String |
Object scope = ; // Object |
try {
AuthResponse result = apiInstance.getAccessToken(grantType, clientId, clientSecret, scope);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AuthorizationApi#getAccessToken");
e.printStackTrace();
}
}
}
import io.swagger.client.api.AuthorizationApi;
public class AuthorizationApiExample {
public static void main(String[] args) {
AuthorizationApi apiInstance = new AuthorizationApi();
String grantType = grantType_example; // String |
String clientId = clientId_example; // String |
String clientSecret = clientSecret_example; // String |
Object scope = ; // Object |
try {
AuthResponse result = apiInstance.getAccessToken(grantType, clientId, clientSecret, scope);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AuthorizationApi#getAccessToken");
e.printStackTrace();
}
}
}
String *grantType = grantType_example; // (optional)
String *clientId = clientId_example; // (optional)
String *clientSecret = clientSecret_example; // (optional)
Object *scope = ; // (optional)
AuthorizationApi *apiInstance = [[AuthorizationApi alloc] init];
// Retrieves the access token for public API requests
[apiInstance getAccessTokenWith:grantType
clientId:clientId
clientSecret:clientSecret
scope:scope
completionHandler: ^(AuthResponse output, NSError* error) {
if (output) {
NSLog(@"%@", output);
}
if (error) {
NSLog(@"Error: %@", error);
}
}];
var AvmPublicAuthorizer = require('avm_public_authorizer');
var api = new AvmPublicAuthorizer.AuthorizationApi()
var opts = {
'grantType': grantType_example // {{String}}
'clientId': clientId_example // {{String}}
'clientSecret': clientSecret_example // {{String}}
'scope': // {{Object}}
};
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.getAccessToken(opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;
namespace Example
{
public class getAccessTokenExample
{
public void main()
{
var apiInstance = new AuthorizationApi();
var grantType = grantType_example; // String | (optional)
var clientId = clientId_example; // String | (optional)
var clientSecret = clientSecret_example; // String | (optional)
var scope = new Object(); // Object | (optional)
try
{
// Retrieves the access token for public API requests
AuthResponse result = apiInstance.getAccessToken(grantType, clientId, clientSecret, scope);
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling AuthorizationApi.getAccessToken: " + e.Message );
}
}
}
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$api_instance = new Swagger\Client\ApiAuthorizationApi();
$grantType = grantType_example; // String |
$clientId = clientId_example; // String |
$clientSecret = clientSecret_example; // String |
$scope = ; // Object |
try {
$result = $api_instance->getAccessToken($grantType, $clientId, $clientSecret, $scope);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling AuthorizationApi->getAccessToken: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::AuthorizationApi;
my $api_instance = WWW::SwaggerClient::AuthorizationApi->new();
my $grantType = grantType_example; # String |
my $clientId = clientId_example; # String |
my $clientSecret = clientSecret_example; # String |
my $scope = ; # Object |
eval {
my $result = $api_instance->getAccessToken(grantType => $grantType, clientId => $clientId, clientSecret => $clientSecret, scope => $scope);
print Dumper($result);
};
if ($@) {
warn "Exception when calling AuthorizationApi->getAccessToken: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = swagger_client.AuthorizationApi()
grantType = grantType_example # String | (optional)
clientId = clientId_example # String | (optional)
clientSecret = clientSecret_example # String | (optional)
scope = # Object | (optional)
try:
# Retrieves the access token for public API requests
api_response = api_instance.get_access_token(grantType=grantType, clientId=clientId, clientSecret=clientSecret, scope=scope)
pprint(api_response)
except ApiException as e:
print("Exception when calling AuthorizationApi->getAccessToken: %s\n" % e)
Parameters
Form parameters
| Name | Description |
|---|---|
| grant_type |
String
|
| client_id |
String
|
| client_secret |
String
|
| scope |
Object
|