All URIs are relative to https://api.voucherify.io
| Method | HTTP request | Description |
|---|---|---|
| GetLocation | GET /v1/locations/{locationId} | Get Location |
| ListLocations | GET /v1/locations | List Locations |
LocationsGetResponseBody GetLocation (string locationId)
Get Location
Returns a location object.
using System.Collections.Generic;
using System.Diagnostics;
using Voucherify.Api;
using Voucherify.Client;
using Voucherify.Model;
namespace Example
{
public class GetLocationExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.voucherify.io";
// Configure API key authorization: X-App-Id
config.AddApiKey("X-App-Id", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("X-App-Id", "Bearer");
// Configure API key authorization: X-App-Token
config.AddApiKey("X-App-Token", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("X-App-Token", "Bearer");
// Configure OAuth2 access token for authorization: X-Voucherify-OAuth
config.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new LocationsApi(config);
var locationId = "locationId_example"; // string | The unique location ID.
try
{
// Get Location
LocationsGetResponseBody result = apiInstance.GetLocation(locationId);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling LocationsApi.GetLocation: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}This returns an ApiResponse object which contains the response data, status code and headers.
try
{
// Get Location
ApiResponse<LocationsGetResponseBody> response = apiInstance.GetLocationWithHttpInfo(locationId);
Debug.Write("Status Code: " + response.StatusCode);
Debug.Write("Response Headers: " + response.Headers);
Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
Debug.Print("Exception when calling LocationsApi.GetLocationWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}| Name | Type | Description | Notes |
|---|---|---|---|
| locationId | string | The unique location ID. |
X-App-Id, X-App-Token, X-Voucherify-OAuth
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Returns a location object. | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
LocationsListResponseBody ListLocations (int? limit = null, ParameterOrderListLocations? order = null, ParameterFiltersListLocations filters = null, DateTimeOffset? endDate = null)
List Locations
Returns a list of your locations.
using System.Collections.Generic;
using System.Diagnostics;
using Voucherify.Api;
using Voucherify.Client;
using Voucherify.Model;
namespace Example
{
public class ListLocationsExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.voucherify.io";
// Configure API key authorization: X-App-Id
config.AddApiKey("X-App-Id", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("X-App-Id", "Bearer");
// Configure API key authorization: X-App-Token
config.AddApiKey("X-App-Token", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("X-App-Token", "Bearer");
// Configure OAuth2 access token for authorization: X-Voucherify-OAuth
config.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new LocationsApi(config);
var 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)
var order = (ParameterOrderListLocations) "created_at"; // ParameterOrderListLocations? | Sorts the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order. (optional)
var filters = new ParameterFiltersListLocations(); // ParameterFiltersListLocations | Filter the locations using one of the available filters. (optional)
var endDate = DateTimeOffset.Parse("2013-10-20T19:20:30+01:00"); // DateTimeOffset? | 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
LocationsListResponseBody result = apiInstance.ListLocations(limit, order, filters, endDate);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling LocationsApi.ListLocations: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}This returns an ApiResponse object which contains the response data, status code and headers.
try
{
// List Locations
ApiResponse<LocationsListResponseBody> response = apiInstance.ListLocationsWithHttpInfo(limit, order, filters, endDate);
Debug.Write("Status Code: " + response.StatusCode);
Debug.Write("Response Headers: " + response.Headers);
Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
Debug.Print("Exception when calling LocationsApi.ListLocationsWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}| 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] |
| endDate | DateTimeOffset? | 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] |
X-App-Id, X-App-Token, X-Voucherify-OAuth
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | 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]