All URIs are relative to https://api.voucherify.io
| Method | HTTP request | Description |
|---|---|---|
| CreateReward | POST /v1/rewards | Create Reward |
| CreateRewardAssignment | POST /v1/rewards/{rewardId}/assignments | Create Reward Assignment |
| DeleteReward | DELETE /v1/rewards/{rewardId} | Delete Reward |
| DeleteRewardAssignment | DELETE /v1/rewards/{rewardId}/assignments/{assignmentId} | Delete Reward Assignment |
| GetReward | GET /v1/rewards/{rewardId} | Get Reward |
| GetRewardAssignment | GET /v1/rewards/{rewardId}/assignments/{assignmentId} | Get Reward Assignment |
| ListRewardAssignments | GET /v1/rewards/{rewardId}/assignments | List Reward Assignments |
| ListRewards | GET /v1/rewards | List Rewards |
| UpdateReward | PUT /v1/rewards/{rewardId} | Update Reward |
| UpdateRewardAssignment | PUT /v1/rewards/{rewardId}/assignments/{assignmentId} | Update Reward Assignment |
RewardsCreateResponseBody CreateReward (RewardsCreateRequestBody rewardsCreateRequestBody)
Create Reward
Create a new reward.
using System.Collections.Generic;
using System.Diagnostics;
using Voucherify.Api;
using Voucherify.Client;
using Voucherify.Model;
namespace Example
{
public class CreateRewardExample
{
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 RewardsApi(config);
var rewardsCreateRequestBody = new RewardsCreateRequestBody(); // RewardsCreateRequestBody | Define parameters of the new reward.
try
{
// Create Reward
RewardsCreateResponseBody result = apiInstance.CreateReward(rewardsCreateRequestBody);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling RewardsApi.CreateReward: " + 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
{
// Create Reward
ApiResponse<RewardsCreateResponseBody> response = apiInstance.CreateRewardWithHttpInfo(rewardsCreateRequestBody);
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 RewardsApi.CreateRewardWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}| Name | Type | Description | Notes |
|---|---|---|---|
| rewardsCreateRequestBody | RewardsCreateRequestBody | Define parameters of the new reward. |
X-App-Id, X-App-Token, X-Voucherify-OAuth
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Returns a reward object. | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
RewardsAssignmentsCreateResponseBody CreateRewardAssignment (string rewardId, RewardsAssignmentsCreateRequestBody rewardsAssignmentsCreateRequestBody)
Create Reward Assignment
Assigns a reward to a specified loyalty campaign.
using System.Collections.Generic;
using System.Diagnostics;
using Voucherify.Api;
using Voucherify.Client;
using Voucherify.Model;
namespace Example
{
public class CreateRewardAssignmentExample
{
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 RewardsApi(config);
var rewardId = "rewardId_example"; // string | A unique reward ID.
var rewardsAssignmentsCreateRequestBody = new RewardsAssignmentsCreateRequestBody(); // RewardsAssignmentsCreateRequestBody | Provide the campaign ID of the campaign to which the reward is to be assigned and define the cost of the reward in terms of loyalty points.
try
{
// Create Reward Assignment
RewardsAssignmentsCreateResponseBody result = apiInstance.CreateRewardAssignment(rewardId, rewardsAssignmentsCreateRequestBody);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling RewardsApi.CreateRewardAssignment: " + 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
{
// Create Reward Assignment
ApiResponse<RewardsAssignmentsCreateResponseBody> response = apiInstance.CreateRewardAssignmentWithHttpInfo(rewardId, rewardsAssignmentsCreateRequestBody);
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 RewardsApi.CreateRewardAssignmentWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}| Name | Type | Description | Notes |
|---|---|---|---|
| rewardId | string | A unique reward ID. | |
| rewardsAssignmentsCreateRequestBody | RewardsAssignmentsCreateRequestBody | Provide the campaign ID of the campaign to which the reward is to be assigned and define the cost of the reward in terms of loyalty points. |
RewardsAssignmentsCreateResponseBody
X-App-Id, X-App-Token, X-Voucherify-OAuth
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Returns a reward assignment object. | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
void DeleteReward (string rewardId)
Delete Reward
Delete a reward.
using System.Collections.Generic;
using System.Diagnostics;
using Voucherify.Api;
using Voucherify.Client;
using Voucherify.Model;
namespace Example
{
public class DeleteRewardExample
{
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 RewardsApi(config);
var rewardId = "rewardId_example"; // string | A unique reward ID.
try
{
// Delete Reward
apiInstance.DeleteReward(rewardId);
}
catch (ApiException e)
{
Debug.Print("Exception when calling RewardsApi.DeleteReward: " + 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
{
// Delete Reward
apiInstance.DeleteRewardWithHttpInfo(rewardId);
}
catch (ApiException e)
{
Debug.Print("Exception when calling RewardsApi.DeleteRewardWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}| Name | Type | Description | Notes |
|---|---|---|---|
| rewardId | string | A unique reward ID. |
void (empty response body)
X-App-Id, X-App-Token, X-Voucherify-OAuth
- Content-Type: Not defined
- Accept: Not defined
| Status code | Description | Response headers |
|---|---|---|
| 204 | Returns no content if deletion is successful. | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
void DeleteRewardAssignment (string rewardId, string assignmentId)
Delete Reward Assignment
This method deletes a reward assignment for a particular reward.
using System.Collections.Generic;
using System.Diagnostics;
using Voucherify.Api;
using Voucherify.Client;
using Voucherify.Model;
namespace Example
{
public class DeleteRewardAssignmentExample
{
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 RewardsApi(config);
var rewardId = "rewardId_example"; // string | A unique reward ID.
var assignmentId = "assignmentId_example"; // string | A unique reward assignment ID.
try
{
// Delete Reward Assignment
apiInstance.DeleteRewardAssignment(rewardId, assignmentId);
}
catch (ApiException e)
{
Debug.Print("Exception when calling RewardsApi.DeleteRewardAssignment: " + 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
{
// Delete Reward Assignment
apiInstance.DeleteRewardAssignmentWithHttpInfo(rewardId, assignmentId);
}
catch (ApiException e)
{
Debug.Print("Exception when calling RewardsApi.DeleteRewardAssignmentWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}| Name | Type | Description | Notes |
|---|---|---|---|
| rewardId | string | A unique reward ID. | |
| assignmentId | string | A unique reward assignment ID. |
void (empty response body)
X-App-Id, X-App-Token, X-Voucherify-OAuth
- Content-Type: Not defined
- Accept: Not defined
| Status code | Description | Response headers |
|---|---|---|
| 204 | Returns no content if deletion is successful. | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Reward GetReward (string rewardId)
Get Reward
Retrieve a reward by the reward ID.
using System.Collections.Generic;
using System.Diagnostics;
using Voucherify.Api;
using Voucherify.Client;
using Voucherify.Model;
namespace Example
{
public class GetRewardExample
{
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 RewardsApi(config);
var rewardId = "rewardId_example"; // string | A unique reward ID.
try
{
// Get Reward
Reward result = apiInstance.GetReward(rewardId);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling RewardsApi.GetReward: " + 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 Reward
ApiResponse<Reward> response = apiInstance.GetRewardWithHttpInfo(rewardId);
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 RewardsApi.GetRewardWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}| Name | Type | Description | Notes |
|---|---|---|---|
| rewardId | string | A unique reward 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 reward object if a valid identifier was provided. | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
RewardsAssignmentsGetResponseBody GetRewardAssignment (string rewardId, string assignmentId)
Get Reward Assignment
Retrieve a reward assignment.
using System.Collections.Generic;
using System.Diagnostics;
using Voucherify.Api;
using Voucherify.Client;
using Voucherify.Model;
namespace Example
{
public class GetRewardAssignmentExample
{
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 RewardsApi(config);
var rewardId = "rewardId_example"; // string | A unique reward ID.
var assignmentId = "assignmentId_example"; // string | A unique reward assignment ID.
try
{
// Get Reward Assignment
RewardsAssignmentsGetResponseBody result = apiInstance.GetRewardAssignment(rewardId, assignmentId);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling RewardsApi.GetRewardAssignment: " + 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 Reward Assignment
ApiResponse<RewardsAssignmentsGetResponseBody> response = apiInstance.GetRewardAssignmentWithHttpInfo(rewardId, assignmentId);
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 RewardsApi.GetRewardAssignmentWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}| Name | Type | Description | Notes |
|---|---|---|---|
| rewardId | string | A unique reward ID. | |
| assignmentId | string | A unique reward assignment ID. |
RewardsAssignmentsGetResponseBody
X-App-Id, X-App-Token, X-Voucherify-OAuth
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Returns a reward assignment object. | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
RewardsAssignmentsListResponseBody ListRewardAssignments (string rewardId, int? limit = null, int? page = null)
List Reward Assignments
Retrieve reward assignments by the reward ID.
using System.Collections.Generic;
using System.Diagnostics;
using Voucherify.Api;
using Voucherify.Client;
using Voucherify.Model;
namespace Example
{
public class ListRewardAssignmentsExample
{
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 RewardsApi(config);
var rewardId = "rewardId_example"; // string | A unique reward ID.
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 page = 56; // int? | Which page of results to return. The lowest value is 1. (optional)
try
{
// List Reward Assignments
RewardsAssignmentsListResponseBody result = apiInstance.ListRewardAssignments(rewardId, limit, page);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling RewardsApi.ListRewardAssignments: " + 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 Reward Assignments
ApiResponse<RewardsAssignmentsListResponseBody> response = apiInstance.ListRewardAssignmentsWithHttpInfo(rewardId, limit, page);
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 RewardsApi.ListRewardAssignmentsWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}| Name | Type | Description | Notes |
|---|---|---|---|
| rewardId | string | A unique reward ID. | |
| 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] |
| page | int? | Which page of results to return. The lowest value is 1. | [optional] |
RewardsAssignmentsListResponseBody
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 of reward assignment objects. Each object contains information regarding the resource to which the reward was assigned and the cost in loyalty points for the reward. | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
RewardsListResponseBody ListRewards (int? limit = null, int? page = null, string assignmentId = null)
List Rewards
Retrieve rewards.
using System.Collections.Generic;
using System.Diagnostics;
using Voucherify.Api;
using Voucherify.Client;
using Voucherify.Model;
namespace Example
{
public class ListRewardsExample
{
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 RewardsApi(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 page = 56; // int? | Which page of results to return. The lowest value is 1. (optional)
var assignmentId = "assignmentId_example"; // string | A unique reward assignment ID. Use this parameter to get the reward details in the context of an assignment ID. (optional)
try
{
// List Rewards
RewardsListResponseBody result = apiInstance.ListRewards(limit, page, assignmentId);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling RewardsApi.ListRewards: " + 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 Rewards
ApiResponse<RewardsListResponseBody> response = apiInstance.ListRewardsWithHttpInfo(limit, page, assignmentId);
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 RewardsApi.ListRewardsWithHttpInfo: " + 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] |
| page | int? | Which page of results to return. The lowest value is 1. | [optional] |
| assignmentId | string | A unique reward assignment ID. Use this parameter to get the reward details in the context of an assignment ID. | [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 of reward objects. | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
RewardsUpdateResponseBody UpdateReward (string rewardId, RewardsUpdateRequestBody rewardsUpdateRequestBody)
Update Reward
Update the details of a reward.
using System.Collections.Generic;
using System.Diagnostics;
using Voucherify.Api;
using Voucherify.Client;
using Voucherify.Model;
namespace Example
{
public class UpdateRewardExample
{
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 RewardsApi(config);
var rewardId = "rewardId_example"; // string | A unique reward ID.
var rewardsUpdateRequestBody = new RewardsUpdateRequestBody(); // RewardsUpdateRequestBody | Define the parameters to be updated for the reward.
try
{
// Update Reward
RewardsUpdateResponseBody result = apiInstance.UpdateReward(rewardId, rewardsUpdateRequestBody);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling RewardsApi.UpdateReward: " + 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
{
// Update Reward
ApiResponse<RewardsUpdateResponseBody> response = apiInstance.UpdateRewardWithHttpInfo(rewardId, rewardsUpdateRequestBody);
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 RewardsApi.UpdateRewardWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}| Name | Type | Description | Notes |
|---|---|---|---|
| rewardId | string | A unique reward ID. | |
| rewardsUpdateRequestBody | RewardsUpdateRequestBody | Define the parameters to be updated for the reward. |
X-App-Id, X-App-Token, X-Voucherify-OAuth
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Returns an updated reward object. | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
RewardsAssignmentsUpdateResponseBody UpdateRewardAssignment (string rewardId, string assignmentId, RewardsAssignmentsUpdateRequestBody rewardsAssignmentsUpdateRequestBody)
Update Reward Assignment
Update the number of points needed to successfully redeem the reward.
using System.Collections.Generic;
using System.Diagnostics;
using Voucherify.Api;
using Voucherify.Client;
using Voucherify.Model;
namespace Example
{
public class UpdateRewardAssignmentExample
{
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 RewardsApi(config);
var rewardId = "rewardId_example"; // string | A unique reward ID.
var assignmentId = "assignmentId_example"; // string | A unique reward assignment ID.
var rewardsAssignmentsUpdateRequestBody = new RewardsAssignmentsUpdateRequestBody(); // RewardsAssignmentsUpdateRequestBody | Define the number of points required to exchange for the reward.
try
{
// Update Reward Assignment
RewardsAssignmentsUpdateResponseBody result = apiInstance.UpdateRewardAssignment(rewardId, assignmentId, rewardsAssignmentsUpdateRequestBody);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling RewardsApi.UpdateRewardAssignment: " + 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
{
// Update Reward Assignment
ApiResponse<RewardsAssignmentsUpdateResponseBody> response = apiInstance.UpdateRewardAssignmentWithHttpInfo(rewardId, assignmentId, rewardsAssignmentsUpdateRequestBody);
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 RewardsApi.UpdateRewardAssignmentWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}| Name | Type | Description | Notes |
|---|---|---|---|
| rewardId | string | A unique reward ID. | |
| assignmentId | string | A unique reward assignment ID. | |
| rewardsAssignmentsUpdateRequestBody | RewardsAssignmentsUpdateRequestBody | Define the number of points required to exchange for the reward. |
RewardsAssignmentsUpdateResponseBody
X-App-Id, X-App-Token, X-Voucherify-OAuth
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Returns the updated reward assignment object. | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]