-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat: Added events and track identify api calls
- Loading branch information
1 parent
0fe25aa
commit 810486b
Showing
33 changed files
with
2,696 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# sendx.CustomEventRequest | ||
|
||
## Properties | ||
|
||
Name | Type | Description | Notes | ||
------------ | ------------- | ------------- | ------------- | ||
**name** | **String** | Name of the custom event (e.g., 'abandoned_cart'). | | ||
**identifier** | **String** | Unique identifier for the contact (e.g., contact's email). | | ||
**data** | **{String: String}** | Map of property-value pairs associated with the event, where both key and value are strings. | | ||
**time** | **Number** | Unix timestamp of when the event occurred. | | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
# sendx.EventApi | ||
|
||
All URIs are relative to *https://api.sendx.io/api/v1/rest* | ||
|
||
Method | HTTP request | Description | ||
------------- | ------------- | ------------- | ||
[**createRevenueEvent**](EventApi.md#createRevenueEvent) | **POST** /events/revenue | Record a revenue event for a specific contact | ||
[**pushCustomEvent**](EventApi.md#pushCustomEvent) | **POST** /events/custom | Push a custom event associated with a contact | ||
|
||
|
||
|
||
## createRevenueEvent | ||
|
||
> EventResponse createRevenueEvent(revenueEventRequest) | ||
Record a revenue event for a specific contact | ||
|
||
Records a revenue event, which can be attributed to campaigns, drips, workflows, or other sources of user interaction. | ||
|
||
### Example | ||
|
||
```javascript | ||
import sendx from 'sendx-javascript-sdk'; | ||
let defaultClient = sendx.ApiClient.instance; | ||
// Configure API key authorization: apiKeyAuth | ||
let apiKeyAuth = defaultClient.authentications['apiKeyAuth']; | ||
apiKeyAuth.apiKey = 'YOUR API KEY'; | ||
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) | ||
//apiKeyAuth.apiKeyPrefix = 'Token'; | ||
|
||
let apiInstance = new sendx.EventApi(); | ||
let revenueEventRequest = new sendx.RevenueEventRequest(); // RevenueEventRequest | | ||
apiInstance.createRevenueEvent(revenueEventRequest).then((data) => { | ||
console.log('API called successfully. Returned data: ' + data); | ||
}, (error) => { | ||
console.error(error); | ||
}); | ||
|
||
``` | ||
|
||
### Parameters | ||
|
||
|
||
Name | Type | Description | Notes | ||
------------- | ------------- | ------------- | ------------- | ||
**revenueEventRequest** | [**RevenueEventRequest**](RevenueEventRequest.md)| | | ||
|
||
### Return type | ||
|
||
[**EventResponse**](EventResponse.md) | ||
|
||
### Authorization | ||
|
||
[apiKeyAuth](../README.md#apiKeyAuth) | ||
|
||
### HTTP request headers | ||
|
||
- **Content-Type**: application/json | ||
- **Accept**: application/json | ||
|
||
|
||
## pushCustomEvent | ||
|
||
> EventResponse pushCustomEvent(customEventRequest) | ||
Push a custom event associated with a contact | ||
|
||
Pushes a custom event with properties and values for a specified contact. | ||
|
||
### Example | ||
|
||
```javascript | ||
import sendx from 'sendx-javascript-sdk'; | ||
let defaultClient = sendx.ApiClient.instance; | ||
// Configure API key authorization: apiKeyAuth | ||
let apiKeyAuth = defaultClient.authentications['apiKeyAuth']; | ||
apiKeyAuth.apiKey = 'YOUR API KEY'; | ||
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) | ||
//apiKeyAuth.apiKeyPrefix = 'Token'; | ||
|
||
let apiInstance = new sendx.EventApi(); | ||
let customEventRequest = new sendx.CustomEventRequest(); // CustomEventRequest | | ||
apiInstance.pushCustomEvent(customEventRequest).then((data) => { | ||
console.log('API called successfully. Returned data: ' + data); | ||
}, (error) => { | ||
console.error(error); | ||
}); | ||
|
||
``` | ||
|
||
### Parameters | ||
|
||
|
||
Name | Type | Description | Notes | ||
------------- | ------------- | ------------- | ------------- | ||
**customEventRequest** | [**CustomEventRequest**](CustomEventRequest.md)| | | ||
|
||
### Return type | ||
|
||
[**EventResponse**](EventResponse.md) | ||
|
||
### Authorization | ||
|
||
[apiKeyAuth](../README.md#apiKeyAuth) | ||
|
||
### HTTP request headers | ||
|
||
- **Content-Type**: application/json | ||
- **Accept**: application/json | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# sendx.EventResponse | ||
|
||
## Properties | ||
|
||
Name | Type | Description | Notes | ||
------------ | ------------- | ------------- | ------------- | ||
**eventId** | **String** | Unique identifier for the created event. | [optional] | ||
**status** | **String** | Status of the event creation (e.g., 'success'). | [optional] | ||
**message** | **String** | Additional message about the event creation. | [optional] | ||
|
||
|
Oops, something went wrong.