-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #35 from getbrevo/add-events-api
Add new Events API endpoint
- Loading branch information
Showing
9 changed files
with
1,622 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# Brevo\Client\EventsApi | ||
|
||
All URIs are relative to *https://api.brevo.com/v3* | ||
|
||
Method | HTTP request | Description | ||
------------- | ------------- | ------------- | ||
[**createEvent**](EventsApi.md#createEvent) | **POST** /events | Create an event | ||
|
||
|
||
# **createEvent** | ||
> createEvent($event) | ||
Create an event | ||
|
||
Create an event to track a contact's interaction. | ||
|
||
### Example | ||
```php | ||
<?php | ||
require_once(__DIR__ . '/vendor/autoload.php'); | ||
|
||
// Configure API key authorization: api-key | ||
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); | ||
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed | ||
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); | ||
// Configure API key authorization: partner-key | ||
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY'); | ||
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed | ||
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer'); | ||
|
||
$apiInstance = new Brevo\Client\Api\EventsApi( | ||
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. | ||
// This is optional, `GuzzleHttp\Client` will be used as default. | ||
new GuzzleHttp\Client(), | ||
$config | ||
); | ||
$event = new \Brevo\Client\Model\Event(); // \Brevo\Client\Model\Event | | ||
|
||
try { | ||
$apiInstance->createEvent($event); | ||
} catch (Exception $e) { | ||
echo 'Exception when calling EventsApi->createEvent: ', $e->getMessage(), PHP_EOL; | ||
} | ||
?> | ||
``` | ||
|
||
### Parameters | ||
|
||
Name | Type | Description | Notes | ||
------------- | ------------- | ------------- | ------------- | ||
**event** | [**\Brevo\Client\Model\Event**](../Model/Event.md)| | | ||
|
||
### Return type | ||
|
||
void (empty response body) | ||
|
||
### Authorization | ||
|
||
[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key) | ||
|
||
### HTTP request headers | ||
|
||
- **Content-Type**: application/json | ||
- **Accept**: application/json | ||
|
||
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) | ||
|
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,14 @@ | ||
# Event | ||
|
||
## Properties | ||
Name | Type | Description | Notes | ||
------------ | ------------- | ------------- | ------------- | ||
**eventName** | **string** | The name of the event that occurred. This is how you will find your event in Brevo. Limited to 255 characters, alphanumerical characters and - _ only. | | ||
**eventDate** | **string** | Timestamp of when the event occurred (e.g. \"2024-01-24T17:39:57+01:00\"). If no value is passed, the timestamp of the event creation is used. | [optional] | ||
**identifiers** | [**\Brevo\Client\Model\EventIdentifiers**](EventIdentifiers.md) | | | ||
**contactProperties** | **object** | Properties defining the state of the contact associated to this event. Useful to update contact attributes defined in your contacts database while passing the event. For example: **\"FIRSTNAME\": \"Jane\" , \"AGE\": 37** | [optional] | ||
**eventProperties** | **object** | Properties of the event. Top level properties and nested properties can be used to better segment contacts and personalise workflow conditions. The following field type are supported: string, number, boolean (true/false), date (Timestamp e.g. \"2024-01-24T17:39:57+01:00\"). Keys are limited to 255 characters, alphanumerical characters and - _ only. Size is limited to 50Kb. | [optional] | ||
|
||
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) | ||
|
||
|
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,14 @@ | ||
# EventIdentifiers | ||
|
||
## Properties | ||
Name | Type | Description | Notes | ||
------------ | ------------- | ------------- | ------------- | ||
**emailId** | **string** | Email Id associated with the event | [optional] | ||
**phoneId** | **string** | SMS associated with the event | [optional] | ||
**whatsappId** | **string** | whatsapp associated with the event | [optional] | ||
**landlineNumberId** | **string** | landline_number associated with the event | [optional] | ||
**extId** | **string** | ext_id associated with the event | [optional] | ||
|
||
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) | ||
|
||
|
Oops, something went wrong.