getAccount
Current account information
/account
Usage and SDK Samples
curl -X GET "https://api.afsanalytics.com/v1//account"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.AccountApi;
import java.io.File;
import java.util.*;
public class AccountApiExample {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure OAuth2 access token for authorization: AppClient
OAuth AppClient = (OAuth) defaultClient.getAuthentication("AppClient");
AppClient.setAccessToken("YOUR ACCESS TOKEN");
// Configure API key authorization: DevPrivateKey
ApiKeyAuth DevPrivateKey = (ApiKeyAuth) defaultClient.getAuthentication("DevPrivateKey");
DevPrivateKey.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//DevPrivateKey.setApiKeyPrefix("Token");
AccountApi apiInstance = new AccountApi();
try {
inline_response_200 result = apiInstance.getAccount();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AccountApi#getAccount");
e.printStackTrace();
}
}
}
import io.swagger.client.api.AccountApi;
public class AccountApiExample {
public static void main(String[] args) {
AccountApi apiInstance = new AccountApi();
try {
inline_response_200 result = apiInstance.getAccount();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AccountApi#getAccount");
e.printStackTrace();
}
}
}
Configuration *apiConfig = [Configuration sharedConfig];
// Configure OAuth2 access token for authorization: (authentication scheme: AppClient)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
// Configure API key authorization: (authentication scheme: DevPrivateKey)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"api_key"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"api_key"];
AccountApi *apiInstance = [[AccountApi alloc] init];
// Current account information
[apiInstance getAccountWithCompletionHandler:
^(inline_response_200 output, NSError* error) {
if (output) {
NSLog(@"%@", output);
}
if (error) {
NSLog(@"Error: %@", error);
}
}];
var AfsaApi = require('afsa_api');
var defaultClient = AfsaApi.ApiClient.instance;
// Configure OAuth2 access token for authorization: AppClient
var AppClient = defaultClient.authentications['AppClient'];
AppClient.accessToken = "YOUR ACCESS TOKEN"
// Configure API key authorization: DevPrivateKey
var DevPrivateKey = defaultClient.authentications['DevPrivateKey'];
DevPrivateKey.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//DevPrivateKey.apiKeyPrefix['api_key'] = "Token"
var api = new AfsaApi.AccountApi()
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.getAccount(callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;
namespace Example
{
public class getAccountExample
{
public void main()
{
// Configure OAuth2 access token for authorization: AppClient
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
// Configure API key authorization: DevPrivateKey
Configuration.Default.ApiKey.Add("api_key", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Configuration.Default.ApiKeyPrefix.Add("api_key", "Bearer");
var apiInstance = new AccountApi();
try
{
// Current account information
inline_response_200 result = apiInstance.getAccount();
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling AccountApi.getAccount: " + e.Message );
}
}
}
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: AppClient
Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
// Configure API key authorization: DevPrivateKey
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('api_key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api_key', 'Bearer');
$api_instance = new Swagger\Client\ApiAccountApi();
try {
$result = $api_instance->getAccount();
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling AccountApi->getAccount: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::AccountApi;
# Configure OAuth2 access token for authorization: AppClient
$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
# Configure API key authorization: DevPrivateKey
$WWW::SwaggerClient::Configuration::api_key->{'api_key'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'api_key'} = "Bearer";
my $api_instance = WWW::SwaggerClient::AccountApi->new();
eval {
my $result = $api_instance->getAccount();
print Dumper($result);
};
if ($@) {
warn "Exception when calling AccountApi->getAccount: $@\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: AppClient
swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
# Configure API key authorization: DevPrivateKey
swagger_client.configuration.api_key['api_key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# swagger_client.configuration.api_key_prefix['api_key'] = 'Bearer'
# create an instance of the API class
api_instance = swagger_client.AccountApi()
try:
# Current account information
api_response = api_instance.get_account()
pprint(api_response)
except ApiException as e:
print("Exception when calling AccountApi->getAccount: %s\n" % e)