Skip to content

Latest commit

 

History

History
264 lines (199 loc) · 7.97 KB

LocationsApi.md

File metadata and controls

264 lines (199 loc) · 7.97 KB

com.knetikcloud.Api.LocationsApi

All URIs are relative to https://jsapi-integration.us-east-1.elasticbeanstalk.com

Method HTTP request Description
GetCountries GET /location/countries Get a list of countries
GetCountryByGeoLocation GET /location/geolocation/country Get the iso3 code of your country
GetCountryStates GET /location/countries/{country_code_iso3}/states Get a list of a country's states
GetCurrencyByGeoLocation GET /location/geolocation/currency Get the currency information of your country

GetCountries

List GetCountries ()

Get a list of countries

Permissions Needed: ANY

Example

using System;
using System.Diagnostics;
using com.knetikcloud.Api;
using com.knetikcloud.Client;
using com.knetikcloud.Model;

namespace Example
{
    public class GetCountriesExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: oauth2_client_credentials_grant
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
            // Configure OAuth2 access token for authorization: oauth2_password_grant
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            var apiInstance = new LocationsApi();

            try
            {
                // Get a list of countries
                List<CountryResource> result = apiInstance.GetCountries();
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling LocationsApi.GetCountries: " + e.Message );
            }
        }
    }
}

Parameters

This endpoint does not need any parameter.

Return type

List

Authorization

oauth2_client_credentials_grant, oauth2_password_grant

HTTP request headers

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

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

GetCountryByGeoLocation

string GetCountryByGeoLocation ()

Get the iso3 code of your country

Determined by geo ip location.

Permissions Needed: ANY

Example

using System;
using System.Diagnostics;
using com.knetikcloud.Api;
using com.knetikcloud.Client;
using com.knetikcloud.Model;

namespace Example
{
    public class GetCountryByGeoLocationExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: oauth2_client_credentials_grant
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
            // Configure OAuth2 access token for authorization: oauth2_password_grant
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            var apiInstance = new LocationsApi();

            try
            {
                // Get the iso3 code of your country
                string result = apiInstance.GetCountryByGeoLocation();
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling LocationsApi.GetCountryByGeoLocation: " + e.Message );
            }
        }
    }
}

Parameters

This endpoint does not need any parameter.

Return type

string

Authorization

oauth2_client_credentials_grant, oauth2_password_grant

HTTP request headers

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

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

GetCountryStates

List GetCountryStates (string countryCodeIso3)

Get a list of a country's states

Permissions Needed: ANY

Example

using System;
using System.Diagnostics;
using com.knetikcloud.Api;
using com.knetikcloud.Client;
using com.knetikcloud.Model;

namespace Example
{
    public class GetCountryStatesExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: oauth2_client_credentials_grant
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
            // Configure OAuth2 access token for authorization: oauth2_password_grant
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            var apiInstance = new LocationsApi();
            var countryCodeIso3 = countryCodeIso3_example;  // string | The iso3 code of the country

            try
            {
                // Get a list of a country's states
                List<StateResource> result = apiInstance.GetCountryStates(countryCodeIso3);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling LocationsApi.GetCountryStates: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
countryCodeIso3 string The iso3 code of the country

Return type

List

Authorization

oauth2_client_credentials_grant, oauth2_password_grant

HTTP request headers

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

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

GetCurrencyByGeoLocation

CurrencyResource GetCurrencyByGeoLocation ()

Get the currency information of your country

Determined by geo ip location, currency to country mapping and a fallback setting.

Permissions Needed: ANY

Example

using System;
using System.Diagnostics;
using com.knetikcloud.Api;
using com.knetikcloud.Client;
using com.knetikcloud.Model;

namespace Example
{
    public class GetCurrencyByGeoLocationExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: oauth2_client_credentials_grant
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
            // Configure OAuth2 access token for authorization: oauth2_password_grant
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            var apiInstance = new LocationsApi();

            try
            {
                // Get the currency information of your country
                CurrencyResource result = apiInstance.GetCurrencyByGeoLocation();
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling LocationsApi.GetCurrencyByGeoLocation: " + e.Message );
            }
        }
    }
}

Parameters

This endpoint does not need any parameter.

Return type

CurrencyResource

Authorization

oauth2_client_credentials_grant, oauth2_password_grant

HTTP request headers

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

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