AFSA Api

Account

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)

Parameters

Responses

Status: 200 - Available results returned.

Status: 204 - No result.

Status: 400 - Malformed request.

Status: 401 - Unauthorized.

Status: 403 - Forbidden.

Status: 500 - Internal Errors.


getAccountPlan

Current subscription information


/account/plan

Usage and SDK Samples

curl -X GET "https://api.afsanalytics.com/v1//account/plan"
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_1 result = apiInstance.getAccountPlan();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountApi#getAccountPlan");
            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_1 result = apiInstance.getAccountPlan();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountApi#getAccountPlan");
            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 subscription information
[apiInstance getAccountPlanWithCompletionHandler: 
              ^(inline_response_200_1 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.getAccountPlan(callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getAccountPlanExample
    {
        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 subscription information
                inline_response_200_1 result = apiInstance.getAccountPlan();
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountApi.getAccountPlan: " + 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->getAccountPlan();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AccountApi->getAccountPlan: ', $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->getAccountPlan();
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountApi->getAccountPlan: $@\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 subscription information
    api_response = api_instance.get_account_plan()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountApi->getAccountPlan: %s\n" % e)

Parameters

Responses

Status: 200 - Available results returned.

Status: 204 - No result.

Status: 400 - Malformed request.

Status: 401 - Unauthorized.

Status: 403 - Forbidden.

Status: 500 - Internal Errors.


AdvancedECommerce

getCampaigns

List campaigns.


/stats/ecom/campaigns

Usage and SDK Samples

curl -X GET "https://api.afsanalytics.com/v1//stats/ecom/campaigns?offset=&limit="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.AdvancedECommerceApi;

import java.io.File;
import java.util.*;

public class AdvancedECommerceApiExample {

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

        AdvancedECommerceApi apiInstance = new AdvancedECommerceApi();
        Integer offset = 56; // Integer | position of the first record to be returned.
        Integer limit = 56; // Integer | max number of records to be returned.
        try {
            inline_response_200_23 result = apiInstance.getCampaigns(offset, limit);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AdvancedECommerceApi#getCampaigns");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.AdvancedECommerceApi;

public class AdvancedECommerceApiExample {

    public static void main(String[] args) {
        AdvancedECommerceApi apiInstance = new AdvancedECommerceApi();
        Integer offset = 56; // Integer | position of the first record to be returned.
        Integer limit = 56; // Integer | max number of records to be returned.
        try {
            inline_response_200_23 result = apiInstance.getCampaigns(offset, limit);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AdvancedECommerceApi#getCampaigns");
            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"];
Integer *offset = 56; // position of the first record to be returned. (optional)
Integer *limit = 56; // max number of records to be returned. (optional)

AdvancedECommerceApi *apiInstance = [[AdvancedECommerceApi alloc] init];

// List campaigns.
[apiInstance getCampaignsWith:offset
    limit:limit
              completionHandler: ^(inline_response_200_23 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.AdvancedECommerceApi()
var opts = { 
  'offset': 56, // {{Integer}} position of the first record to be returned.
  'limit': 56 // {{Integer}} max number of records to be returned.
};
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getCampaigns(opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getCampaignsExample
    {
        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 AdvancedECommerceApi();
            var offset = 56;  // Integer | position of the first record to be returned. (optional) 
            var limit = 56;  // Integer | max number of records to be returned. (optional) 

            try
            {
                // List campaigns.
                inline_response_200_23 result = apiInstance.getCampaigns(offset, limit);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AdvancedECommerceApi.getCampaigns: " + 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\ApiAdvancedECommerceApi();
$offset = 56; // Integer | position of the first record to be returned.
$limit = 56; // Integer | max number of records to be returned.

try {
    $result = $api_instance->getCampaigns($offset, $limit);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AdvancedECommerceApi->getCampaigns: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::AdvancedECommerceApi;

# 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::AdvancedECommerceApi->new();
my $offset = 56; # Integer | position of the first record to be returned.
my $limit = 56; # Integer | max number of records to be returned.

eval { 
    my $result = $api_instance->getCampaigns(offset => $offset, limit => $limit);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AdvancedECommerceApi->getCampaigns: $@\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.AdvancedECommerceApi()
offset = 56 # Integer | position of the first record to be returned. (optional)
limit = 56 # Integer | max number of records to be returned. (optional)

try: 
    # List campaigns.
    api_response = api_instance.get_campaigns(offset=offset, limit=limit)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AdvancedECommerceApi->getCampaigns: %s\n" % e)

Parameters

Query parameters
Name Description
offset
Integer
position of the first record to be returned.
limit
Integer
max number of records to be returned.

Responses

Status: 200 - Available results returned.

Status: 204 - No result.

Status: 400 - Malformed request.

Status: 401 - Unauthorized.

Status: 403 - Forbidden.

Status: 500 - Internal Errors.


getCampaignsEComPerformanceMetrics

Campaigns performances metrics.


/stats/ecom/campaigns/metrics

Usage and SDK Samples

curl -X GET "https://api.afsanalytics.com/v1//stats/ecom/campaigns/metrics?start_date=&end_date=&date_interval=&previous_period="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.AdvancedECommerceApi;

import java.io.File;
import java.util.*;

public class AdvancedECommerceApiExample {

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

        AdvancedECommerceApi apiInstance = new AdvancedECommerceApi();
        date startDate = ; // date | Period start date.
        date endDate = ; // date | Period end date.
        String dateInterval = dateInterval_example; // String | 
        String previousPeriod = previousPeriod_example; // String | Time difference from previous period(s) to current one. Periods should NOT overlap.
        try {
            inline_response_200_24 result = apiInstance.getCampaignsEComPerformanceMetrics(startDate, endDate, dateInterval, previousPeriod);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AdvancedECommerceApi#getCampaignsEComPerformanceMetrics");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.AdvancedECommerceApi;

public class AdvancedECommerceApiExample {

    public static void main(String[] args) {
        AdvancedECommerceApi apiInstance = new AdvancedECommerceApi();
        date startDate = ; // date | Period start date.
        date endDate = ; // date | Period end date.
        String dateInterval = dateInterval_example; // String | 
        String previousPeriod = previousPeriod_example; // String | Time difference from previous period(s) to current one. Periods should NOT overlap.
        try {
            inline_response_200_24 result = apiInstance.getCampaignsEComPerformanceMetrics(startDate, endDate, dateInterval, previousPeriod);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AdvancedECommerceApi#getCampaignsEComPerformanceMetrics");
            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"];
date *startDate = ; // Period start date.
date *endDate = ; // Period end date.
String *dateInterval = dateInterval_example; //  (optional)
String *previousPeriod = previousPeriod_example; // Time difference from previous period(s) to current one. Periods should NOT overlap. (optional)

AdvancedECommerceApi *apiInstance = [[AdvancedECommerceApi alloc] init];

// Campaigns performances metrics.
[apiInstance getCampaignsEComPerformanceMetricsWith:startDate
    endDate:endDate
    dateInterval:dateInterval
    previousPeriod:previousPeriod
              completionHandler: ^(inline_response_200_24 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.AdvancedECommerceApi()
var startDate = ; // {{date}} Period start date.
var endDate = ; // {{date}} Period end date.
var opts = { 
  'dateInterval': dateInterval_example, // {{String}} 
  'previousPeriod': previousPeriod_example // {{String}} Time difference from previous period(s) to current one. Periods should NOT overlap.
};
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getCampaignsEComPerformanceMetrics(startDate, endDate, opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getCampaignsEComPerformanceMetricsExample
    {
        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 AdvancedECommerceApi();
            var startDate = new date(); // date | Period start date.
            var endDate = new date(); // date | Period end date.
            var dateInterval = dateInterval_example;  // String |  (optional) 
            var previousPeriod = previousPeriod_example;  // String | Time difference from previous period(s) to current one. Periods should NOT overlap. (optional) 

            try
            {
                // Campaigns performances metrics.
                inline_response_200_24 result = apiInstance.getCampaignsEComPerformanceMetrics(startDate, endDate, dateInterval, previousPeriod);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AdvancedECommerceApi.getCampaignsEComPerformanceMetrics: " + 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\ApiAdvancedECommerceApi();
$startDate = ; // date | Period start date.
$endDate = ; // date | Period end date.
$dateInterval = dateInterval_example; // String | 
$previousPeriod = previousPeriod_example; // String | Time difference from previous period(s) to current one. Periods should NOT overlap.

try {
    $result = $api_instance->getCampaignsEComPerformanceMetrics($startDate, $endDate, $dateInterval, $previousPeriod);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AdvancedECommerceApi->getCampaignsEComPerformanceMetrics: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::AdvancedECommerceApi;

# 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::AdvancedECommerceApi->new();
my $startDate = ; # date | Period start date.
my $endDate = ; # date | Period end date.
my $dateInterval = dateInterval_example; # String | 
my $previousPeriod = previousPeriod_example; # String | Time difference from previous period(s) to current one. Periods should NOT overlap.

eval { 
    my $result = $api_instance->getCampaignsEComPerformanceMetrics(startDate => $startDate, endDate => $endDate, dateInterval => $dateInterval, previousPeriod => $previousPeriod);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AdvancedECommerceApi->getCampaignsEComPerformanceMetrics: $@\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.AdvancedECommerceApi()
startDate =  # date | Period start date.
endDate =  # date | Period end date.
dateInterval = dateInterval_example # String |  (optional)
previousPeriod = previousPeriod_example # String | Time difference from previous period(s) to current one. Periods should NOT overlap. (optional)

try: 
    # Campaigns performances metrics.
    api_response = api_instance.get_campaigns_e_com_performance_metrics(startDate, endDate, dateInterval=dateInterval, previousPeriod=previousPeriod)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AdvancedECommerceApi->getCampaignsEComPerformanceMetrics: %s\n" % e)

Parameters

Query parameters
Name Description
start_date*
date
Period start date.
Required
end_date*
date
Period end date.
Required
date_interval
String
previous_period
String
Time difference from previous period(s) to current one. Periods should NOT overlap.

Responses

Status: 200 - Available results returned.

Status: 204 - No result.

Status: 400 - Malformed request.

Status: 401 - Unauthorized.

Status: 403 - Forbidden.

Status: 500 - Internal Errors.


getCarts

Carts list.


/stats/ecom/carts

Usage and SDK Samples

curl -X GET "https://api.afsanalytics.com/v1//stats/ecom/carts?start_date=&end_date=&offset=&limit=&filter="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.AdvancedECommerceApi;

import java.io.File;
import java.util.*;

public class AdvancedECommerceApiExample {

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

        AdvancedECommerceApi apiInstance = new AdvancedECommerceApi();
        date startDate = ; // date | Period start date.
        date endDate = ; // date | Period end date.
        Integer offset = 56; // Integer | position of the first record to be returned.
        Integer limit = 56; // Integer | max number of records to be returned.
        String filter = filter_example; // String | 
        try {
            inline_response_200_32 result = apiInstance.getCarts(startDate, endDate, offset, limit, filter);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AdvancedECommerceApi#getCarts");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.AdvancedECommerceApi;

public class AdvancedECommerceApiExample {

    public static void main(String[] args) {
        AdvancedECommerceApi apiInstance = new AdvancedECommerceApi();
        date startDate = ; // date | Period start date.
        date endDate = ; // date | Period end date.
        Integer offset = 56; // Integer | position of the first record to be returned.
        Integer limit = 56; // Integer | max number of records to be returned.
        String filter = filter_example; // String | 
        try {
            inline_response_200_32 result = apiInstance.getCarts(startDate, endDate, offset, limit, filter);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AdvancedECommerceApi#getCarts");
            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"];
date *startDate = ; // Period start date.
date *endDate = ; // Period end date.
Integer *offset = 56; // position of the first record to be returned. (optional)
Integer *limit = 56; // max number of records to be returned. (optional)
String *filter = filter_example; //  (optional)

AdvancedECommerceApi *apiInstance = [[AdvancedECommerceApi alloc] init];

// Carts list.
[apiInstance getCartsWith:startDate
    endDate:endDate
    offset:offset
    limit:limit
    filter:filter
              completionHandler: ^(inline_response_200_32 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.AdvancedECommerceApi()
var startDate = ; // {{date}} Period start date.
var endDate = ; // {{date}} Period end date.
var opts = { 
  'offset': 56, // {{Integer}} position of the first record to be returned.
  'limit': 56, // {{Integer}} max number of records to be returned.
  'filter': filter_example // {{String}} 
};
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getCarts(startDate, endDate, opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getCartsExample
    {
        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 AdvancedECommerceApi();
            var startDate = new date(); // date | Period start date.
            var endDate = new date(); // date | Period end date.
            var offset = 56;  // Integer | position of the first record to be returned. (optional) 
            var limit = 56;  // Integer | max number of records to be returned. (optional) 
            var filter = filter_example;  // String |  (optional) 

            try
            {
                // Carts list.
                inline_response_200_32 result = apiInstance.getCarts(startDate, endDate, offset, limit, filter);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AdvancedECommerceApi.getCarts: " + 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\ApiAdvancedECommerceApi();
$startDate = ; // date | Period start date.
$endDate = ; // date | Period end date.
$offset = 56; // Integer | position of the first record to be returned.
$limit = 56; // Integer | max number of records to be returned.
$filter = filter_example; // String | 

try {
    $result = $api_instance->getCarts($startDate, $endDate, $offset, $limit, $filter);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AdvancedECommerceApi->getCarts: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::AdvancedECommerceApi;

# 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::AdvancedECommerceApi->new();
my $startDate = ; # date | Period start date.
my $endDate = ; # date | Period end date.
my $offset = 56; # Integer | position of the first record to be returned.
my $limit = 56; # Integer | max number of records to be returned.
my $filter = filter_example; # String | 

eval { 
    my $result = $api_instance->getCarts(startDate => $startDate, endDate => $endDate, offset => $offset, limit => $limit, filter => $filter);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AdvancedECommerceApi->getCarts: $@\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.AdvancedECommerceApi()
startDate =  # date | Period start date.
endDate =  # date | Period end date.
offset = 56 # Integer | position of the first record to be returned. (optional)
limit = 56 # Integer | max number of records to be returned. (optional)
filter = filter_example # String |  (optional)

try: 
    # Carts list.
    api_response = api_instance.get_carts(startDate, endDate, offset=offset, limit=limit, filter=filter)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AdvancedECommerceApi->getCarts: %s\n" % e)

Parameters

Query parameters
Name Description
start_date*
date
Period start date.
Required
end_date*
date
Period end date.
Required
offset
Integer
position of the first record to be returned.
limit
Integer
max number of records to be returned.
filter
String

Responses

Status: 200 - Available results returned.

Status: 204 - No result.

Status: 400 - Malformed request.

Status: 401 - Unauthorized.

Status: 403 - Forbidden.

Status: 500 - Internal Errors.


getEComForecast

Orders forecasts.


/stats/ecom/forecast

Usage and SDK Samples

curl -X GET "https://api.afsanalytics.com/v1//stats/ecom/forecast?date_interval="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.AdvancedECommerceApi;

import java.io.File;
import java.util.*;

public class AdvancedECommerceApiExample {

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

        AdvancedECommerceApi apiInstance = new AdvancedECommerceApi();
        String dateInterval = dateInterval_example; // String | 
        try {
            inline_response_200_20 result = apiInstance.getEComForecast(dateInterval);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AdvancedECommerceApi#getEComForecast");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.AdvancedECommerceApi;

public class AdvancedECommerceApiExample {

    public static void main(String[] args) {
        AdvancedECommerceApi apiInstance = new AdvancedECommerceApi();
        String dateInterval = dateInterval_example; // String | 
        try {
            inline_response_200_20 result = apiInstance.getEComForecast(dateInterval);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AdvancedECommerceApi#getEComForecast");
            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"];
String *dateInterval = dateInterval_example; //  (optional)

AdvancedECommerceApi *apiInstance = [[AdvancedECommerceApi alloc] init];

// Orders forecasts.
[apiInstance getEComForecastWith:dateInterval
              completionHandler: ^(inline_response_200_20 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.AdvancedECommerceApi()
var opts = { 
  'dateInterval': dateInterval_example // {{String}} 
};
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getEComForecast(opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getEComForecastExample
    {
        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 AdvancedECommerceApi();
            var dateInterval = dateInterval_example;  // String |  (optional) 

            try
            {
                // Orders forecasts.
                inline_response_200_20 result = apiInstance.getEComForecast(dateInterval);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AdvancedECommerceApi.getEComForecast: " + 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\ApiAdvancedECommerceApi();
$dateInterval = dateInterval_example; // String | 

try {
    $result = $api_instance->getEComForecast($dateInterval);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AdvancedECommerceApi->getEComForecast: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::AdvancedECommerceApi;

# 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::AdvancedECommerceApi->new();
my $dateInterval = dateInterval_example; # String | 

eval { 
    my $result = $api_instance->getEComForecast(dateInterval => $dateInterval);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AdvancedECommerceApi->getEComForecast: $@\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.AdvancedECommerceApi()
dateInterval = dateInterval_example # String |  (optional)

try: 
    # Orders forecasts.
    api_response = api_instance.get_e_com_forecast(dateInterval=dateInterval)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AdvancedECommerceApi->getEComForecast: %s\n" % e)

Parameters

Query parameters
Name Description
date_interval
String

Responses

Status: 200 - Available results returned.

Status: 204 - No result.

Status: 400 - Malformed request.

Status: 401 - Unauthorized.

Status: 403 - Forbidden.

Status: 500 - Internal Errors.


getEComMetrics

Orders and Carts metrics.


/stats/ecom/metrics

Usage and SDK Samples

curl -X GET "https://api.afsanalytics.com/v1//stats/ecom/metrics?start_date=&end_date=&date_interval=&previous_period="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.AdvancedECommerceApi;

import java.io.File;
import java.util.*;

public class AdvancedECommerceApiExample {

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

        AdvancedECommerceApi apiInstance = new AdvancedECommerceApi();
        date startDate = ; // date | Period start date.
        date endDate = ; // date | Period end date.
        String dateInterval = dateInterval_example; // String | 
        String previousPeriod = previousPeriod_example; // String | Time difference from previous period(s) to current one. Periods should NOT overlap.
        try {
            inline_response_200_18 result = apiInstance.getEComMetrics(startDate, endDate, dateInterval, previousPeriod);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AdvancedECommerceApi#getEComMetrics");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.AdvancedECommerceApi;

public class AdvancedECommerceApiExample {

    public static void main(String[] args) {
        AdvancedECommerceApi apiInstance = new AdvancedECommerceApi();
        date startDate = ; // date | Period start date.
        date endDate = ; // date | Period end date.
        String dateInterval = dateInterval_example; // String | 
        String previousPeriod = previousPeriod_example; // String | Time difference from previous period(s) to current one. Periods should NOT overlap.
        try {
            inline_response_200_18 result = apiInstance.getEComMetrics(startDate, endDate, dateInterval, previousPeriod);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AdvancedECommerceApi#getEComMetrics");
            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"];
date *startDate = ; // Period start date.
date *endDate = ; // Period end date.
String *dateInterval = dateInterval_example; //  (optional)
String *previousPeriod = previousPeriod_example; // Time difference from previous period(s) to current one. Periods should NOT overlap. (optional)

AdvancedECommerceApi *apiInstance = [[AdvancedECommerceApi alloc] init];

// Orders and Carts metrics.
[apiInstance getEComMetricsWith:startDate
    endDate:endDate
    dateInterval:dateInterval
    previousPeriod:previousPeriod
              completionHandler: ^(inline_response_200_18 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.AdvancedECommerceApi()
var startDate = ; // {{date}} Period start date.
var endDate = ; // {{date}} Period end date.
var opts = { 
  'dateInterval': dateInterval_example, // {{String}} 
  'previousPeriod': previousPeriod_example // {{String}} Time difference from previous period(s) to current one. Periods should NOT overlap.
};
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getEComMetrics(startDate, endDate, opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getEComMetricsExample
    {
        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 AdvancedECommerceApi();
            var startDate = new date(); // date | Period start date.
            var endDate = new date(); // date | Period end date.
            var dateInterval = dateInterval_example;  // String |  (optional) 
            var previousPeriod = previousPeriod_example;  // String | Time difference from previous period(s) to current one. Periods should NOT overlap. (optional) 

            try
            {
                // Orders and Carts metrics.
                inline_response_200_18 result = apiInstance.getEComMetrics(startDate, endDate, dateInterval, previousPeriod);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AdvancedECommerceApi.getEComMetrics: " + 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\ApiAdvancedECommerceApi();
$startDate = ; // date | Period start date.
$endDate = ; // date | Period end date.
$dateInterval = dateInterval_example; // String | 
$previousPeriod = previousPeriod_example; // String | Time difference from previous period(s) to current one. Periods should NOT overlap.

try {
    $result = $api_instance->getEComMetrics($startDate, $endDate, $dateInterval, $previousPeriod);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AdvancedECommerceApi->getEComMetrics: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::AdvancedECommerceApi;

# 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::AdvancedECommerceApi->new();
my $startDate = ; # date | Period start date.
my $endDate = ; # date | Period end date.
my $dateInterval = dateInterval_example; # String | 
my $previousPeriod = previousPeriod_example; # String | Time difference from previous period(s) to current one. Periods should NOT overlap.

eval { 
    my $result = $api_instance->getEComMetrics(startDate => $startDate, endDate => $endDate, dateInterval => $dateInterval, previousPeriod => $previousPeriod);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AdvancedECommerceApi->getEComMetrics: $@\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.AdvancedECommerceApi()
startDate =  # date | Period start date.
endDate =  # date | Period end date.
dateInterval = dateInterval_example # String |  (optional)
previousPeriod = previousPeriod_example # String | Time difference from previous period(s) to current one. Periods should NOT overlap. (optional)

try: 
    # Orders and Carts metrics.
    api_response = api_instance.get_e_com_metrics(startDate, endDate, dateInterval=dateInterval, previousPeriod=previousPeriod)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AdvancedECommerceApi->getEComMetrics: %s\n" % e)

Parameters

Query parameters
Name Description
start_date*
date
Period start date.
Required
end_date*
date
Period end date.
Required
date_interval
String
previous_period
String
Time difference from previous period(s) to current one. Periods should NOT overlap.

Responses

Status: 200 - Available results returned.

Status: 204 - No result.

Status: 400 - Malformed request.

Status: 401 - Unauthorized.

Status: 403 - Forbidden.

Status: 500 - Internal Errors.


getEComMetricsDistribution

Orders and Carts metrics distribution by time interval.


/stats/ecom/metrics/distribution

Usage and SDK Samples

curl -X GET "https://api.afsanalytics.com/v1//stats/ecom/metrics/distribution?start_date=&end_date=&date_interval="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.AdvancedECommerceApi;

import java.io.File;
import java.util.*;

public class AdvancedECommerceApiExample {

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

        AdvancedECommerceApi apiInstance = new AdvancedECommerceApi();
        date startDate = ; // date | Period start date.
        date endDate = ; // date | Period end date.
        String dateInterval = dateInterval_example; // String | 
        try {
            inline_response_200_19 result = apiInstance.getEComMetricsDistribution(startDate, endDate, dateInterval);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AdvancedECommerceApi#getEComMetricsDistribution");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.AdvancedECommerceApi;

public class AdvancedECommerceApiExample {

    public static void main(String[] args) {
        AdvancedECommerceApi apiInstance = new AdvancedECommerceApi();
        date startDate = ; // date | Period start date.
        date endDate = ; // date | Period end date.
        String dateInterval = dateInterval_example; // String | 
        try {
            inline_response_200_19 result = apiInstance.getEComMetricsDistribution(startDate, endDate, dateInterval);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AdvancedECommerceApi#getEComMetricsDistribution");
            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"];
date *startDate = ; // Period start date.
date *endDate = ; // Period end date.
String *dateInterval = dateInterval_example; //  (optional)

AdvancedECommerceApi *apiInstance = [[AdvancedECommerceApi alloc] init];

// Orders and Carts metrics distribution by time interval.
[apiInstance getEComMetricsDistributionWith:startDate
    endDate:endDate
    dateInterval:dateInterval
              completionHandler: ^(inline_response_200_19 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.AdvancedECommerceApi()
var startDate = ; // {{date}} Period start date.
var endDate = ; // {{date}} Period end date.
var opts = { 
  'dateInterval': dateInterval_example // {{String}} 
};
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getEComMetricsDistribution(startDate, endDate, opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getEComMetricsDistributionExample
    {
        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 AdvancedECommerceApi();
            var startDate = new date(); // date | Period start date.
            var endDate = new date(); // date | Period end date.
            var dateInterval = dateInterval_example;  // String |  (optional) 

            try
            {
                // Orders and Carts metrics distribution by time interval.
                inline_response_200_19 result = apiInstance.getEComMetricsDistribution(startDate, endDate, dateInterval);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AdvancedECommerceApi.getEComMetricsDistribution: " + 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\ApiAdvancedECommerceApi();
$startDate = ; // date | Period start date.
$endDate = ; // date | Period end date.
$dateInterval = dateInterval_example; // String | 

try {
    $result = $api_instance->getEComMetricsDistribution($startDate, $endDate, $dateInterval);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AdvancedECommerceApi->getEComMetricsDistribution: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::AdvancedECommerceApi;

# 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::AdvancedECommerceApi->new();
my $startDate = ; # date | Period start date.
my $endDate = ; # date | Period end date.
my $dateInterval = dateInterval_example; # String | 

eval { 
    my $result = $api_instance->getEComMetricsDistribution(startDate => $startDate, endDate => $endDate, dateInterval => $dateInterval);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AdvancedECommerceApi->getEComMetricsDistribution: $@\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.AdvancedECommerceApi()
startDate =  # date | Period start date.
endDate =  # date | Period end date.
dateInterval = dateInterval_example # String |  (optional)

try: 
    # Orders and Carts metrics distribution by time interval.
    api_response = api_instance.get_e_com_metrics_distribution(startDate, endDate, dateInterval=dateInterval)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AdvancedECommerceApi->getEComMetricsDistribution: %s\n" % e)

Parameters

Query parameters
Name Description
start_date*
date
Period start date.
Required
end_date*
date
Period end date.
Required
date_interval
String

Responses

Status: 200 - Available results returned.

Status: 204 - No result.

Status: 400 - Malformed request.

Status: 401 - Unauthorized.

Status: 403 - Forbidden.

Status: 500 - Internal Errors.


getEComSummary

eCommerce metrics summry for the specified period.


/stats/ecom/summary

Usage and SDK Samples

curl -X GET "https://api.afsanalytics.com/v1//stats/ecom/summary?start_date=&end_date=&new_customers="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.AdvancedECommerceApi;

import java.io.File;
import java.util.*;

public class AdvancedECommerceApiExample {

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

        AdvancedECommerceApi apiInstance = new AdvancedECommerceApi();
        date startDate = ; // date | Period start date.
        date endDate = ; // date | Period end date.
        Boolean newCustomers = true; // Boolean | includes new customers metrics
        try {
            inline_response_200_30 result = apiInstance.getEComSummary(startDate, endDate, newCustomers);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AdvancedECommerceApi#getEComSummary");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.AdvancedECommerceApi;

public class AdvancedECommerceApiExample {

    public static void main(String[] args) {
        AdvancedECommerceApi apiInstance = new AdvancedECommerceApi();
        date startDate = ; // date | Period start date.
        date endDate = ; // date | Period end date.
        Boolean newCustomers = true; // Boolean | includes new customers metrics
        try {
            inline_response_200_30 result = apiInstance.getEComSummary(startDate, endDate, newCustomers);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AdvancedECommerceApi#getEComSummary");
            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"];
date *startDate = ; // Period start date.
date *endDate = ; // Period end date.
Boolean *newCustomers = true; // includes new customers metrics (optional)

AdvancedECommerceApi *apiInstance = [[AdvancedECommerceApi alloc] init];

// eCommerce metrics summry for the specified period.
[apiInstance getEComSummaryWith:startDate
    endDate:endDate
    newCustomers:newCustomers
              completionHandler: ^(inline_response_200_30 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.AdvancedECommerceApi()
var startDate = ; // {{date}} Period start date.
var endDate = ; // {{date}} Period end date.
var opts = { 
  'newCustomers': true // {{Boolean}} includes new customers metrics
};
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getEComSummary(startDate, endDate, opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getEComSummaryExample
    {
        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 AdvancedECommerceApi();
            var startDate = new date(); // date | Period start date.
            var endDate = new date(); // date | Period end date.
            var newCustomers = true;  // Boolean | includes new customers metrics (optional) 

            try
            {
                // eCommerce metrics summry for the specified period.
                inline_response_200_30 result = apiInstance.getEComSummary(startDate, endDate, newCustomers);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AdvancedECommerceApi.getEComSummary: " + 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\ApiAdvancedECommerceApi();
$startDate = ; // date | Period start date.
$endDate = ; // date | Period end date.
$newCustomers = true; // Boolean | includes new customers metrics

try {
    $result = $api_instance->getEComSummary($startDate, $endDate, $newCustomers);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AdvancedECommerceApi->getEComSummary: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::AdvancedECommerceApi;

# 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::AdvancedECommerceApi->new();
my $startDate = ; # date | Period start date.
my $endDate = ; # date | Period end date.
my $newCustomers = true; # Boolean | includes new customers metrics

eval { 
    my $result = $api_instance->getEComSummary(startDate => $startDate, endDate => $endDate, newCustomers => $newCustomers);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AdvancedECommerceApi->getEComSummary: $@\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.AdvancedECommerceApi()
startDate =  # date | Period start date.
endDate =  # date | Period end date.
newCustomers = true # Boolean | includes new customers metrics (optional)

try: 
    # eCommerce metrics summry for the specified period.
    api_response = api_instance.get_e_com_summary(startDate, endDate, newCustomers=newCustomers)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AdvancedECommerceApi->getEComSummary: %s\n" % e)

Parameters

Query parameters
Name Description
start_date*
date
Period start date.
Required
end_date*
date
Period end date.
Required
new_customers
Boolean
includes new customers metrics

Responses

Status: 200 - Available results returned.

Status: 204 - No result.

Status: 400 - Malformed request.

Status: 401 - Unauthorized.

Status: 403 - Forbidden.

Status: 500 - Internal Errors.


getNewCustomers

List of new customers.


/stats/ecom/customers/new

Usage and SDK Samples

curl -X GET "https://api.afsanalytics.com/v1//stats/ecom/customers/new?start_date=&end_date=&offset=&limit="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.AdvancedECommerceApi;

import java.io.File;
import java.util.*;

public class AdvancedECommerceApiExample {

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

        AdvancedECommerceApi apiInstance = new AdvancedECommerceApi();
        date startDate = ; // date | Period start date.
        date endDate = ; // date | Period end date.
        Integer offset = 56; // Integer | position of the first record to be returned.
        Integer limit = 56; // Integer | max number of records to be returned.
        try {
            inline_response_200_21 result = apiInstance.getNewCustomers(startDate, endDate, offset, limit);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AdvancedECommerceApi#getNewCustomers");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.AdvancedECommerceApi;

public class AdvancedECommerceApiExample {

    public static void main(String[] args) {
        AdvancedECommerceApi apiInstance = new AdvancedECommerceApi();
        date startDate = ; // date | Period start date.
        date endDate = ; // date | Period end date.
        Integer offset = 56; // Integer | position of the first record to be returned.
        Integer limit = 56; // Integer | max number of records to be returned.
        try {
            inline_response_200_21 result = apiInstance.getNewCustomers(startDate, endDate, offset, limit);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AdvancedECommerceApi#getNewCustomers");
            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"];
date *startDate = ; // Period start date.
date *endDate = ; // Period end date.
Integer *offset = 56; // position of the first record to be returned. (optional)
Integer *limit = 56; // max number of records to be returned. (optional)

AdvancedECommerceApi *apiInstance = [[AdvancedECommerceApi alloc] init];

// List of new customers.
[apiInstance getNewCustomersWith:startDate
    endDate:endDate
    offset:offset
    limit:limit
              completionHandler: ^(inline_response_200_21 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.AdvancedECommerceApi()
var startDate = ; // {{date}} Period start date.
var endDate = ; // {{date}} Period end date.
var opts = { 
  'offset': 56, // {{Integer}} position of the first record to be returned.
  'limit': 56 // {{Integer}} max number of records to be returned.
};
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getNewCustomers(startDate, endDate, opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getNewCustomersExample
    {
        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 AdvancedECommerceApi();
            var startDate = new date(); // date | Period start date.
            var endDate = new date(); // date | Period end date.
            var offset = 56;  // Integer | position of the first record to be returned. (optional) 
            var limit = 56;  // Integer | max number of records to be returned. (optional) 

            try
            {
                // List of new customers.
                inline_response_200_21 result = apiInstance.getNewCustomers(startDate, endDate, offset, limit);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AdvancedECommerceApi.getNewCustomers: " + 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\ApiAdvancedECommerceApi();
$startDate = ; // date | Period start date.
$endDate = ; // date | Period end date.
$offset = 56; // Integer | position of the first record to be returned.
$limit = 56; // Integer | max number of records to be returned.

try {
    $result = $api_instance->getNewCustomers($startDate, $endDate, $offset, $limit);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AdvancedECommerceApi->getNewCustomers: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::AdvancedECommerceApi;

# 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::AdvancedECommerceApi->new();
my $startDate = ; # date | Period start date.
my $endDate = ; # date | Period end date.
my $offset = 56; # Integer | position of the first record to be returned.
my $limit = 56; # Integer | max number of records to be returned.

eval { 
    my $result = $api_instance->getNewCustomers(startDate => $startDate, endDate => $endDate, offset => $offset, limit => $limit);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AdvancedECommerceApi->getNewCustomers: $@\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.AdvancedECommerceApi()
startDate =  # date | Period start date.
endDate =  # date | Period end date.
offset = 56 # Integer | position of the first record to be returned. (optional)
limit = 56 # Integer | max number of records to be returned. (optional)

try: 
    # List of new customers.
    api_response = api_instance.get_new_customers(startDate, endDate, offset=offset, limit=limit)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AdvancedECommerceApi->getNewCustomers: %s\n" % e)

Parameters

Query parameters
Name Description
start_date*
date
Period start date.
Required
end_date*
date
Period end date.
Required
offset
Integer
position of the first record to be returned.
limit
Integer
max number of records to be returned.

Responses

Status: 200 - Available results returned.

Status: 204 - No result.

Status: 400 - Malformed request.

Status: 401 - Unauthorized.

Status: 403 - Forbidden.

Status: 500 - Internal Errors.


getNewCustomersMetrics

New customers orders metrics.


/stats/ecom/customers/new/metrics

Usage and SDK Samples

curl -X GET "https://api.afsanalytics.com/v1//stats/ecom/customers/new/metrics?start_date=&end_date=&date_interval=&previous_period="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.AdvancedECommerceApi;

import java.io.File;
import java.util.*;

public class AdvancedECommerceApiExample {

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

        AdvancedECommerceApi apiInstance = new AdvancedECommerceApi();
        date startDate = ; // date | Period start date.
        date endDate = ; // date | Period end date.
        String dateInterval = dateInterval_example; // String | 
        String previousPeriod = previousPeriod_example; // String | Time difference from previous period(s) to current one. Periods should NOT overlap.
        try {
            inline_response_200_22 result = apiInstance.getNewCustomersMetrics(startDate, endDate, dateInterval, previousPeriod);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AdvancedECommerceApi#getNewCustomersMetrics");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.AdvancedECommerceApi;

public class AdvancedECommerceApiExample {

    public static void main(String[] args) {
        AdvancedECommerceApi apiInstance = new AdvancedECommerceApi();
        date startDate = ; // date | Period start date.
        date endDate = ; // date | Period end date.
        String dateInterval = dateInterval_example; // String | 
        String previousPeriod = previousPeriod_example; // String | Time difference from previous period(s) to current one. Periods should NOT overlap.
        try {
            inline_response_200_22 result = apiInstance.getNewCustomersMetrics(startDate, endDate, dateInterval, previousPeriod);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AdvancedECommerceApi#getNewCustomersMetrics");
            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"];
date *startDate = ; // Period start date.
date *endDate = ; // Period end date.
String *dateInterval = dateInterval_example; //  (optional)
String *previousPeriod = previousPeriod_example; // Time difference from previous period(s) to current one. Periods should NOT overlap. (optional)

AdvancedECommerceApi *apiInstance = [[AdvancedECommerceApi alloc] init];

// New customers orders metrics.
[apiInstance getNewCustomersMetricsWith:startDate
    endDate:endDate
    dateInterval:dateInterval
    previousPeriod:previousPeriod
              completionHandler: ^(inline_response_200_22 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.AdvancedECommerceApi()
var startDate = ; // {{date}} Period start date.
var endDate = ; // {{date}} Period end date.
var opts = { 
  'dateInterval': dateInterval_example, // {{String}} 
  'previousPeriod': previousPeriod_example // {{String}} Time difference from previous period(s) to current one. Periods should NOT overlap.
};
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getNewCustomersMetrics(startDate, endDate, opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getNewCustomersMetricsExample
    {
        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 AdvancedECommerceApi();
            var startDate = new date(); // date | Period start date.
            var endDate = new date(); // date | Period end date.
            var dateInterval = dateInterval_example;  // String |  (optional) 
            var previousPeriod = previousPeriod_example;  // String | Time difference from previous period(s) to current one. Periods should NOT overlap. (optional) 

            try
            {
                // New customers orders metrics.
                inline_response_200_22 result = apiInstance.getNewCustomersMetrics(startDate, endDate, dateInterval, previousPeriod);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AdvancedECommerceApi.getNewCustomersMetrics: " + 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\ApiAdvancedECommerceApi();
$startDate = ; // date | Period start date.
$endDate = ; // date | Period end date.
$dateInterval = dateInterval_example; // String | 
$previousPeriod = previousPeriod_example; // String | Time difference from previous period(s) to current one. Periods should NOT overlap.

try {
    $result = $api_instance->getNewCustomersMetrics($startDate, $endDate, $dateInterval, $previousPeriod);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AdvancedECommerceApi->getNewCustomersMetrics: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::AdvancedECommerceApi;

# 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::AdvancedECommerceApi->new();
my $startDate = ; # date | Period start date.
my $endDate = ; # date | Period end date.
my $dateInterval = dateInterval_example; # String | 
my $previousPeriod = previousPeriod_example; # String | Time difference from previous period(s) to current one. Periods should NOT overlap.

eval { 
    my $result = $api_instance->getNewCustomersMetrics(startDate => $startDate, endDate => $endDate, dateInterval => $dateInterval, previousPeriod => $previousPeriod);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AdvancedECommerceApi->getNewCustomersMetrics: $@\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.AdvancedECommerceApi()
startDate =  # date | Period start date.
endDate =  # date | Period end date.
dateInterval = dateInterval_example # String |  (optional)
previousPeriod = previousPeriod_example # String | Time difference from previous period(s) to current one. Periods should NOT overlap. (optional)

try: 
    # New customers orders metrics.
    api_response = api_instance.get_new_customers_metrics(startDate, endDate, dateInterval=dateInterval, previousPeriod=previousPeriod)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AdvancedECommerceApi->getNewCustomersMetrics: %s\n" % e)

Parameters

Query parameters
Name Description
start_date*
date
Period start date.
Required
end_date*
date
Period end date.
Required
date_interval
String
previous_period
String
Time difference from previous period(s) to current one. Periods should NOT overlap.

Responses

Status: 200 - Available results returned.

Status: 204 - No result.

Status: 400 - Malformed request.

Status: 401 - Unauthorized.

Status: 403 - Forbidden.

Status: 500 - Internal Errors.


getOrders

Orders list.


/stats/ecom/orders

Usage and SDK Samples

curl -X GET "https://api.afsanalytics.com/v1//stats/ecom/orders?start_date=&end_date=&offset=&limit="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.AdvancedECommerceApi;

import java.io.File;
import java.util.*;

public class AdvancedECommerceApiExample {

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

        AdvancedECommerceApi apiInstance = new AdvancedECommerceApi();
        date startDate = ; // date | Period start date.
        date endDate = ; // date | Period end date.
        Integer offset = 56; // Integer | position of the first record to be returned.
        Integer limit = 56; // Integer | max number of records to be returned.
        try {
            inline_response_200_31 result = apiInstance.getOrders(startDate, endDate, offset, limit);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AdvancedECommerceApi#getOrders");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.AdvancedECommerceApi;

public class AdvancedECommerceApiExample {

    public static void main(String[] args) {
        AdvancedECommerceApi apiInstance = new AdvancedECommerceApi();
        date startDate = ; // date | Period start date.
        date endDate = ; // date | Period end date.
        Integer offset = 56; // Integer | position of the first record to be returned.
        Integer limit = 56; // Integer | max number of records to be returned.
        try {
            inline_response_200_31 result = apiInstance.getOrders(startDate, endDate, offset, limit);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AdvancedECommerceApi#getOrders");
            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"];
date *startDate = ; // Period start date.
date *endDate = ; // Period end date.
Integer *offset = 56; // position of the first record to be returned. (optional)
Integer *limit = 56; // max number of records to be returned. (optional)

AdvancedECommerceApi *apiInstance = [[AdvancedECommerceApi alloc] init];

// Orders list.
[apiInstance getOrdersWith:startDate
    endDate:endDate
    offset:offset
    limit:limit
              completionHandler: ^(inline_response_200_31 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.AdvancedECommerceApi()
var startDate = ; // {{date}} Period start date.
var endDate = ; // {{date}} Period end date.
var opts = { 
  'offset': 56, // {{Integer}} position of the first record to be returned.
  'limit': 56 // {{Integer}} max number of records to be returned.
};
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getOrders(startDate, endDate, opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getOrdersExample
    {
        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 AdvancedECommerceApi();
            var startDate = new date(); // date | Period start date.
            var endDate = new date(); // date | Period end date.
            var offset = 56;  // Integer | position of the first record to be returned. (optional) 
            var limit = 56;  // Integer | max number of records to be returned. (optional) 

            try
            {
                // Orders list.
                inline_response_200_31 result = apiInstance.getOrders(startDate, endDate, offset, limit);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AdvancedECommerceApi.getOrders: " + 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\ApiAdvancedECommerceApi();
$startDate = ; // date | Period start date.
$endDate = ; // date | Period end date.
$offset = 56; // Integer | position of the first record to be returned.
$limit = 56; // Integer | max number of records to be returned.

try {
    $result = $api_instance->getOrders($startDate, $endDate, $offset, $limit);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AdvancedECommerceApi->getOrders: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::AdvancedECommerceApi;

# 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::AdvancedECommerceApi->new();
my $startDate = ; # date | Period start date.
my $endDate = ; # date | Period end date.
my $offset = 56; # Integer | position of the first record to be returned.
my $limit = 56; # Integer | max number of records to be returned.

eval { 
    my $result = $api_instance->getOrders(startDate => $startDate, endDate => $endDate, offset => $offset, limit => $limit);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AdvancedECommerceApi->getOrders: $@\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.AdvancedECommerceApi()
startDate =  # date | Period start date.
endDate =  # date | Period end date.
offset = 56 # Integer | position of the first record to be returned. (optional)
limit = 56 # Integer | max number of records to be returned. (optional)

try: 
    # Orders list.
    api_response = api_instance.get_orders(startDate, endDate, offset=offset, limit=limit)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AdvancedECommerceApi->getOrders: %s\n" % e)

Parameters

Query parameters
Name Description
start_date*
date
Period start date.
Required
end_date*
date
Period end date.
Required
offset
Integer
position of the first record to be returned.
limit
Integer
max number of records to be returned.

Responses

Status: 200 - Available results returned.

Status: 204 - No result.

Status: 400 - Malformed request.

Status: 401 - Unauthorized.

Status: 403 - Forbidden.

Status: 500 - Internal Errors.


getSalesFunnelSteps

Sales funnel detailled steps.


/stats/ecom/sales/funnel

Usage and SDK Samples

curl -X GET "https://api.afsanalytics.com/v1//stats/ecom/sales/funnel?start_date=&end_date="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.AdvancedECommerceApi;

import java.io.File;
import java.util.*;

public class AdvancedECommerceApiExample {

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

        AdvancedECommerceApi apiInstance = new AdvancedECommerceApi();
        date startDate = ; // date | Period start date.
        date endDate = ; // date | Period end date.
        try {
            inline_response_200_29 result = apiInstance.getSalesFunnelSteps(startDate, endDate);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AdvancedECommerceApi#getSalesFunnelSteps");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.AdvancedECommerceApi;

public class AdvancedECommerceApiExample {

    public static void main(String[] args) {
        AdvancedECommerceApi apiInstance = new AdvancedECommerceApi();
        date startDate = ; // date | Period start date.
        date endDate = ; // date | Period end date.
        try {
            inline_response_200_29 result = apiInstance.getSalesFunnelSteps(startDate, endDate);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AdvancedECommerceApi#getSalesFunnelSteps");
            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"];
date *startDate = ; // Period start date.
date *endDate = ; // Period end date.

AdvancedECommerceApi *apiInstance = [[AdvancedECommerceApi alloc] init];

// Sales funnel detailled steps.
[apiInstance getSalesFunnelStepsWith:startDate
    endDate:endDate
              completionHandler: ^(inline_response_200_29 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.AdvancedECommerceApi()
var startDate = ; // {{date}} Period start date.
var endDate = ; // {{date}} Period end date.

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getSalesFunnelSteps(startDate, endDate, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getSalesFunnelStepsExample
    {
        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 AdvancedECommerceApi();
            var startDate = new date(); // date | Period start date.
            var endDate = new date(); // date | Period end date.

            try
            {
                // Sales funnel detailled steps.
                inline_response_200_29 result = apiInstance.getSalesFunnelSteps(startDate, endDate);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AdvancedECommerceApi.getSalesFunnelSteps: " + 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\ApiAdvancedECommerceApi();
$startDate = ; // date | Period start date.
$endDate = ; // date | Period end date.

try {
    $result = $api_instance->getSalesFunnelSteps($startDate, $endDate);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AdvancedECommerceApi->getSalesFunnelSteps: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::AdvancedECommerceApi;

# 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::AdvancedECommerceApi->new();
my $startDate = ; # date | Period start date.
my $endDate = ; # date | Period end date.

eval { 
    my $result = $api_instance->getSalesFunnelSteps(startDate => $startDate, endDate => $endDate);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AdvancedECommerceApi->getSalesFunnelSteps: $@\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.AdvancedECommerceApi()
startDate =  # date | Period start date.
endDate =  # date | Period end date.

try: 
    # Sales funnel detailled steps.
    api_response = api_instance.get_sales_funnel_steps(startDate, endDate)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AdvancedECommerceApi->getSalesFunnelSteps: %s\n" % e)

Parameters

Query parameters
Name Description
start_date*
date
Period start date.
Required
end_date*
date
Period end date.
Required

Responses

Status: 200 - Available results returned.

Status: 204 - No result.

Status: 400 - Malformed request.

Status: 401 - Unauthorized.

Status: 403 - Forbidden.

Status: 500 - Internal Errors.


getTopEComCampaigns

Top performing campaigns.


/stats/ecom/campaigns/top

Usage and SDK Samples

curl -X GET "https://api.afsanalytics.com/v1//stats/ecom/campaigns/top?offset=&limit=&campaign=&medium=&source=&term=&group="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.AdvancedECommerceApi;

import java.io.File;
import java.util.*;

public class AdvancedECommerceApiExample {

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

        AdvancedECommerceApi apiInstance = new AdvancedECommerceApi();
        Integer offset = 56; // Integer | position of the first record to be returned.
        Integer limit = 56; // Integer | max number of records to be returned.
        String campaign = campaign_example; // String | 
        String medium = medium_example; // String | 
        String source = source_example; // String | 
        String term = term_example; // String | 
        String group = group_example; // String | group results by ...
        try {
            inline_response_200_25 result = apiInstance.getTopEComCampaigns(offset, limit, campaign, medium, source, term, group);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AdvancedECommerceApi#getTopEComCampaigns");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.AdvancedECommerceApi;

public class AdvancedECommerceApiExample {

    public static void main(String[] args) {
        AdvancedECommerceApi apiInstance = new AdvancedECommerceApi();
        Integer offset = 56; // Integer | position of the first record to be returned.
        Integer limit = 56; // Integer | max number of records to be returned.
        String campaign = campaign_example; // String | 
        String medium = medium_example; // String | 
        String source = source_example; // String | 
        String term = term_example; // String | 
        String group = group_example; // String | group results by ...
        try {
            inline_response_200_25 result = apiInstance.getTopEComCampaigns(offset, limit, campaign, medium, source, term, group);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AdvancedECommerceApi#getTopEComCampaigns");
            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"];
Integer *offset = 56; // position of the first record to be returned. (optional)
Integer *limit = 56; // max number of records to be returned. (optional)
String *campaign = campaign_example; //  (optional)
String *medium = medium_example; //  (optional)
String *source = source_example; //  (optional)
String *term = term_example; //  (optional)
String *group = group_example; // group results by ... (optional)

AdvancedECommerceApi *apiInstance = [[AdvancedECommerceApi alloc] init];

// Top performing campaigns.
[apiInstance getTopEComCampaignsWith:offset
    limit:limit
    campaign:campaign
    medium:medium
    source:source
    term:term
    group:group
              completionHandler: ^(inline_response_200_25 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.AdvancedECommerceApi()
var opts = { 
  'offset': 56, // {{Integer}} position of the first record to be returned.
  'limit': 56, // {{Integer}} max number of records to be returned.
  'campaign': campaign_example, // {{String}} 
  'medium': medium_example, // {{String}} 
  'source': source_example, // {{String}} 
  'term': term_example, // {{String}} 
  'group': group_example // {{String}} group results by ...
};
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getTopEComCampaigns(opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getTopEComCampaignsExample
    {
        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 AdvancedECommerceApi();
            var offset = 56;  // Integer | position of the first record to be returned. (optional) 
            var limit = 56;  // Integer | max number of records to be returned. (optional) 
            var campaign = campaign_example;  // String |  (optional) 
            var medium = medium_example;  // String |  (optional) 
            var source = source_example;  // String |  (optional) 
            var term = term_example;  // String |  (optional) 
            var group = group_example;  // String | group results by ... (optional) 

            try
            {
                // Top performing campaigns.
                inline_response_200_25 result = apiInstance.getTopEComCampaigns(offset, limit, campaign, medium, source, term, group);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AdvancedECommerceApi.getTopEComCampaigns: " + 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\ApiAdvancedECommerceApi();
$offset = 56; // Integer | position of the first record to be returned.
$limit = 56; // Integer | max number of records to be returned.
$campaign = campaign_example; // String | 
$medium = medium_example; // String | 
$source = source_example; // String | 
$term = term_example; // String | 
$group = group_example; // String | group results by ...

try {
    $result = $api_instance->getTopEComCampaigns($offset, $limit, $campaign, $medium, $source, $term, $group);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AdvancedECommerceApi->getTopEComCampaigns: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::AdvancedECommerceApi;

# 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::AdvancedECommerceApi->new();
my $offset = 56; # Integer | position of the first record to be returned.
my $limit = 56; # Integer | max number of records to be returned.
my $campaign = campaign_example; # String | 
my $medium = medium_example; # String | 
my $source = source_example; # String | 
my $term = term_example; # String | 
my $group = group_example; # String | group results by ...

eval { 
    my $result = $api_instance->getTopEComCampaigns(offset => $offset, limit => $limit, campaign => $campaign, medium => $medium, source => $source, term => $term, group => $group);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AdvancedECommerceApi->getTopEComCampaigns: $@\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.AdvancedECommerceApi()
offset = 56 # Integer | position of the first record to be returned. (optional)
limit = 56 # Integer | max number of records to be returned. (optional)
campaign = campaign_example # String |  (optional)
medium = medium_example # String |  (optional)
source = source_example # String |  (optional)
term = term_example # String |  (optional)
group = group_example # String | group results by ... (optional)

try: 
    # Top performing campaigns.
    api_response = api_instance.get_top_e_com_campaigns(offset=offset, limit=limit, campaign=campaign, medium=medium, source=source, term=term, group=group)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AdvancedECommerceApi->getTopEComCampaigns: %s\n" % e)

Parameters

Query parameters
Name Description
offset
Integer
position of the first record to be returned.
limit
Integer
max number of records to be returned.
campaign
String
medium
String
source
String
term
String
group
String
group results by ...

Responses

Status: 200 - Available results returned.

Status: 204 - No result.

Status: 400 - Malformed request.

Status: 401 - Unauthorized.

Status: 403 - Forbidden.

Status: 500 - Internal Errors.


getTopGrossingProducts

Top grossing products.


/stats/ecom/products/top/grossing

Usage and SDK Samples

curl -X GET "https://api.afsanalytics.com/v1//stats/ecom/products/top/grossing?start_date=&end_date=&previous_period=¤t_period_ratio=&limit="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.AdvancedECommerceApi;

import java.io.File;
import java.util.*;

public class AdvancedECommerceApiExample {

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

        AdvancedECommerceApi apiInstance = new AdvancedECommerceApi();
        date startDate = ; // date | Period start date.
        date endDate = ; // date | Period end date.
        String previousPeriod = previousPeriod_example; // String | Time difference from previous period(s) to current one. Periods should NOT overlap.
        BigDecimal currentPeriodRatio = 1.2; // BigDecimal | 
        Integer limit = 56; // Integer | max number of records to be returned.
        try {
            inline_response_200_26 result = apiInstance.getTopGrossingProducts(startDate, endDate, previousPeriod, currentPeriodRatio, limit);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AdvancedECommerceApi#getTopGrossingProducts");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.AdvancedECommerceApi;

public class AdvancedECommerceApiExample {

    public static void main(String[] args) {
        AdvancedECommerceApi apiInstance = new AdvancedECommerceApi();
        date startDate = ; // date | Period start date.
        date endDate = ; // date | Period end date.
        String previousPeriod = previousPeriod_example; // String | Time difference from previous period(s) to current one. Periods should NOT overlap.
        BigDecimal currentPeriodRatio = 1.2; // BigDecimal | 
        Integer limit = 56; // Integer | max number of records to be returned.
        try {
            inline_response_200_26 result = apiInstance.getTopGrossingProducts(startDate, endDate, previousPeriod, currentPeriodRatio, limit);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AdvancedECommerceApi#getTopGrossingProducts");
            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"];
date *startDate = ; // Period start date.
date *endDate = ; // Period end date.
String *previousPeriod = previousPeriod_example; // Time difference from previous period(s) to current one. Periods should NOT overlap. (optional)
BigDecimal *currentPeriodRatio = 1.2; //  (optional)
Integer *limit = 56; // max number of records to be returned. (optional)

AdvancedECommerceApi *apiInstance = [[AdvancedECommerceApi alloc] init];

// Top grossing products.
[apiInstance getTopGrossingProductsWith:startDate
    endDate:endDate
    previousPeriod:previousPeriod
    currentPeriodRatio:currentPeriodRatio
    limit:limit
              completionHandler: ^(inline_response_200_26 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.AdvancedECommerceApi()
var startDate = ; // {{date}} Period start date.
var endDate = ; // {{date}} Period end date.
var opts = { 
  'previousPeriod': previousPeriod_example, // {{String}} Time difference from previous period(s) to current one. Periods should NOT overlap.
  'currentPeriodRatio': 1.2, // {{BigDecimal}} 
  'limit': 56 // {{Integer}} max number of records to be returned.
};
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getTopGrossingProducts(startDate, endDate, opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getTopGrossingProductsExample
    {
        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 AdvancedECommerceApi();
            var startDate = new date(); // date | Period start date.
            var endDate = new date(); // date | Period end date.
            var previousPeriod = previousPeriod_example;  // String | Time difference from previous period(s) to current one. Periods should NOT overlap. (optional) 
            var currentPeriodRatio = 1.2;  // BigDecimal |  (optional) 
            var limit = 56;  // Integer | max number of records to be returned. (optional) 

            try
            {
                // Top grossing products.
                inline_response_200_26 result = apiInstance.getTopGrossingProducts(startDate, endDate, previousPeriod, currentPeriodRatio, limit);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AdvancedECommerceApi.getTopGrossingProducts: " + 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\ApiAdvancedECommerceApi();
$startDate = ; // date | Period start date.
$endDate = ; // date | Period end date.
$previousPeriod = previousPeriod_example; // String | Time difference from previous period(s) to current one. Periods should NOT overlap.
$currentPeriodRatio = 1.2; // BigDecimal | 
$limit = 56; // Integer | max number of records to be returned.

try {
    $result = $api_instance->getTopGrossingProducts($startDate, $endDate, $previousPeriod, $currentPeriodRatio, $limit);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AdvancedECommerceApi->getTopGrossingProducts: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::AdvancedECommerceApi;

# 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::AdvancedECommerceApi->new();
my $startDate = ; # date | Period start date.
my $endDate = ; # date | Period end date.
my $previousPeriod = previousPeriod_example; # String | Time difference from previous period(s) to current one. Periods should NOT overlap.
my $currentPeriodRatio = 1.2; # BigDecimal | 
my $limit = 56; # Integer | max number of records to be returned.

eval { 
    my $result = $api_instance->getTopGrossingProducts(startDate => $startDate, endDate => $endDate, previousPeriod => $previousPeriod, currentPeriodRatio => $currentPeriodRatio, limit => $limit);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AdvancedECommerceApi->getTopGrossingProducts: $@\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.AdvancedECommerceApi()
startDate =  # date | Period start date.
endDate =  # date | Period end date.
previousPeriod = previousPeriod_example # String | Time difference from previous period(s) to current one. Periods should NOT overlap. (optional)
currentPeriodRatio = 1.2 # BigDecimal |  (optional)
limit = 56 # Integer | max number of records to be returned. (optional)

try: 
    # Top grossing products.
    api_response = api_instance.get_top_grossing_products(startDate, endDate, previousPeriod=previousPeriod, currentPeriodRatio=currentPeriodRatio, limit=limit)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AdvancedECommerceApi->getTopGrossingProducts: %s\n" % e)

Parameters

Query parameters
Name Description
start_date*
date
Period start date.
Required
end_date*
date
Period end date.
Required
previous_period
String
Time difference from previous period(s) to current one. Periods should NOT overlap.
current_period_ratio
BigDecimal
limit
Integer
max number of records to be returned.

Responses

Status: 200 - Available results returned.

Status: 204 - No result.

Status: 400 - Malformed request.

Status: 401 - Unauthorized.

Status: 403 - Forbidden.

Status: 500 - Internal Errors.


getTopSellingCategories

Top selling categories.


/stats/ecom/categories/top/selling

Usage and SDK Samples

curl -X GET "https://api.afsanalytics.com/v1//stats/ecom/categories/top/selling?start_date=&end_date=&limit=&order="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.AdvancedECommerceApi;

import java.io.File;
import java.util.*;

public class AdvancedECommerceApiExample {

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

        AdvancedECommerceApi apiInstance = new AdvancedECommerceApi();
        date startDate = ; // date | Period start date.
        date endDate = ; // date | Period end date.
        Integer limit = 56; // Integer | max number of records to be returned.
        String order = order_example; // String | 
        try {
            inline_response_200_28 result = apiInstance.getTopSellingCategories(startDate, endDate, limit, order);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AdvancedECommerceApi#getTopSellingCategories");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.AdvancedECommerceApi;

public class AdvancedECommerceApiExample {

    public static void main(String[] args) {
        AdvancedECommerceApi apiInstance = new AdvancedECommerceApi();
        date startDate = ; // date | Period start date.
        date endDate = ; // date | Period end date.
        Integer limit = 56; // Integer | max number of records to be returned.
        String order = order_example; // String | 
        try {
            inline_response_200_28 result = apiInstance.getTopSellingCategories(startDate, endDate, limit, order);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AdvancedECommerceApi#getTopSellingCategories");
            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"];
date *startDate = ; // Period start date.
date *endDate = ; // Period end date.
Integer *limit = 56; // max number of records to be returned. (optional)
String *order = order_example; //  (optional)

AdvancedECommerceApi *apiInstance = [[AdvancedECommerceApi alloc] init];

// Top selling categories.
[apiInstance getTopSellingCategoriesWith:startDate
    endDate:endDate
    limit:limit
    order:order
              completionHandler: ^(inline_response_200_28 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.AdvancedECommerceApi()
var startDate = ; // {{date}} Period start date.
var endDate = ; // {{date}} Period end date.
var opts = { 
  'limit': 56, // {{Integer}} max number of records to be returned.
  'order': order_example // {{String}} 
};
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getTopSellingCategories(startDate, endDate, opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getTopSellingCategoriesExample
    {
        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 AdvancedECommerceApi();
            var startDate = new date(); // date | Period start date.
            var endDate = new date(); // date | Period end date.
            var limit = 56;  // Integer | max number of records to be returned. (optional) 
            var order = order_example;  // String |  (optional) 

            try
            {
                // Top selling categories.
                inline_response_200_28 result = apiInstance.getTopSellingCategories(startDate, endDate, limit, order);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AdvancedECommerceApi.getTopSellingCategories: " + 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\ApiAdvancedECommerceApi();
$startDate = ; // date | Period start date.
$endDate = ; // date | Period end date.
$limit = 56; // Integer | max number of records to be returned.
$order = order_example; // String | 

try {
    $result = $api_instance->getTopSellingCategories($startDate, $endDate, $limit, $order);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AdvancedECommerceApi->getTopSellingCategories: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::AdvancedECommerceApi;

# 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::AdvancedECommerceApi->new();
my $startDate = ; # date | Period start date.
my $endDate = ; # date | Period end date.
my $limit = 56; # Integer | max number of records to be returned.
my $order = order_example; # String | 

eval { 
    my $result = $api_instance->getTopSellingCategories(startDate => $startDate, endDate => $endDate, limit => $limit, order => $order);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AdvancedECommerceApi->getTopSellingCategories: $@\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.AdvancedECommerceApi()
startDate =  # date | Period start date.
endDate =  # date | Period end date.
limit = 56 # Integer | max number of records to be returned. (optional)
order = order_example # String |  (optional)

try: 
    # Top selling categories.
    api_response = api_instance.get_top_selling_categories(startDate, endDate, limit=limit, order=order)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AdvancedECommerceApi->getTopSellingCategories: %s\n" % e)

Parameters

Query parameters
Name Description
start_date*
date
Period start date.
Required
end_date*
date
Period end date.
Required
limit
Integer
max number of records to be returned.
order
String

Responses

Status: 200 - Available results returned.

Status: 204 - No result.

Status: 400 - Malformed request.

Status: 401 - Unauthorized.

Status: 403 - Forbidden.

Status: 500 - Internal Errors.


getTopSellingProducts

Top selling products.


/stats/ecom/products/top/selling

Usage and SDK Samples

curl -X GET "https://api.afsanalytics.com/v1//stats/ecom/products/top/selling?start_date=&end_date=&limit=&order="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.AdvancedECommerceApi;

import java.io.File;
import java.util.*;

public class AdvancedECommerceApiExample {

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

        AdvancedECommerceApi apiInstance = new AdvancedECommerceApi();
        date startDate = ; // date | Period start date.
        date endDate = ; // date | Period end date.
        Integer limit = 56; // Integer | max number of records to be returned.
        String order = order_example; // String | 
        try {
            inline_response_200_27 result = apiInstance.getTopSellingProducts(startDate, endDate, limit, order);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AdvancedECommerceApi#getTopSellingProducts");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.AdvancedECommerceApi;

public class AdvancedECommerceApiExample {

    public static void main(String[] args) {
        AdvancedECommerceApi apiInstance = new AdvancedECommerceApi();
        date startDate = ; // date | Period start date.
        date endDate = ; // date | Period end date.
        Integer limit = 56; // Integer | max number of records to be returned.
        String order = order_example; // String | 
        try {
            inline_response_200_27 result = apiInstance.getTopSellingProducts(startDate, endDate, limit, order);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AdvancedECommerceApi#getTopSellingProducts");
            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"];
date *startDate = ; // Period start date.
date *endDate = ; // Period end date.
Integer *limit = 56; // max number of records to be returned. (optional)
String *order = order_example; //  (optional)

AdvancedECommerceApi *apiInstance = [[AdvancedECommerceApi alloc] init];

// Top selling products.
[apiInstance getTopSellingProductsWith:startDate
    endDate:endDate
    limit:limit
    order:order
              completionHandler: ^(inline_response_200_27 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.AdvancedECommerceApi()
var startDate = ; // {{date}} Period start date.
var endDate = ; // {{date}} Period end date.
var opts = { 
  'limit': 56, // {{Integer}} max number of records to be returned.
  'order': order_example // {{String}} 
};
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getTopSellingProducts(startDate, endDate, opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getTopSellingProductsExample
    {
        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 AdvancedECommerceApi();
            var startDate = new date(); // date | Period start date.
            var endDate = new date(); // date | Period end date.
            var limit = 56;  // Integer | max number of records to be returned. (optional) 
            var order = order_example;  // String |  (optional) 

            try
            {
                // Top selling products.
                inline_response_200_27 result = apiInstance.getTopSellingProducts(startDate, endDate, limit, order);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AdvancedECommerceApi.getTopSellingProducts: " + 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\ApiAdvancedECommerceApi();
$startDate = ; // date | Period start date.
$endDate = ; // date | Period end date.
$limit = 56; // Integer | max number of records to be returned.
$order = order_example; // String | 

try {
    $result = $api_instance->getTopSellingProducts($startDate, $endDate, $limit, $order);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AdvancedECommerceApi->getTopSellingProducts: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::AdvancedECommerceApi;

# 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::AdvancedECommerceApi->new();
my $startDate = ; # date | Period start date.
my $endDate = ; # date | Period end date.
my $limit = 56; # Integer | max number of records to be returned.
my $order = order_example; # String | 

eval { 
    my $result = $api_instance->getTopSellingProducts(startDate => $startDate, endDate => $endDate, limit => $limit, order => $order);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AdvancedECommerceApi->getTopSellingProducts: $@\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.AdvancedECommerceApi()
startDate =  # date | Period start date.
endDate =  # date | Period end date.
limit = 56 # Integer | max number of records to be returned. (optional)
order = order_example # String |  (optional)

try: 
    # Top selling products.
    api_response = api_instance.get_top_selling_products(startDate, endDate, limit=limit, order=order)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AdvancedECommerceApi->getTopSellingProducts: %s\n" % e)

Parameters

Query parameters
Name Description
start_date*
date
Period start date.
Required
end_date*
date
Period end date.
Required
limit
Integer
max number of records to be returned.
order
String

Responses

Status: 200 - Available results returned.

Status: 204 - No result.

Status: 400 - Malformed request.

Status: 401 - Unauthorized.

Status: 403 - Forbidden.

Status: 500 - Internal Errors.


Events

getTopEvents

Return data for top events.


/stats/events/top

Usage and SDK Samples

curl -X GET "https://api.afsanalytics.com/v1//stats/events/top?start_date=&end_date=&offset=&limit="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.EventsApi;

import java.io.File;
import java.util.*;

public class EventsApiExample {

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

        EventsApi apiInstance = new EventsApi();
        date startDate = ; // date | Period start date.
        date endDate = ; // date | Period end date.
        Integer offset = 56; // Integer | position of the first record to be returned.
        Integer limit = 56; // Integer | max number of records to be returned.
        try {
            inline_response_200_13 result = apiInstance.getTopEvents(startDate, endDate, offset, limit);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling EventsApi#getTopEvents");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.EventsApi;

public class EventsApiExample {

    public static void main(String[] args) {
        EventsApi apiInstance = new EventsApi();
        date startDate = ; // date | Period start date.
        date endDate = ; // date | Period end date.
        Integer offset = 56; // Integer | position of the first record to be returned.
        Integer limit = 56; // Integer | max number of records to be returned.
        try {
            inline_response_200_13 result = apiInstance.getTopEvents(startDate, endDate, offset, limit);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling EventsApi#getTopEvents");
            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"];
date *startDate = ; // Period start date.
date *endDate = ; // Period end date.
Integer *offset = 56; // position of the first record to be returned. (optional)
Integer *limit = 56; // max number of records to be returned. (optional)

EventsApi *apiInstance = [[EventsApi alloc] init];

// Return data for top events.
[apiInstance getTopEventsWith:startDate
    endDate:endDate
    offset:offset
    limit:limit
              completionHandler: ^(inline_response_200_13 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.EventsApi()
var startDate = ; // {{date}} Period start date.
var endDate = ; // {{date}} Period end date.
var opts = { 
  'offset': 56, // {{Integer}} position of the first record to be returned.
  'limit': 56 // {{Integer}} max number of records to be returned.
};
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getTopEvents(startDate, endDate, opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getTopEventsExample
    {
        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 EventsApi();
            var startDate = new date(); // date | Period start date.
            var endDate = new date(); // date | Period end date.
            var offset = 56;  // Integer | position of the first record to be returned. (optional) 
            var limit = 56;  // Integer | max number of records to be returned. (optional) 

            try
            {
                // Return data for top events.
                inline_response_200_13 result = apiInstance.getTopEvents(startDate, endDate, offset, limit);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling EventsApi.getTopEvents: " + 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\ApiEventsApi();
$startDate = ; // date | Period start date.
$endDate = ; // date | Period end date.
$offset = 56; // Integer | position of the first record to be returned.
$limit = 56; // Integer | max number of records to be returned.

try {
    $result = $api_instance->getTopEvents($startDate, $endDate, $offset, $limit);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling EventsApi->getTopEvents: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::EventsApi;

# 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::EventsApi->new();
my $startDate = ; # date | Period start date.
my $endDate = ; # date | Period end date.
my $offset = 56; # Integer | position of the first record to be returned.
my $limit = 56; # Integer | max number of records to be returned.

eval { 
    my $result = $api_instance->getTopEvents(startDate => $startDate, endDate => $endDate, offset => $offset, limit => $limit);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling EventsApi->getTopEvents: $@\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.EventsApi()
startDate =  # date | Period start date.
endDate =  # date | Period end date.
offset = 56 # Integer | position of the first record to be returned. (optional)
limit = 56 # Integer | max number of records to be returned. (optional)

try: 
    # Return data for top events.
    api_response = api_instance.get_top_events(startDate, endDate, offset=offset, limit=limit)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling EventsApi->getTopEvents: %s\n" % e)

Parameters

Query parameters
Name Description
start_date*
date
Period start date.
Required
end_date*
date
Period end date.
Required
offset
Integer
position of the first record to be returned.
limit
Integer
max number of records to be returned.

Responses

Status: 200 - Available results returned.

Status: 204 - No result.

Status: 400 - Malformed request.

Status: 401 - Unauthorized.

Status: 403 - Forbidden.

Status: 500 - Internal Errors.


Heatmaps

getHeatmaps

Return a list of all created Heatmaps.


/stats/heatmaps

Usage and SDK Samples

curl -X GET "https://api.afsanalytics.com/v1//stats/heatmaps"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.HeatmapsApi;

import java.io.File;
import java.util.*;

public class HeatmapsApiExample {

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

        HeatmapsApi apiInstance = new HeatmapsApi();
        try {
            inline_response_200_15 result = apiInstance.getHeatmaps();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling HeatmapsApi#getHeatmaps");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.HeatmapsApi;

public class HeatmapsApiExample {

    public static void main(String[] args) {
        HeatmapsApi apiInstance = new HeatmapsApi();
        try {
            inline_response_200_15 result = apiInstance.getHeatmaps();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling HeatmapsApi#getHeatmaps");
            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"];

HeatmapsApi *apiInstance = [[HeatmapsApi alloc] init];

// Return a list of all created Heatmaps.
[apiInstance getHeatmapsWithCompletionHandler: 
              ^(inline_response_200_15 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.HeatmapsApi()
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getHeatmaps(callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getHeatmapsExample
    {
        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 HeatmapsApi();

            try
            {
                // Return a list of all created Heatmaps.
                inline_response_200_15 result = apiInstance.getHeatmaps();
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling HeatmapsApi.getHeatmaps: " + 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\ApiHeatmapsApi();

try {
    $result = $api_instance->getHeatmaps();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling HeatmapsApi->getHeatmaps: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::HeatmapsApi;

# 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::HeatmapsApi->new();

eval { 
    my $result = $api_instance->getHeatmaps();
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling HeatmapsApi->getHeatmaps: $@\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.HeatmapsApi()

try: 
    # Return a list of all created Heatmaps.
    api_response = api_instance.get_heatmaps()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling HeatmapsApi->getHeatmaps: %s\n" % e)

Parameters

Responses

Status: 200 - Available results returned.

Status: 204 - No result.

Status: 400 - Malformed request.

Status: 401 - Unauthorized.

Status: 403 - Forbidden.

Status: 500 - Internal Errors.


getHeatmapsData

Return Heatmaps data.


/stats/heatmaps/{id}/data

Usage and SDK Samples

curl -X GET "https://api.afsanalytics.com/v1//stats/heatmaps/{id}/data?format="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.HeatmapsApi;

import java.io.File;
import java.util.*;

public class HeatmapsApiExample {

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

        HeatmapsApi apiInstance = new HeatmapsApi();
        Integer id = 56; // Integer | unique id
        String format = format_example; // String | 
        try {
            inline_response_200_17 result = apiInstance.getHeatmapsData(id, format);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling HeatmapsApi#getHeatmapsData");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.HeatmapsApi;

public class HeatmapsApiExample {

    public static void main(String[] args) {
        HeatmapsApi apiInstance = new HeatmapsApi();
        Integer id = 56; // Integer | unique id
        String format = format_example; // String | 
        try {
            inline_response_200_17 result = apiInstance.getHeatmapsData(id, format);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling HeatmapsApi#getHeatmapsData");
            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"];
Integer *id = 56; // unique id
String *format = format_example; // 

HeatmapsApi *apiInstance = [[HeatmapsApi alloc] init];

// Return Heatmaps data.
[apiInstance getHeatmapsDataWith:id
    format:format
              completionHandler: ^(inline_response_200_17 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.HeatmapsApi()
var id = 56; // {{Integer}} unique id
var format = format_example; // {{String}} 

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getHeatmapsData(id, format, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getHeatmapsDataExample
    {
        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 HeatmapsApi();
            var id = 56;  // Integer | unique id
            var format = format_example;  // String | 

            try
            {
                // Return Heatmaps data.
                inline_response_200_17 result = apiInstance.getHeatmapsData(id, format);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling HeatmapsApi.getHeatmapsData: " + 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\ApiHeatmapsApi();
$id = 56; // Integer | unique id
$format = format_example; // String | 

try {
    $result = $api_instance->getHeatmapsData($id, $format);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling HeatmapsApi->getHeatmapsData: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::HeatmapsApi;

# 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::HeatmapsApi->new();
my $id = 56; # Integer | unique id
my $format = format_example; # String | 

eval { 
    my $result = $api_instance->getHeatmapsData(id => $id, format => $format);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling HeatmapsApi->getHeatmapsData: $@\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.HeatmapsApi()
id = 56 # Integer | unique id
format = format_example # String | 

try: 
    # Return Heatmaps data.
    api_response = api_instance.get_heatmaps_data(id, format)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling HeatmapsApi->getHeatmapsData: %s\n" % e)

Parameters

Path parameters
Name Description
id*
Integer
unique id
Required
Query parameters
Name Description
format*
String
Required

Responses

Status: 200 - Available results returned.

Status: 204 - No result.

Status: 400 - Malformed request.

Status: 401 - Unauthorized.

Status: 403 - Forbidden.

Status: 500 - Internal Errors.


getHeatmapsStatus

Return heatmap availibilty status.


/stats/heatmaps/{id}/status

Usage and SDK Samples

curl -X GET "https://api.afsanalytics.com/v1//stats/heatmaps/{id}/status?format="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.HeatmapsApi;

import java.io.File;
import java.util.*;

public class HeatmapsApiExample {

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

        HeatmapsApi apiInstance = new HeatmapsApi();
        Integer id = 56; // Integer | unique id
        String format = format_example; // String | 
        try {
            inline_response_200_16 result = apiInstance.getHeatmapsStatus(id, format);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling HeatmapsApi#getHeatmapsStatus");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.HeatmapsApi;

public class HeatmapsApiExample {

    public static void main(String[] args) {
        HeatmapsApi apiInstance = new HeatmapsApi();
        Integer id = 56; // Integer | unique id
        String format = format_example; // String | 
        try {
            inline_response_200_16 result = apiInstance.getHeatmapsStatus(id, format);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling HeatmapsApi#getHeatmapsStatus");
            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"];
Integer *id = 56; // unique id
String *format = format_example; // 

HeatmapsApi *apiInstance = [[HeatmapsApi alloc] init];

// Return heatmap availibilty status.
[apiInstance getHeatmapsStatusWith:id
    format:format
              completionHandler: ^(inline_response_200_16 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.HeatmapsApi()
var id = 56; // {{Integer}} unique id
var format = format_example; // {{String}} 

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getHeatmapsStatus(id, format, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getHeatmapsStatusExample
    {
        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 HeatmapsApi();
            var id = 56;  // Integer | unique id
            var format = format_example;  // String | 

            try
            {
                // Return heatmap availibilty status.
                inline_response_200_16 result = apiInstance.getHeatmapsStatus(id, format);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling HeatmapsApi.getHeatmapsStatus: " + 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\ApiHeatmapsApi();
$id = 56; // Integer | unique id
$format = format_example; // String | 

try {
    $result = $api_instance->getHeatmapsStatus($id, $format);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling HeatmapsApi->getHeatmapsStatus: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::HeatmapsApi;

# 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::HeatmapsApi->new();
my $id = 56; # Integer | unique id
my $format = format_example; # String | 

eval { 
    my $result = $api_instance->getHeatmapsStatus(id => $id, format => $format);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling HeatmapsApi->getHeatmapsStatus: $@\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.HeatmapsApi()
id = 56 # Integer | unique id
format = format_example # String | 

try: 
    # Return heatmap availibilty status.
    api_response = api_instance.get_heatmaps_status(id, format)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling HeatmapsApi->getHeatmapsStatus: %s\n" % e)

Parameters

Path parameters
Name Description
id*
Integer
unique id
Required
Query parameters
Name Description
format*
String
Required

Responses

Status: 200 - Available results returned.

Status: 204 - No result.

Status: 400 - Malformed request.

Status: 401 - Unauthorized.

Status: 403 - Forbidden.

Status: 500 - Internal Errors.


Traffic

getBrowserDistribution

Visitor browser distribution over specified period of time.


/stats/distribution/browser

Usage and SDK Samples

curl -X GET "https://api.afsanalytics.com/v1//stats/distribution/browser?start_date=&end_date="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.TrafficApi;

import java.io.File;
import java.util.*;

public class TrafficApiExample {

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

        TrafficApi apiInstance = new TrafficApi();
        date startDate = ; // date | Period start date.
        date endDate = ; // date | Period end date.
        try {
            inline_response_200_7 result = apiInstance.getBrowserDistribution(startDate, endDate);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling TrafficApi#getBrowserDistribution");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.TrafficApi;

public class TrafficApiExample {

    public static void main(String[] args) {
        TrafficApi apiInstance = new TrafficApi();
        date startDate = ; // date | Period start date.
        date endDate = ; // date | Period end date.
        try {
            inline_response_200_7 result = apiInstance.getBrowserDistribution(startDate, endDate);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling TrafficApi#getBrowserDistribution");
            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"];
date *startDate = ; // Period start date.
date *endDate = ; // Period end date.

TrafficApi *apiInstance = [[TrafficApi alloc] init];

// Visitor browser distribution over specified period of time.
[apiInstance getBrowserDistributionWith:startDate
    endDate:endDate
              completionHandler: ^(inline_response_200_7 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.TrafficApi()
var startDate = ; // {{date}} Period start date.
var endDate = ; // {{date}} Period end date.

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getBrowserDistribution(startDate, endDate, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getBrowserDistributionExample
    {
        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 TrafficApi();
            var startDate = new date(); // date | Period start date.
            var endDate = new date(); // date | Period end date.

            try
            {
                // Visitor browser distribution over specified period of time.
                inline_response_200_7 result = apiInstance.getBrowserDistribution(startDate, endDate);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling TrafficApi.getBrowserDistribution: " + 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\ApiTrafficApi();
$startDate = ; // date | Period start date.
$endDate = ; // date | Period end date.

try {
    $result = $api_instance->getBrowserDistribution($startDate, $endDate);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling TrafficApi->getBrowserDistribution: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::TrafficApi;

# 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::TrafficApi->new();
my $startDate = ; # date | Period start date.
my $endDate = ; # date | Period end date.

eval { 
    my $result = $api_instance->getBrowserDistribution(startDate => $startDate, endDate => $endDate);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling TrafficApi->getBrowserDistribution: $@\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.TrafficApi()
startDate =  # date | Period start date.
endDate =  # date | Period end date.

try: 
    # Visitor browser distribution over specified period of time.
    api_response = api_instance.get_browser_distribution(startDate, endDate)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling TrafficApi->getBrowserDistribution: %s\n" % e)

Parameters

Query parameters
Name Description
start_date*
date
Period start date.
Required
end_date*
date
Period end date.
Required

Responses

Status: 200 - Available results returned.

Status: 204 - No result.

Status: 400 - Malformed request.

Status: 401 - Unauthorized.

Status: 403 - Forbidden.

Status: 500 - Internal Errors.


getEngagementSummary

Return website engagement data.


/stats/engagement/summary

Usage and SDK Samples

curl -X GET "https://api.afsanalytics.com/v1//stats/engagement/summary?start_date=&end_date="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.TrafficApi;

import java.io.File;
import java.util.*;

public class TrafficApiExample {

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

        TrafficApi apiInstance = new TrafficApi();
        date startDate = ; // date | Period start date.
        date endDate = ; // date | Period end date.
        try {
            inline_response_200_14 result = apiInstance.getEngagementSummary(startDate, endDate);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling TrafficApi#getEngagementSummary");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.TrafficApi;

public class TrafficApiExample {

    public static void main(String[] args) {
        TrafficApi apiInstance = new TrafficApi();
        date startDate = ; // date | Period start date.
        date endDate = ; // date | Period end date.
        try {
            inline_response_200_14 result = apiInstance.getEngagementSummary(startDate, endDate);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling TrafficApi#getEngagementSummary");
            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"];
date *startDate = ; // Period start date.
date *endDate = ; // Period end date.

TrafficApi *apiInstance = [[TrafficApi alloc] init];

// Return website engagement data.
[apiInstance getEngagementSummaryWith:startDate
    endDate:endDate
              completionHandler: ^(inline_response_200_14 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.TrafficApi()
var startDate = ; // {{date}} Period start date.
var endDate = ; // {{date}} Period end date.

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getEngagementSummary(startDate, endDate, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getEngagementSummaryExample
    {
        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 TrafficApi();
            var startDate = new date(); // date | Period start date.
            var endDate = new date(); // date | Period end date.

            try
            {
                // Return website engagement data.
                inline_response_200_14 result = apiInstance.getEngagementSummary(startDate, endDate);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling TrafficApi.getEngagementSummary: " + 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\ApiTrafficApi();
$startDate = ; // date | Period start date.
$endDate = ; // date | Period end date.

try {
    $result = $api_instance->getEngagementSummary($startDate, $endDate);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling TrafficApi->getEngagementSummary: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::TrafficApi;

# 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::TrafficApi->new();
my $startDate = ; # date | Period start date.
my $endDate = ; # date | Period end date.

eval { 
    my $result = $api_instance->getEngagementSummary(startDate => $startDate, endDate => $endDate);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling TrafficApi->getEngagementSummary: $@\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.TrafficApi()
startDate =  # date | Period start date.
endDate =  # date | Period end date.

try: 
    # Return website engagement data.
    api_response = api_instance.get_engagement_summary(startDate, endDate)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling TrafficApi->getEngagementSummary: %s\n" % e)

Parameters

Query parameters
Name Description
start_date*
date
Period start date.
Required
end_date*
date
Period end date.
Required

Responses

Status: 200 - Available results returned.

Status: 204 - No result.

Status: 400 - Malformed request.

Status: 401 - Unauthorized.

Status: 403 - Forbidden.

Status: 500 - Internal Errors.


getGeoDistribution

Visitor Operating System distribution over a period of time.


/stats/distribution/geo

Usage and SDK Samples

curl -X GET "https://api.afsanalytics.com/v1//stats/distribution/geo?start_date=&end_date=&type="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.TrafficApi;

import java.io.File;
import java.util.*;

public class TrafficApiExample {

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

        TrafficApi apiInstance = new TrafficApi();
        date startDate = ; // date | Period start date.
        date endDate = ; // date | Period end date.
        String type = type_example; // String | Type of required metrics.
        try {
            inline_response_200_8 result = apiInstance.getGeoDistribution(startDate, endDate, type);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling TrafficApi#getGeoDistribution");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.TrafficApi;

public class TrafficApiExample {

    public static void main(String[] args) {
        TrafficApi apiInstance = new TrafficApi();
        date startDate = ; // date | Period start date.
        date endDate = ; // date | Period end date.
        String type = type_example; // String | Type of required metrics.
        try {
            inline_response_200_8 result = apiInstance.getGeoDistribution(startDate, endDate, type);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling TrafficApi#getGeoDistribution");
            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"];
date *startDate = ; // Period start date.
date *endDate = ; // Period end date.
String *type = type_example; // Type of required metrics. (optional)

TrafficApi *apiInstance = [[TrafficApi alloc] init];

// Visitor Operating System distribution over a period of time.
[apiInstance getGeoDistributionWith:startDate
    endDate:endDate
    type:type
              completionHandler: ^(inline_response_200_8 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.TrafficApi()
var startDate = ; // {{date}} Period start date.
var endDate = ; // {{date}} Period end date.
var opts = { 
  'type': type_example // {{String}} Type of required metrics.
};
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getGeoDistribution(startDate, endDate, opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getGeoDistributionExample
    {
        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 TrafficApi();
            var startDate = new date(); // date | Period start date.
            var endDate = new date(); // date | Period end date.
            var type = type_example;  // String | Type of required metrics. (optional) 

            try
            {
                // Visitor Operating System distribution over a period of time.
                inline_response_200_8 result = apiInstance.getGeoDistribution(startDate, endDate, type);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling TrafficApi.getGeoDistribution: " + 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\ApiTrafficApi();
$startDate = ; // date | Period start date.
$endDate = ; // date | Period end date.
$type = type_example; // String | Type of required metrics.

try {
    $result = $api_instance->getGeoDistribution($startDate, $endDate, $type);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling TrafficApi->getGeoDistribution: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::TrafficApi;

# 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::TrafficApi->new();
my $startDate = ; # date | Period start date.
my $endDate = ; # date | Period end date.
my $type = type_example; # String | Type of required metrics.

eval { 
    my $result = $api_instance->getGeoDistribution(startDate => $startDate, endDate => $endDate, type => $type);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling TrafficApi->getGeoDistribution: $@\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.TrafficApi()
startDate =  # date | Period start date.
endDate =  # date | Period end date.
type = type_example # String | Type of required metrics. (optional)

try: 
    # Visitor Operating System distribution over a period of time.
    api_response = api_instance.get_geo_distribution(startDate, endDate, type=type)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling TrafficApi->getGeoDistribution: %s\n" % e)

Parameters

Query parameters
Name Description
start_date*
date
Period start date.
Required
end_date*
date
Period end date.
Required
type
String
Type of required metrics.

Responses

Status: 200 - Available results returned.

Status: 204 - No result.

Status: 300 - Compiling data. Resend request after a few seconds.

Status: 400 - Malformed request.

Status: 401 - Unauthorized.

Status: 403 - Forbidden.

Status: 500 - Internal Errors.


getLastVisitors

Return a list of last visitors.


/stats/visitors/last

Usage and SDK Samples

curl -X GET "https://api.afsanalytics.com/v1//stats/visitors/last?limit="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.TrafficApi;

import java.io.File;
import java.util.*;

public class TrafficApiExample {

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

        TrafficApi apiInstance = new TrafficApi();
        Integer limit = 56; // Integer | max number of records to be returned.
        try {
            inline_response_200_4 result = apiInstance.getLastVisitors(limit);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling TrafficApi#getLastVisitors");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.TrafficApi;

public class TrafficApiExample {

    public static void main(String[] args) {
        TrafficApi apiInstance = new TrafficApi();
        Integer limit = 56; // Integer | max number of records to be returned.
        try {
            inline_response_200_4 result = apiInstance.getLastVisitors(limit);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling TrafficApi#getLastVisitors");
            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"];
Integer *limit = 56; // max number of records to be returned. (optional)

TrafficApi *apiInstance = [[TrafficApi alloc] init];

// Return a list of last visitors.
[apiInstance getLastVisitorsWith:limit
              completionHandler: ^(inline_response_200_4 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.TrafficApi()
var opts = { 
  'limit': 56 // {{Integer}} max number of records to be returned.
};
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getLastVisitors(opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getLastVisitorsExample
    {
        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 TrafficApi();
            var limit = 56;  // Integer | max number of records to be returned. (optional) 

            try
            {
                // Return a list of last visitors.
                inline_response_200_4 result = apiInstance.getLastVisitors(limit);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling TrafficApi.getLastVisitors: " + 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\ApiTrafficApi();
$limit = 56; // Integer | max number of records to be returned.

try {
    $result = $api_instance->getLastVisitors($limit);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling TrafficApi->getLastVisitors: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::TrafficApi;

# 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::TrafficApi->new();
my $limit = 56; # Integer | max number of records to be returned.

eval { 
    my $result = $api_instance->getLastVisitors(limit => $limit);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling TrafficApi->getLastVisitors: $@\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.TrafficApi()
limit = 56 # Integer | max number of records to be returned. (optional)

try: 
    # Return a list of last visitors.
    api_response = api_instance.get_last_visitors(limit=limit)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling TrafficApi->getLastVisitors: %s\n" % e)

Parameters

Query parameters
Name Description
limit
Integer
max number of records to be returned.

Responses

Status: 200 - Available results returned.

Status: 204 - No result.

Status: 400 - Malformed request.

Status: 401 - Unauthorized.

Status: 403 - Forbidden.

Status: 500 - Internal Errors.


getOnlineTraffic

Return Traffic metrics for visitors currently Online.


/stats/traffic/online

Usage and SDK Samples

curl -X GET "https://api.afsanalytics.com/v1//stats/traffic/online"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.TrafficApi;

import java.io.File;
import java.util.*;

public class TrafficApiExample {

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

        TrafficApi apiInstance = new TrafficApi();
        try {
            inline_response_200_3 result = apiInstance.getOnlineTraffic();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling TrafficApi#getOnlineTraffic");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.TrafficApi;

public class TrafficApiExample {

    public static void main(String[] args) {
        TrafficApi apiInstance = new TrafficApi();
        try {
            inline_response_200_3 result = apiInstance.getOnlineTraffic();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling TrafficApi#getOnlineTraffic");
            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"];

TrafficApi *apiInstance = [[TrafficApi alloc] init];

// Return Traffic metrics for visitors currently Online.
[apiInstance getOnlineTrafficWithCompletionHandler: 
              ^(inline_response_200_3 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.TrafficApi()
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getOnlineTraffic(callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getOnlineTrafficExample
    {
        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 TrafficApi();

            try
            {
                // Return Traffic metrics for visitors currently Online.
                inline_response_200_3 result = apiInstance.getOnlineTraffic();
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling TrafficApi.getOnlineTraffic: " + 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\ApiTrafficApi();

try {
    $result = $api_instance->getOnlineTraffic();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling TrafficApi->getOnlineTraffic: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::TrafficApi;

# 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::TrafficApi->new();

eval { 
    my $result = $api_instance->getOnlineTraffic();
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling TrafficApi->getOnlineTraffic: $@\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.TrafficApi()

try: 
    # Return Traffic metrics for visitors currently Online.
    api_response = api_instance.get_online_traffic()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling TrafficApi->getOnlineTraffic: %s\n" % e)

Parameters

Responses

Status: 200 - Available results returned.

Status: 204 - No result.

Status: 400 - Malformed request.

Status: 401 - Unauthorized.

Status: 403 - Forbidden.

Status: 500 - Internal Errors.


getOperatingSystemDistribution

Returns visitor Operating System distribution over specified period of time.


/stats/distribution/os

Usage and SDK Samples

curl -X GET "https://api.afsanalytics.com/v1//stats/distribution/os?start_date=&end_date=&date_interval="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.TrafficApi;

import java.io.File;
import java.util.*;

public class TrafficApiExample {

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

        TrafficApi apiInstance = new TrafficApi();
        date startDate = ; // date | Period start date.
        date endDate = ; // date | Period end date.
        String dateInterval = dateInterval_example; // String | 
        try {
            inline_response_200_6 result = apiInstance.getOperatingSystemDistribution(startDate, endDate, dateInterval);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling TrafficApi#getOperatingSystemDistribution");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.TrafficApi;

public class TrafficApiExample {

    public static void main(String[] args) {
        TrafficApi apiInstance = new TrafficApi();
        date startDate = ; // date | Period start date.
        date endDate = ; // date | Period end date.
        String dateInterval = dateInterval_example; // String | 
        try {
            inline_response_200_6 result = apiInstance.getOperatingSystemDistribution(startDate, endDate, dateInterval);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling TrafficApi#getOperatingSystemDistribution");
            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"];
date *startDate = ; // Period start date.
date *endDate = ; // Period end date.
String *dateInterval = dateInterval_example; //  (optional)

TrafficApi *apiInstance = [[TrafficApi alloc] init];

// Returns visitor Operating System distribution over specified period of time.
[apiInstance getOperatingSystemDistributionWith:startDate
    endDate:endDate
    dateInterval:dateInterval
              completionHandler: ^(inline_response_200_6 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.TrafficApi()
var startDate = ; // {{date}} Period start date.
var endDate = ; // {{date}} Period end date.
var opts = { 
  'dateInterval': dateInterval_example // {{String}} 
};
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getOperatingSystemDistribution(startDate, endDate, opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getOperatingSystemDistributionExample
    {
        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 TrafficApi();
            var startDate = new date(); // date | Period start date.
            var endDate = new date(); // date | Period end date.
            var dateInterval = dateInterval_example;  // String |  (optional) 

            try
            {
                // Returns visitor Operating System distribution over specified period of time.
                inline_response_200_6 result = apiInstance.getOperatingSystemDistribution(startDate, endDate, dateInterval);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling TrafficApi.getOperatingSystemDistribution: " + 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\ApiTrafficApi();
$startDate = ; // date | Period start date.
$endDate = ; // date | Period end date.
$dateInterval = dateInterval_example; // String | 

try {
    $result = $api_instance->getOperatingSystemDistribution($startDate, $endDate, $dateInterval);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling TrafficApi->getOperatingSystemDistribution: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::TrafficApi;

# 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::TrafficApi->new();
my $startDate = ; # date | Period start date.
my $endDate = ; # date | Period end date.
my $dateInterval = dateInterval_example; # String | 

eval { 
    my $result = $api_instance->getOperatingSystemDistribution(startDate => $startDate, endDate => $endDate, dateInterval => $dateInterval);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling TrafficApi->getOperatingSystemDistribution: $@\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.TrafficApi()
startDate =  # date | Period start date.
endDate =  # date | Period end date.
dateInterval = dateInterval_example # String |  (optional)

try: 
    # Returns visitor Operating System distribution over specified period of time.
    api_response = api_instance.get_operating_system_distribution(startDate, endDate, dateInterval=dateInterval)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling TrafficApi->getOperatingSystemDistribution: %s\n" % e)

Parameters

Query parameters
Name Description
start_date*
date
Period start date.
Required
end_date*
date
Period end date.
Required
date_interval
String

Responses

Status: 200 - Available results returned.

Status: 204 - No result.

Status: 400 - Malformed request.

Status: 401 - Unauthorized.

Status: 403 - Forbidden.

Status: 500 - Internal Errors.


getTopPages

Return metrics for top pages.


/stats/pages/top

Usage and SDK Samples

curl -X GET "https://api.afsanalytics.com/v1//stats/pages/top?start_date=&end_date=&offset=&limit="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.TrafficApi;

import java.io.File;
import java.util.*;

public class TrafficApiExample {

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

        TrafficApi apiInstance = new TrafficApi();
        date startDate = ; // date | Period start date.
        date endDate = ; // date | Period end date.
        Integer offset = 56; // Integer | position of the first record to be returned.
        Integer limit = 56; // Integer | max number of records to be returned.
        try {
            inline_response_200_11 result = apiInstance.getTopPages(startDate, endDate, offset, limit);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling TrafficApi#getTopPages");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.TrafficApi;

public class TrafficApiExample {

    public static void main(String[] args) {
        TrafficApi apiInstance = new TrafficApi();
        date startDate = ; // date | Period start date.
        date endDate = ; // date | Period end date.
        Integer offset = 56; // Integer | position of the first record to be returned.
        Integer limit = 56; // Integer | max number of records to be returned.
        try {
            inline_response_200_11 result = apiInstance.getTopPages(startDate, endDate, offset, limit);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling TrafficApi#getTopPages");
            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"];
date *startDate = ; // Period start date.
date *endDate = ; // Period end date.
Integer *offset = 56; // position of the first record to be returned. (optional)
Integer *limit = 56; // max number of records to be returned. (optional)

TrafficApi *apiInstance = [[TrafficApi alloc] init];

// Return metrics for top pages.
[apiInstance getTopPagesWith:startDate
    endDate:endDate
    offset:offset
    limit:limit
              completionHandler: ^(inline_response_200_11 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.TrafficApi()
var startDate = ; // {{date}} Period start date.
var endDate = ; // {{date}} Period end date.
var opts = { 
  'offset': 56, // {{Integer}} position of the first record to be returned.
  'limit': 56 // {{Integer}} max number of records to be returned.
};
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getTopPages(startDate, endDate, opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getTopPagesExample
    {
        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 TrafficApi();
            var startDate = new date(); // date | Period start date.
            var endDate = new date(); // date | Period end date.
            var offset = 56;  // Integer | position of the first record to be returned. (optional) 
            var limit = 56;  // Integer | max number of records to be returned. (optional) 

            try
            {
                // Return metrics for top pages.
                inline_response_200_11 result = apiInstance.getTopPages(startDate, endDate, offset, limit);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling TrafficApi.getTopPages: " + 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\ApiTrafficApi();
$startDate = ; // date | Period start date.
$endDate = ; // date | Period end date.
$offset = 56; // Integer | position of the first record to be returned.
$limit = 56; // Integer | max number of records to be returned.

try {
    $result = $api_instance->getTopPages($startDate, $endDate, $offset, $limit);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling TrafficApi->getTopPages: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::TrafficApi;

# 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::TrafficApi->new();
my $startDate = ; # date | Period start date.
my $endDate = ; # date | Period end date.
my $offset = 56; # Integer | position of the first record to be returned.
my $limit = 56; # Integer | max number of records to be returned.

eval { 
    my $result = $api_instance->getTopPages(startDate => $startDate, endDate => $endDate, offset => $offset, limit => $limit);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling TrafficApi->getTopPages: $@\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.TrafficApi()
startDate =  # date | Period start date.
endDate =  # date | Period end date.
offset = 56 # Integer | position of the first record to be returned. (optional)
limit = 56 # Integer | max number of records to be returned. (optional)

try: 
    # Return metrics for top pages.
    api_response = api_instance.get_top_pages(startDate, endDate, offset=offset, limit=limit)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling TrafficApi->getTopPages: %s\n" % e)

Parameters

Query parameters
Name Description
start_date*
date
Period start date.
Required
end_date*
date
Period end date.
Required
offset
Integer
position of the first record to be returned.
limit
Integer
max number of records to be returned.

Responses

Status: 200 - Available results returned.

Status: 204 - No result.

Status: 400 - Malformed request.

Status: 401 - Unauthorized.

Status: 403 - Forbidden.

Status: 500 - Internal Errors.


getTrafficMetrics

Return traffic metrics.


/stats/traffic/metrics

Usage and SDK Samples

curl -X GET "https://api.afsanalytics.com/v1//stats/traffic/metrics?start_date=&end_date=&date_interval="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.TrafficApi;

import java.io.File;
import java.util.*;

public class TrafficApiExample {

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

        TrafficApi apiInstance = new TrafficApi();
        date startDate = ; // date | Period start date.
        date endDate = ; // date | Period end date.
        String dateInterval = dateInterval_example; // String | 
        try {
            inline_response_200_2 result = apiInstance.getTrafficMetrics(startDate, endDate, dateInterval);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling TrafficApi#getTrafficMetrics");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.TrafficApi;

public class TrafficApiExample {

    public static void main(String[] args) {
        TrafficApi apiInstance = new TrafficApi();
        date startDate = ; // date | Period start date.
        date endDate = ; // date | Period end date.
        String dateInterval = dateInterval_example; // String | 
        try {
            inline_response_200_2 result = apiInstance.getTrafficMetrics(startDate, endDate, dateInterval);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling TrafficApi#getTrafficMetrics");
            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"];
date *startDate = ; // Period start date.
date *endDate = ; // Period end date.
String *dateInterval = dateInterval_example; //  (optional)

TrafficApi *apiInstance = [[TrafficApi alloc] init];

// Return traffic metrics.
[apiInstance getTrafficMetricsWith:startDate
    endDate:endDate
    dateInterval:dateInterval
              completionHandler: ^(inline_response_200_2 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.TrafficApi()
var startDate = ; // {{date}} Period start date.
var endDate = ; // {{date}} Period end date.
var opts = { 
  'dateInterval': dateInterval_example // {{String}} 
};
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getTrafficMetrics(startDate, endDate, opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getTrafficMetricsExample
    {
        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 TrafficApi();
            var startDate = new date(); // date | Period start date.
            var endDate = new date(); // date | Period end date.
            var dateInterval = dateInterval_example;  // String |  (optional) 

            try
            {
                // Return traffic metrics.
                inline_response_200_2 result = apiInstance.getTrafficMetrics(startDate, endDate, dateInterval);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling TrafficApi.getTrafficMetrics: " + 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\ApiTrafficApi();
$startDate = ; // date | Period start date.
$endDate = ; // date | Period end date.
$dateInterval = dateInterval_example; // String | 

try {
    $result = $api_instance->getTrafficMetrics($startDate, $endDate, $dateInterval);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling TrafficApi->getTrafficMetrics: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::TrafficApi;

# 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::TrafficApi->new();
my $startDate = ; # date | Period start date.
my $endDate = ; # date | Period end date.
my $dateInterval = dateInterval_example; # String | 

eval { 
    my $result = $api_instance->getTrafficMetrics(startDate => $startDate, endDate => $endDate, dateInterval => $dateInterval);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling TrafficApi->getTrafficMetrics: $@\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.TrafficApi()
startDate =  # date | Period start date.
endDate =  # date | Period end date.
dateInterval = dateInterval_example # String |  (optional)

try: 
    # Return traffic metrics.
    api_response = api_instance.get_traffic_metrics(startDate, endDate, dateInterval=dateInterval)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling TrafficApi->getTrafficMetrics: %s\n" % e)

Parameters

Query parameters
Name Description
start_date*
date
Period start date.
Required
end_date*
date
Period end date.
Required
date_interval
String

Responses

Status: 200 - Available results returned.

Status: 204 - No result.

Status: 400 - Malformed request.

Status: 401 - Unauthorized.

Status: 403 - Forbidden.

Status: 500 - Internal Errors.


getVisitor

Return information for visitor with specified ID.


/stats/visitor/{id}

Usage and SDK Samples

curl -X GET "https://api.afsanalytics.com/v1//stats/visitor/{id}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.TrafficApi;

import java.io.File;
import java.util.*;

public class TrafficApiExample {

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

        TrafficApi apiInstance = new TrafficApi();
        Integer id = 56; // Integer | unique id
        try {
            inline_response_200_5 result = apiInstance.getVisitor(id);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling TrafficApi#getVisitor");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.TrafficApi;

public class TrafficApiExample {

    public static void main(String[] args) {
        TrafficApi apiInstance = new TrafficApi();
        Integer id = 56; // Integer | unique id
        try {
            inline_response_200_5 result = apiInstance.getVisitor(id);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling TrafficApi#getVisitor");
            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"];
Integer *id = 56; // unique id

TrafficApi *apiInstance = [[TrafficApi alloc] init];

// Return information for visitor with specified ID.
[apiInstance getVisitorWith:id
              completionHandler: ^(inline_response_200_5 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.TrafficApi()
var id = 56; // {{Integer}} unique id

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getVisitor(id, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getVisitorExample
    {
        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 TrafficApi();
            var id = 56;  // Integer | unique id

            try
            {
                // Return information for visitor with specified ID.
                inline_response_200_5 result = apiInstance.getVisitor(id);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling TrafficApi.getVisitor: " + 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\ApiTrafficApi();
$id = 56; // Integer | unique id

try {
    $result = $api_instance->getVisitor($id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling TrafficApi->getVisitor: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::TrafficApi;

# 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::TrafficApi->new();
my $id = 56; # Integer | unique id

eval { 
    my $result = $api_instance->getVisitor(id => $id);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling TrafficApi->getVisitor: $@\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.TrafficApi()
id = 56 # Integer | unique id

try: 
    # Return information for visitor with specified ID.
    api_response = api_instance.get_visitor(id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling TrafficApi->getVisitor: %s\n" % e)

Parameters

Path parameters
Name Description
id*
Integer
unique id
Required

Responses

Status: 200 - Available results returned.

Status: 204 - No result.

Status: 400 - Malformed request.

Status: 401 - Unauthorized.

Status: 403 - Forbidden.

Status: 500 - Internal Errors.


TrafficSources

getTopCampaigns

Top campaigns metrics.


/stats/campaigns/top

Usage and SDK Samples

curl -X GET "https://api.afsanalytics.com/v1//stats/campaigns/top?start_date=&end_date=&offset=&limit="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.TrafficSourcesApi;

import java.io.File;
import java.util.*;

public class TrafficSourcesApiExample {

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

        TrafficSourcesApi apiInstance = new TrafficSourcesApi();
        date startDate = ; // date | Period start date.
        date endDate = ; // date | Period end date.
        Integer offset = 56; // Integer | position of the first record to be returned.
        Integer limit = 56; // Integer | max number of records to be returned.
        try {
            inline_response_200_12 result = apiInstance.getTopCampaigns(startDate, endDate, offset, limit);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling TrafficSourcesApi#getTopCampaigns");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.TrafficSourcesApi;

public class TrafficSourcesApiExample {

    public static void main(String[] args) {
        TrafficSourcesApi apiInstance = new TrafficSourcesApi();
        date startDate = ; // date | Period start date.
        date endDate = ; // date | Period end date.
        Integer offset = 56; // Integer | position of the first record to be returned.
        Integer limit = 56; // Integer | max number of records to be returned.
        try {
            inline_response_200_12 result = apiInstance.getTopCampaigns(startDate, endDate, offset, limit);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling TrafficSourcesApi#getTopCampaigns");
            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"];
date *startDate = ; // Period start date.
date *endDate = ; // Period end date.
Integer *offset = 56; // position of the first record to be returned. (optional)
Integer *limit = 56; // max number of records to be returned. (optional)

TrafficSourcesApi *apiInstance = [[TrafficSourcesApi alloc] init];

// Top campaigns metrics.
[apiInstance getTopCampaignsWith:startDate
    endDate:endDate
    offset:offset
    limit:limit
              completionHandler: ^(inline_response_200_12 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.TrafficSourcesApi()
var startDate = ; // {{date}} Period start date.
var endDate = ; // {{date}} Period end date.
var opts = { 
  'offset': 56, // {{Integer}} position of the first record to be returned.
  'limit': 56 // {{Integer}} max number of records to be returned.
};
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getTopCampaigns(startDate, endDate, opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getTopCampaignsExample
    {
        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 TrafficSourcesApi();
            var startDate = new date(); // date | Period start date.
            var endDate = new date(); // date | Period end date.
            var offset = 56;  // Integer | position of the first record to be returned. (optional) 
            var limit = 56;  // Integer | max number of records to be returned. (optional) 

            try
            {
                // Top campaigns metrics.
                inline_response_200_12 result = apiInstance.getTopCampaigns(startDate, endDate, offset, limit);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling TrafficSourcesApi.getTopCampaigns: " + 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\ApiTrafficSourcesApi();
$startDate = ; // date | Period start date.
$endDate = ; // date | Period end date.
$offset = 56; // Integer | position of the first record to be returned.
$limit = 56; // Integer | max number of records to be returned.

try {
    $result = $api_instance->getTopCampaigns($startDate, $endDate, $offset, $limit);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling TrafficSourcesApi->getTopCampaigns: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::TrafficSourcesApi;

# 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::TrafficSourcesApi->new();
my $startDate = ; # date | Period start date.
my $endDate = ; # date | Period end date.
my $offset = 56; # Integer | position of the first record to be returned.
my $limit = 56; # Integer | max number of records to be returned.

eval { 
    my $result = $api_instance->getTopCampaigns(startDate => $startDate, endDate => $endDate, offset => $offset, limit => $limit);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling TrafficSourcesApi->getTopCampaigns: $@\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.TrafficSourcesApi()
startDate =  # date | Period start date.
endDate =  # date | Period end date.
offset = 56 # Integer | position of the first record to be returned. (optional)
limit = 56 # Integer | max number of records to be returned. (optional)

try: 
    # Top campaigns metrics.
    api_response = api_instance.get_top_campaigns(startDate, endDate, offset=offset, limit=limit)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling TrafficSourcesApi->getTopCampaigns: %s\n" % e)

Parameters

Query parameters
Name Description
start_date*
date
Period start date.
Required
end_date*
date
Period end date.
Required
offset
Integer
position of the first record to be returned.
limit
Integer
max number of records to be returned.

Responses

Status: 200 - Available results returned.

Status: 204 - No result.

Status: 400 - Malformed request.

Status: 401 - Unauthorized.

Status: 403 - Forbidden.

Status: 500 - Internal Errors.


getTopKeywords

Return metrics for top search engine keywords.


/stats/keywords/top

Usage and SDK Samples

curl -X GET "https://api.afsanalytics.com/v1//stats/keywords/top?start_date=&end_date=&offset=&limit="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.TrafficSourcesApi;

import java.io.File;
import java.util.*;

public class TrafficSourcesApiExample {

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

        TrafficSourcesApi apiInstance = new TrafficSourcesApi();
        date startDate = ; // date | Period start date.
        date endDate = ; // date | Period end date.
        Integer offset = 56; // Integer | position of the first record to be returned.
        Integer limit = 56; // Integer | max number of records to be returned.
        try {
            inline_response_200_10 result = apiInstance.getTopKeywords(startDate, endDate, offset, limit);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling TrafficSourcesApi#getTopKeywords");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.TrafficSourcesApi;

public class TrafficSourcesApiExample {

    public static void main(String[] args) {
        TrafficSourcesApi apiInstance = new TrafficSourcesApi();
        date startDate = ; // date | Period start date.
        date endDate = ; // date | Period end date.
        Integer offset = 56; // Integer | position of the first record to be returned.
        Integer limit = 56; // Integer | max number of records to be returned.
        try {
            inline_response_200_10 result = apiInstance.getTopKeywords(startDate, endDate, offset, limit);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling TrafficSourcesApi#getTopKeywords");
            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"];
date *startDate = ; // Period start date.
date *endDate = ; // Period end date.
Integer *offset = 56; // position of the first record to be returned. (optional)
Integer *limit = 56; // max number of records to be returned. (optional)

TrafficSourcesApi *apiInstance = [[TrafficSourcesApi alloc] init];

// Return metrics for top search engine keywords.
[apiInstance getTopKeywordsWith:startDate
    endDate:endDate
    offset:offset
    limit:limit
              completionHandler: ^(inline_response_200_10 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.TrafficSourcesApi()
var startDate = ; // {{date}} Period start date.
var endDate = ; // {{date}} Period end date.
var opts = { 
  'offset': 56, // {{Integer}} position of the first record to be returned.
  'limit': 56 // {{Integer}} max number of records to be returned.
};
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getTopKeywords(startDate, endDate, opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getTopKeywordsExample
    {
        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 TrafficSourcesApi();
            var startDate = new date(); // date | Period start date.
            var endDate = new date(); // date | Period end date.
            var offset = 56;  // Integer | position of the first record to be returned. (optional) 
            var limit = 56;  // Integer | max number of records to be returned. (optional) 

            try
            {
                // Return metrics for top search engine keywords.
                inline_response_200_10 result = apiInstance.getTopKeywords(startDate, endDate, offset, limit);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling TrafficSourcesApi.getTopKeywords: " + 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\ApiTrafficSourcesApi();
$startDate = ; // date | Period start date.
$endDate = ; // date | Period end date.
$offset = 56; // Integer | position of the first record to be returned.
$limit = 56; // Integer | max number of records to be returned.

try {
    $result = $api_instance->getTopKeywords($startDate, $endDate, $offset, $limit);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling TrafficSourcesApi->getTopKeywords: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::TrafficSourcesApi;

# 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::TrafficSourcesApi->new();
my $startDate = ; # date | Period start date.
my $endDate = ; # date | Period end date.
my $offset = 56; # Integer | position of the first record to be returned.
my $limit = 56; # Integer | max number of records to be returned.

eval { 
    my $result = $api_instance->getTopKeywords(startDate => $startDate, endDate => $endDate, offset => $offset, limit => $limit);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling TrafficSourcesApi->getTopKeywords: $@\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.TrafficSourcesApi()
startDate =  # date | Period start date.
endDate =  # date | Period end date.
offset = 56 # Integer | position of the first record to be returned. (optional)
limit = 56 # Integer | max number of records to be returned. (optional)

try: 
    # Return metrics for top search engine keywords.
    api_response = api_instance.get_top_keywords(startDate, endDate, offset=offset, limit=limit)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling TrafficSourcesApi->getTopKeywords: %s\n" % e)

Parameters

Query parameters
Name Description
start_date*
date
Period start date.
Required
end_date*
date
Period end date.
Required
offset
Integer
position of the first record to be returned.
limit
Integer
max number of records to be returned.

Responses

Status: 200 - Available results returned.

Status: 204 - No result.

Status: 400 - Malformed request.

Status: 401 - Unauthorized.

Status: 403 - Forbidden.

Status: 500 - Internal Errors.


getTopReferrers

Return metrics for top referrers.


/stats/referrers/top

Usage and SDK Samples

curl -X GET "https://api.afsanalytics.com/v1//stats/referrers/top?start_date=&end_date=&offset=&limit="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.TrafficSourcesApi;

import java.io.File;
import java.util.*;

public class TrafficSourcesApiExample {

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

        TrafficSourcesApi apiInstance = new TrafficSourcesApi();
        date startDate = ; // date | Period start date.
        date endDate = ; // date | Period end date.
        Integer offset = 56; // Integer | position of the first record to be returned.
        Integer limit = 56; // Integer | max number of records to be returned.
        try {
            inline_response_200_9 result = apiInstance.getTopReferrers(startDate, endDate, offset, limit);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling TrafficSourcesApi#getTopReferrers");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.TrafficSourcesApi;

public class TrafficSourcesApiExample {

    public static void main(String[] args) {
        TrafficSourcesApi apiInstance = new TrafficSourcesApi();
        date startDate = ; // date | Period start date.
        date endDate = ; // date | Period end date.
        Integer offset = 56; // Integer | position of the first record to be returned.
        Integer limit = 56; // Integer | max number of records to be returned.
        try {
            inline_response_200_9 result = apiInstance.getTopReferrers(startDate, endDate, offset, limit);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling TrafficSourcesApi#getTopReferrers");
            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"];
date *startDate = ; // Period start date.
date *endDate = ; // Period end date.
Integer *offset = 56; // position of the first record to be returned. (optional)
Integer *limit = 56; // max number of records to be returned. (optional)

TrafficSourcesApi *apiInstance = [[TrafficSourcesApi alloc] init];

// Return metrics for top referrers.
[apiInstance getTopReferrersWith:startDate
    endDate:endDate
    offset:offset
    limit:limit
              completionHandler: ^(inline_response_200_9 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.TrafficSourcesApi()
var startDate = ; // {{date}} Period start date.
var endDate = ; // {{date}} Period end date.
var opts = { 
  'offset': 56, // {{Integer}} position of the first record to be returned.
  'limit': 56 // {{Integer}} max number of records to be returned.
};
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getTopReferrers(startDate, endDate, opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getTopReferrersExample
    {
        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 TrafficSourcesApi();
            var startDate = new date(); // date | Period start date.
            var endDate = new date(); // date | Period end date.
            var offset = 56;  // Integer | position of the first record to be returned. (optional) 
            var limit = 56;  // Integer | max number of records to be returned. (optional) 

            try
            {
                // Return metrics for top referrers.
                inline_response_200_9 result = apiInstance.getTopReferrers(startDate, endDate, offset, limit);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling TrafficSourcesApi.getTopReferrers: " + 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\ApiTrafficSourcesApi();
$startDate = ; // date | Period start date.
$endDate = ; // date | Period end date.
$offset = 56; // Integer | position of the first record to be returned.
$limit = 56; // Integer | max number of records to be returned.

try {
    $result = $api_instance->getTopReferrers($startDate, $endDate, $offset, $limit);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling TrafficSourcesApi->getTopReferrers: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::TrafficSourcesApi;

# 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::TrafficSourcesApi->new();
my $startDate = ; # date | Period start date.
my $endDate = ; # date | Period end date.
my $offset = 56; # Integer | position of the first record to be returned.
my $limit = 56; # Integer | max number of records to be returned.

eval { 
    my $result = $api_instance->getTopReferrers(startDate => $startDate, endDate => $endDate, offset => $offset, limit => $limit);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling TrafficSourcesApi->getTopReferrers: $@\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.TrafficSourcesApi()
startDate =  # date | Period start date.
endDate =  # date | Period end date.
offset = 56 # Integer | position of the first record to be returned. (optional)
limit = 56 # Integer | max number of records to be returned. (optional)

try: 
    # Return metrics for top referrers.
    api_response = api_instance.get_top_referrers(startDate, endDate, offset=offset, limit=limit)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling TrafficSourcesApi->getTopReferrers: %s\n" % e)

Parameters

Query parameters
Name Description
start_date*
date
Period start date.
Required
end_date*
date
Period end date.
Required
offset
Integer
position of the first record to be returned.
limit
Integer
max number of records to be returned.

Responses

Status: 200 - Available results returned.

Status: 204 - No result.

Status: 400 - Malformed request.

Status: 401 - Unauthorized.

Status: 403 - Forbidden.

Status: 500 - Internal Errors.