All URIs are relative to https://api.voucherify.io
Method | HTTP request | Description |
---|---|---|
trackCustomEvent | POST /v1/events | Track Custom Event |
EventsCreateResponseBody trackCustomEvent(eventsCreateRequestBody)
Track Custom Event
To track a custom event, you create an event object. The event object must be linked to the customer who performs the action. If a customer doesn't exist in Voucherify, the customer will be created.
// Import classes:
import voucherify.client.ApiClient;
import voucherify.client.ApiException;
import voucherify.client.Configuration;
import voucherify.client.auth.*;
import voucherify.client.models.*;
import voucherify.client.api.EventsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.voucherify.io");
// Configure API key authorization: X-App-Id
ApiKeyAuth X-App-Id = (ApiKeyAuth) defaultClient.getAuthentication("X-App-Id");
X-App-Id.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//X-App-Id.setApiKeyPrefix("Token");
// Configure API key authorization: X-App-Token
ApiKeyAuth X-App-Token = (ApiKeyAuth) defaultClient.getAuthentication("X-App-Token");
X-App-Token.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//X-App-Token.setApiKeyPrefix("Token");
EventsApi apiInstance = new EventsApi(defaultClient);
EventsCreateRequestBody eventsCreateRequestBody = new EventsCreateRequestBody(); // EventsCreateRequestBody | Specify the details of the custom event.
try {
EventsCreateResponseBody result = apiInstance.trackCustomEvent(eventsCreateRequestBody);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling EventsApi#trackCustomEvent");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
eventsCreateRequestBody | EventsCreateRequestBody | Specify the details of the custom event. | [optional] |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Returns the event type if the event was received by the application. | - |