All URIs are relative to https://api.voucherify.io
Method | HTTP request | Description |
---|---|---|
get_location | GET /v1/locations/{locationId} | Get Location |
list_locations | GET /v1/locations | List Locations |
LocationsGetResponseBody get_location(location_id)
Get Location
Returns a location object.
- Api Key Authentication (X-App-Id):
- Api Key Authentication (X-App-Token):
import voucherify
from voucherify.models.locations_get_response_body import LocationsGetResponseBody
from voucherify.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.voucherify.io
# See configuration.py for a list of all supported configuration parameters.
configuration = voucherify.Configuration(
host = "https://api.voucherify.io"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: X-App-Id
configuration.api_key['X-App-Id'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-App-Id'] = 'Bearer'
# Configure API key authorization: X-App-Token
configuration.api_key['X-App-Token'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-App-Token'] = 'Bearer'
# Enter a context with an instance of the API client
with voucherify.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = voucherify.LocationsApi(api_client)
location_id = 'location_id_example' # str | The unique location ID.
try:
# Get Location
api_response = api_instance.get_location(location_id)
print("The response of LocationsApi->get_location:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling LocationsApi->get_location: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
location_id | str | The unique location ID. |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
2XX | Returns a location object. | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
LocationsListResponseBody list_locations(limit=limit, order=order, filters=filters, end_date=end_date)
List Locations
Returns a list of your locations.
- Api Key Authentication (X-App-Id):
- Api Key Authentication (X-App-Token):
import voucherify
from voucherify.models.locations_list_response_body import LocationsListResponseBody
from voucherify.models.parameter_filters_list_locations import ParameterFiltersListLocations
from voucherify.models.parameter_order_list_locations import ParameterOrderListLocations
from voucherify.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.voucherify.io
# See configuration.py for a list of all supported configuration parameters.
configuration = voucherify.Configuration(
host = "https://api.voucherify.io"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: X-App-Id
configuration.api_key['X-App-Id'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-App-Id'] = 'Bearer'
# Configure API key authorization: X-App-Token
configuration.api_key['X-App-Token'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-App-Token'] = 'Bearer'
# Enter a context with an instance of the API client
with voucherify.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = voucherify.LocationsApi(api_client)
limit = 56 # int | Limits the number of objects to be returned. The limit can range between 1 and 100 items. If no limit is set, it returns 10 items. (optional)
order = voucherify.ParameterOrderListLocations() # ParameterOrderListLocations | Sorts the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order. (optional)
filters = voucherify.ParameterFiltersListLocations() # ParameterFiltersListLocations | Filter the locations using one of the available filters. (optional)
end_date = '2013-10-20T19:20:30+01:00' # datetime | A filter on the list based on the end date. This will filter out all locations whose end date falls before the specified date and time. A date value must be presented in the ISO 8601 format (2016-11-16T14:14:31Z or 2016-11-16). (optional)
try:
# List Locations
api_response = api_instance.list_locations(limit=limit, order=order, filters=filters, end_date=end_date)
print("The response of LocationsApi->list_locations:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling LocationsApi->list_locations: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
limit | int | Limits the number of objects to be returned. The limit can range between 1 and 100 items. If no limit is set, it returns 10 items. | [optional] |
order | ParameterOrderListLocations | Sorts the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order. | [optional] |
filters | ParameterFiltersListLocations | Filter the locations using one of the available filters. | [optional] |
end_date | datetime | A filter on the list based on the end date. This will filter out all locations whose end date falls before the specified date and time. A date value must be presented in the ISO 8601 format (2016-11-16T14:14:31Z or 2016-11-16). | [optional] |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
2XX | Returns a dictionary that contains an array of locations. Each entry in the array is a separate location object. If no more locations are available, the resulting array will be empty. The result can be narrowed down according to specified (or default) filters. | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]