1751 lines
72 KiB
Markdown
1751 lines
72 KiB
Markdown
# Brevo\Client\ContactsApi
|
|
|
|
All URIs are relative to *https://api.brevo.com/v3*
|
|
|
|
Method | HTTP request | Description
|
|
------------- | ------------- | -------------
|
|
[**addContactToList**](ContactsApi.md#addContactToList) | **POST** /contacts/lists/{listId}/contacts/add | Add existing contacts to a list
|
|
[**createAttribute**](ContactsApi.md#createAttribute) | **POST** /contacts/attributes/{attributeCategory}/{attributeName} | Create contact attribute
|
|
[**createContact**](ContactsApi.md#createContact) | **POST** /contacts | Create a contact
|
|
[**createDoiContact**](ContactsApi.md#createDoiContact) | **POST** /contacts/doubleOptinConfirmation | Create Contact via DOI (Double-Opt-In) Flow
|
|
[**createFolder**](ContactsApi.md#createFolder) | **POST** /contacts/folders | Create a folder
|
|
[**createList**](ContactsApi.md#createList) | **POST** /contacts/lists | Create a list
|
|
[**deleteAttribute**](ContactsApi.md#deleteAttribute) | **DELETE** /contacts/attributes/{attributeCategory}/{attributeName} | Delete an attribute
|
|
[**deleteContact**](ContactsApi.md#deleteContact) | **DELETE** /contacts/{identifier} | Delete a contact
|
|
[**deleteFolder**](ContactsApi.md#deleteFolder) | **DELETE** /contacts/folders/{folderId} | Delete a folder (and all its lists)
|
|
[**deleteList**](ContactsApi.md#deleteList) | **DELETE** /contacts/lists/{listId} | Delete a list
|
|
[**getAttributes**](ContactsApi.md#getAttributes) | **GET** /contacts/attributes | List all attributes
|
|
[**getContactInfo**](ContactsApi.md#getContactInfo) | **GET** /contacts/{identifier} | Get a contact's details
|
|
[**getContactStats**](ContactsApi.md#getContactStats) | **GET** /contacts/{identifier}/campaignStats | Get email campaigns' statistics for a contact
|
|
[**getContacts**](ContactsApi.md#getContacts) | **GET** /contacts | Get all the contacts
|
|
[**getContactsFromList**](ContactsApi.md#getContactsFromList) | **GET** /contacts/lists/{listId}/contacts | Get contacts in a list
|
|
[**getFolder**](ContactsApi.md#getFolder) | **GET** /contacts/folders/{folderId} | Returns a folder's details
|
|
[**getFolderLists**](ContactsApi.md#getFolderLists) | **GET** /contacts/folders/{folderId}/lists | Get lists in a folder
|
|
[**getFolders**](ContactsApi.md#getFolders) | **GET** /contacts/folders | Get all folders
|
|
[**getList**](ContactsApi.md#getList) | **GET** /contacts/lists/{listId} | Get a list's details
|
|
[**getLists**](ContactsApi.md#getLists) | **GET** /contacts/lists | Get all the lists
|
|
[**getSegments**](ContactsApi.md#getSegments) | **GET** /contacts/segments | Get all the Segments
|
|
[**importContacts**](ContactsApi.md#importContacts) | **POST** /contacts/import | Import contacts
|
|
[**removeContactFromList**](ContactsApi.md#removeContactFromList) | **POST** /contacts/lists/{listId}/contacts/remove | Delete a contact from a list
|
|
[**requestContactExport**](ContactsApi.md#requestContactExport) | **POST** /contacts/export | Export contacts
|
|
[**updateAttribute**](ContactsApi.md#updateAttribute) | **PUT** /contacts/attributes/{attributeCategory}/{attributeName} | Update contact attribute
|
|
[**updateBatchContacts**](ContactsApi.md#updateBatchContacts) | **POST** /contacts/batch | Update multiple contacts
|
|
[**updateContact**](ContactsApi.md#updateContact) | **PUT** /contacts/{identifier} | Update a contact
|
|
[**updateFolder**](ContactsApi.md#updateFolder) | **PUT** /contacts/folders/{folderId} | Update a folder
|
|
[**updateList**](ContactsApi.md#updateList) | **PUT** /contacts/lists/{listId} | Update a list
|
|
|
|
|
|
# **addContactToList**
|
|
> \Brevo\Client\Model\PostContactInfo addContactToList($listId, $contactEmails)
|
|
|
|
Add existing contacts to a list
|
|
|
|
### 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\ContactsApi(
|
|
// 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
|
|
);
|
|
$listId = 789; // int | Id of the list
|
|
$contactEmails = new \Brevo\Client\Model\AddContactToList(); // \Brevo\Client\Model\AddContactToList | Emails addresses OR IDs of the contacts
|
|
|
|
try {
|
|
$result = $apiInstance->addContactToList($listId, $contactEmails);
|
|
print_r($result);
|
|
} catch (Exception $e) {
|
|
echo 'Exception when calling ContactsApi->addContactToList: ', $e->getMessage(), PHP_EOL;
|
|
}
|
|
?>
|
|
```
|
|
|
|
### Parameters
|
|
|
|
Name | Type | Description | Notes
|
|
------------- | ------------- | ------------- | -------------
|
|
**listId** | **int**| Id of the list |
|
|
**contactEmails** | [**\Brevo\Client\Model\AddContactToList**](../Model/AddContactToList.md)| Emails addresses OR IDs of the contacts |
|
|
|
|
### Return type
|
|
|
|
[**\Brevo\Client\Model\PostContactInfo**](../Model/PostContactInfo.md)
|
|
|
|
### 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)
|
|
|
|
# **createAttribute**
|
|
> createAttribute($attributeCategory, $attributeName, $createAttribute)
|
|
|
|
Create contact attribute
|
|
|
|
### 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\ContactsApi(
|
|
// 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
|
|
);
|
|
$attributeCategory = "attributeCategory_example"; // string | Category of the attribute
|
|
$attributeName = "attributeName_example"; // string | Name of the attribute
|
|
$createAttribute = new \Brevo\Client\Model\CreateAttribute(); // \Brevo\Client\Model\CreateAttribute | Values to create an attribute
|
|
|
|
try {
|
|
$apiInstance->createAttribute($attributeCategory, $attributeName, $createAttribute);
|
|
} catch (Exception $e) {
|
|
echo 'Exception when calling ContactsApi->createAttribute: ', $e->getMessage(), PHP_EOL;
|
|
}
|
|
?>
|
|
```
|
|
|
|
### Parameters
|
|
|
|
Name | Type | Description | Notes
|
|
------------- | ------------- | ------------- | -------------
|
|
**attributeCategory** | **string**| Category of the attribute |
|
|
**attributeName** | **string**| Name of the attribute |
|
|
**createAttribute** | [**\Brevo\Client\Model\CreateAttribute**](../Model/CreateAttribute.md)| Values to create an attribute |
|
|
|
|
### 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)
|
|
|
|
# **createContact**
|
|
> \Brevo\Client\Model\CreateUpdateContactModel createContact($createContact)
|
|
|
|
Create a contact
|
|
|
|
### 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\ContactsApi(
|
|
// 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
|
|
);
|
|
$createContact = new \Brevo\Client\Model\CreateContact(); // \Brevo\Client\Model\CreateContact | Values to create a contact
|
|
|
|
try {
|
|
$result = $apiInstance->createContact($createContact);
|
|
print_r($result);
|
|
} catch (Exception $e) {
|
|
echo 'Exception when calling ContactsApi->createContact: ', $e->getMessage(), PHP_EOL;
|
|
}
|
|
?>
|
|
```
|
|
|
|
### Parameters
|
|
|
|
Name | Type | Description | Notes
|
|
------------- | ------------- | ------------- | -------------
|
|
**createContact** | [**\Brevo\Client\Model\CreateContact**](../Model/CreateContact.md)| Values to create a contact |
|
|
|
|
### Return type
|
|
|
|
[**\Brevo\Client\Model\CreateUpdateContactModel**](../Model/CreateUpdateContactModel.md)
|
|
|
|
### 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)
|
|
|
|
# **createDoiContact**
|
|
> createDoiContact($createDoiContact)
|
|
|
|
Create Contact via DOI (Double-Opt-In) Flow
|
|
|
|
### 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\ContactsApi(
|
|
// 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
|
|
);
|
|
$createDoiContact = new \Brevo\Client\Model\CreateDoiContact(); // \Brevo\Client\Model\CreateDoiContact | Values to create the Double opt-in (DOI) contact
|
|
|
|
try {
|
|
$apiInstance->createDoiContact($createDoiContact);
|
|
} catch (Exception $e) {
|
|
echo 'Exception when calling ContactsApi->createDoiContact: ', $e->getMessage(), PHP_EOL;
|
|
}
|
|
?>
|
|
```
|
|
|
|
### Parameters
|
|
|
|
Name | Type | Description | Notes
|
|
------------- | ------------- | ------------- | -------------
|
|
**createDoiContact** | [**\Brevo\Client\Model\CreateDoiContact**](../Model/CreateDoiContact.md)| Values to create the Double opt-in (DOI) contact |
|
|
|
|
### 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)
|
|
|
|
# **createFolder**
|
|
> \Brevo\Client\Model\CreateModel createFolder($createFolder)
|
|
|
|
Create a folder
|
|
|
|
### 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\ContactsApi(
|
|
// 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
|
|
);
|
|
$createFolder = new \Brevo\Client\Model\CreateUpdateFolder(); // \Brevo\Client\Model\CreateUpdateFolder | Name of the folder
|
|
|
|
try {
|
|
$result = $apiInstance->createFolder($createFolder);
|
|
print_r($result);
|
|
} catch (Exception $e) {
|
|
echo 'Exception when calling ContactsApi->createFolder: ', $e->getMessage(), PHP_EOL;
|
|
}
|
|
?>
|
|
```
|
|
|
|
### Parameters
|
|
|
|
Name | Type | Description | Notes
|
|
------------- | ------------- | ------------- | -------------
|
|
**createFolder** | [**\Brevo\Client\Model\CreateUpdateFolder**](../Model/CreateUpdateFolder.md)| Name of the folder |
|
|
|
|
### Return type
|
|
|
|
[**\Brevo\Client\Model\CreateModel**](../Model/CreateModel.md)
|
|
|
|
### 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)
|
|
|
|
# **createList**
|
|
> \Brevo\Client\Model\CreateModel createList($createList)
|
|
|
|
Create a list
|
|
|
|
### 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\ContactsApi(
|
|
// 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
|
|
);
|
|
$createList = new \Brevo\Client\Model\CreateList(); // \Brevo\Client\Model\CreateList | Values to create a list
|
|
|
|
try {
|
|
$result = $apiInstance->createList($createList);
|
|
print_r($result);
|
|
} catch (Exception $e) {
|
|
echo 'Exception when calling ContactsApi->createList: ', $e->getMessage(), PHP_EOL;
|
|
}
|
|
?>
|
|
```
|
|
|
|
### Parameters
|
|
|
|
Name | Type | Description | Notes
|
|
------------- | ------------- | ------------- | -------------
|
|
**createList** | [**\Brevo\Client\Model\CreateList**](../Model/CreateList.md)| Values to create a list |
|
|
|
|
### Return type
|
|
|
|
[**\Brevo\Client\Model\CreateModel**](../Model/CreateModel.md)
|
|
|
|
### 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)
|
|
|
|
# **deleteAttribute**
|
|
> deleteAttribute($attributeCategory, $attributeName)
|
|
|
|
Delete an attribute
|
|
|
|
### 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\ContactsApi(
|
|
// 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
|
|
);
|
|
$attributeCategory = "attributeCategory_example"; // string | Category of the attribute
|
|
$attributeName = "attributeName_example"; // string | Name of the existing attribute
|
|
|
|
try {
|
|
$apiInstance->deleteAttribute($attributeCategory, $attributeName);
|
|
} catch (Exception $e) {
|
|
echo 'Exception when calling ContactsApi->deleteAttribute: ', $e->getMessage(), PHP_EOL;
|
|
}
|
|
?>
|
|
```
|
|
|
|
### Parameters
|
|
|
|
Name | Type | Description | Notes
|
|
------------- | ------------- | ------------- | -------------
|
|
**attributeCategory** | **string**| Category of the attribute |
|
|
**attributeName** | **string**| Name of the existing attribute |
|
|
|
|
### 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)
|
|
|
|
# **deleteContact**
|
|
> deleteContact($identifier)
|
|
|
|
Delete a contact
|
|
|
|
### 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\ContactsApi(
|
|
// 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
|
|
);
|
|
$identifier = "identifier_example"; // string | Email (urlencoded) OR ID of the contact
|
|
|
|
try {
|
|
$apiInstance->deleteContact($identifier);
|
|
} catch (Exception $e) {
|
|
echo 'Exception when calling ContactsApi->deleteContact: ', $e->getMessage(), PHP_EOL;
|
|
}
|
|
?>
|
|
```
|
|
|
|
### Parameters
|
|
|
|
Name | Type | Description | Notes
|
|
------------- | ------------- | ------------- | -------------
|
|
**identifier** | **string**| Email (urlencoded) OR ID of the contact |
|
|
|
|
### 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)
|
|
|
|
# **deleteFolder**
|
|
> deleteFolder($folderId)
|
|
|
|
Delete a folder (and all its lists)
|
|
|
|
### 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\ContactsApi(
|
|
// 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
|
|
);
|
|
$folderId = 789; // int | Id of the folder
|
|
|
|
try {
|
|
$apiInstance->deleteFolder($folderId);
|
|
} catch (Exception $e) {
|
|
echo 'Exception when calling ContactsApi->deleteFolder: ', $e->getMessage(), PHP_EOL;
|
|
}
|
|
?>
|
|
```
|
|
|
|
### Parameters
|
|
|
|
Name | Type | Description | Notes
|
|
------------- | ------------- | ------------- | -------------
|
|
**folderId** | **int**| Id of the folder |
|
|
|
|
### 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)
|
|
|
|
# **deleteList**
|
|
> deleteList($listId)
|
|
|
|
Delete a list
|
|
|
|
### 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\ContactsApi(
|
|
// 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
|
|
);
|
|
$listId = 789; // int | Id of the list
|
|
|
|
try {
|
|
$apiInstance->deleteList($listId);
|
|
} catch (Exception $e) {
|
|
echo 'Exception when calling ContactsApi->deleteList: ', $e->getMessage(), PHP_EOL;
|
|
}
|
|
?>
|
|
```
|
|
|
|
### Parameters
|
|
|
|
Name | Type | Description | Notes
|
|
------------- | ------------- | ------------- | -------------
|
|
**listId** | **int**| Id of the list |
|
|
|
|
### 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)
|
|
|
|
# **getAttributes**
|
|
> \Brevo\Client\Model\GetAttributes getAttributes()
|
|
|
|
List all attributes
|
|
|
|
### 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\ContactsApi(
|
|
// 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
|
|
);
|
|
|
|
try {
|
|
$result = $apiInstance->getAttributes();
|
|
print_r($result);
|
|
} catch (Exception $e) {
|
|
echo 'Exception when calling ContactsApi->getAttributes: ', $e->getMessage(), PHP_EOL;
|
|
}
|
|
?>
|
|
```
|
|
|
|
### Parameters
|
|
This endpoint does not need any parameter.
|
|
|
|
### Return type
|
|
|
|
[**\Brevo\Client\Model\GetAttributes**](../Model/GetAttributes.md)
|
|
|
|
### 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)
|
|
|
|
# **getContactInfo**
|
|
> \Brevo\Client\Model\GetExtendedContactDetails getContactInfo($identifier, $startDate, $endDate)
|
|
|
|
Get a contact's details
|
|
|
|
Along with the contact details, this endpoint will show the statistics of contact for the recent 90 days by default. To fetch the earlier statistics, please use Get contact campaign stats (https://developers.brevo.com/reference/contacts-7#getcontactstats) endpoint with the appropriate date ranges.
|
|
|
|
### 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\ContactsApi(
|
|
// 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
|
|
);
|
|
$identifier = "identifier_example"; // string | Email (urlencoded) OR ID of the contact OR its SMS attribute value
|
|
$startDate = "startDate_example"; // string | **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate
|
|
$endDate = "endDate_example"; // string | **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate.
|
|
|
|
try {
|
|
$result = $apiInstance->getContactInfo($identifier, $startDate, $endDate);
|
|
print_r($result);
|
|
} catch (Exception $e) {
|
|
echo 'Exception when calling ContactsApi->getContactInfo: ', $e->getMessage(), PHP_EOL;
|
|
}
|
|
?>
|
|
```
|
|
|
|
### Parameters
|
|
|
|
Name | Type | Description | Notes
|
|
------------- | ------------- | ------------- | -------------
|
|
**identifier** | **string**| Email (urlencoded) OR ID of the contact OR its SMS attribute value |
|
|
**startDate** | **string**| **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate | [optional]
|
|
**endDate** | **string**| **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate. | [optional]
|
|
|
|
### Return type
|
|
|
|
[**\Brevo\Client\Model\GetExtendedContactDetails**](../Model/GetExtendedContactDetails.md)
|
|
|
|
### 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)
|
|
|
|
# **getContactStats**
|
|
> \Brevo\Client\Model\GetContactCampaignStats getContactStats($identifier, $startDate, $endDate)
|
|
|
|
Get email campaigns' statistics for a contact
|
|
|
|
### 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\ContactsApi(
|
|
// 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
|
|
);
|
|
$identifier = "identifier_example"; // string | Email (urlencoded) OR ID of the contact
|
|
$startDate = "startDate_example"; // string | Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate
|
|
$endDate = "endDate_example"; // string | Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate. Maximum difference between startDate and endDate should not be greater than 90 days
|
|
|
|
try {
|
|
$result = $apiInstance->getContactStats($identifier, $startDate, $endDate);
|
|
print_r($result);
|
|
} catch (Exception $e) {
|
|
echo 'Exception when calling ContactsApi->getContactStats: ', $e->getMessage(), PHP_EOL;
|
|
}
|
|
?>
|
|
```
|
|
|
|
### Parameters
|
|
|
|
Name | Type | Description | Notes
|
|
------------- | ------------- | ------------- | -------------
|
|
**identifier** | **string**| Email (urlencoded) OR ID of the contact |
|
|
**startDate** | **string**| Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate | [optional]
|
|
**endDate** | **string**| Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate. Maximum difference between startDate and endDate should not be greater than 90 days | [optional]
|
|
|
|
### Return type
|
|
|
|
[**\Brevo\Client\Model\GetContactCampaignStats**](../Model/GetContactCampaignStats.md)
|
|
|
|
### 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)
|
|
|
|
# **getContacts**
|
|
> \Brevo\Client\Model\GetContacts getContacts($limit, $offset, $modifiedSince, $createdSince, $sort, $segmentId, $listIds)
|
|
|
|
Get all the contacts
|
|
|
|
### 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\ContactsApi(
|
|
// 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
|
|
);
|
|
$limit = 50; // int | Number of documents per page
|
|
$offset = 0; // int | Index of the first document of the page
|
|
$modifiedSince = "modifiedSince_example"; // string | Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result.
|
|
$createdSince = "createdSince_example"; // string | Filter (urlencoded) the contacts created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result.
|
|
$sort = "desc"; // string | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed
|
|
$segmentId = 789; // int | Id of the segment. **Either listIds or segmentId can be passed.**
|
|
$listIds = array(56); // int[] | Ids of the list. **Either listIds or segmentId can be passed.**
|
|
|
|
try {
|
|
$result = $apiInstance->getContacts($limit, $offset, $modifiedSince, $createdSince, $sort, $segmentId, $listIds);
|
|
print_r($result);
|
|
} catch (Exception $e) {
|
|
echo 'Exception when calling ContactsApi->getContacts: ', $e->getMessage(), PHP_EOL;
|
|
}
|
|
?>
|
|
```
|
|
|
|
### Parameters
|
|
|
|
Name | Type | Description | Notes
|
|
------------- | ------------- | ------------- | -------------
|
|
**limit** | **int**| Number of documents per page | [optional] [default to 50]
|
|
**offset** | **int**| Index of the first document of the page | [optional] [default to 0]
|
|
**modifiedSince** | **string**| Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. | [optional]
|
|
**createdSince** | **string**| Filter (urlencoded) the contacts created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. | [optional]
|
|
**sort** | **string**| Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional] [default to desc]
|
|
**segmentId** | **int**| Id of the segment. **Either listIds or segmentId can be passed.** | [optional]
|
|
**listIds** | [**int[]**](../Model/int.md)| Ids of the list. **Either listIds or segmentId can be passed.** | [optional]
|
|
|
|
### Return type
|
|
|
|
[**\Brevo\Client\Model\GetContacts**](../Model/GetContacts.md)
|
|
|
|
### 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)
|
|
|
|
# **getContactsFromList**
|
|
> \Brevo\Client\Model\GetContacts getContactsFromList($listId, $modifiedSince, $limit, $offset, $sort)
|
|
|
|
Get contacts in a list
|
|
|
|
### 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\ContactsApi(
|
|
// 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
|
|
);
|
|
$listId = 789; // int | Id of the list
|
|
$modifiedSince = "modifiedSince_example"; // string | Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result.
|
|
$limit = 50; // int | Number of documents per page
|
|
$offset = 0; // int | Index of the first document of the page
|
|
$sort = "desc"; // string | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed
|
|
|
|
try {
|
|
$result = $apiInstance->getContactsFromList($listId, $modifiedSince, $limit, $offset, $sort);
|
|
print_r($result);
|
|
} catch (Exception $e) {
|
|
echo 'Exception when calling ContactsApi->getContactsFromList: ', $e->getMessage(), PHP_EOL;
|
|
}
|
|
?>
|
|
```
|
|
|
|
### Parameters
|
|
|
|
Name | Type | Description | Notes
|
|
------------- | ------------- | ------------- | -------------
|
|
**listId** | **int**| Id of the list |
|
|
**modifiedSince** | **string**| Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. | [optional]
|
|
**limit** | **int**| Number of documents per page | [optional] [default to 50]
|
|
**offset** | **int**| Index of the first document of the page | [optional] [default to 0]
|
|
**sort** | **string**| Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional] [default to desc]
|
|
|
|
### Return type
|
|
|
|
[**\Brevo\Client\Model\GetContacts**](../Model/GetContacts.md)
|
|
|
|
### 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)
|
|
|
|
# **getFolder**
|
|
> \Brevo\Client\Model\GetFolder getFolder($folderId)
|
|
|
|
Returns a folder's details
|
|
|
|
### 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\ContactsApi(
|
|
// 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
|
|
);
|
|
$folderId = 789; // int | id of the folder
|
|
|
|
try {
|
|
$result = $apiInstance->getFolder($folderId);
|
|
print_r($result);
|
|
} catch (Exception $e) {
|
|
echo 'Exception when calling ContactsApi->getFolder: ', $e->getMessage(), PHP_EOL;
|
|
}
|
|
?>
|
|
```
|
|
|
|
### Parameters
|
|
|
|
Name | Type | Description | Notes
|
|
------------- | ------------- | ------------- | -------------
|
|
**folderId** | **int**| id of the folder |
|
|
|
|
### Return type
|
|
|
|
[**\Brevo\Client\Model\GetFolder**](../Model/GetFolder.md)
|
|
|
|
### 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)
|
|
|
|
# **getFolderLists**
|
|
> \Brevo\Client\Model\GetFolderLists getFolderLists($folderId, $limit, $offset, $sort)
|
|
|
|
Get lists in a folder
|
|
|
|
### 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\ContactsApi(
|
|
// 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
|
|
);
|
|
$folderId = 789; // int | Id of the folder
|
|
$limit = 10; // int | Number of documents per page
|
|
$offset = 0; // int | Index of the first document of the page
|
|
$sort = "desc"; // string | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed
|
|
|
|
try {
|
|
$result = $apiInstance->getFolderLists($folderId, $limit, $offset, $sort);
|
|
print_r($result);
|
|
} catch (Exception $e) {
|
|
echo 'Exception when calling ContactsApi->getFolderLists: ', $e->getMessage(), PHP_EOL;
|
|
}
|
|
?>
|
|
```
|
|
|
|
### Parameters
|
|
|
|
Name | Type | Description | Notes
|
|
------------- | ------------- | ------------- | -------------
|
|
**folderId** | **int**| Id of the folder |
|
|
**limit** | **int**| Number of documents per page | [optional] [default to 10]
|
|
**offset** | **int**| Index of the first document of the page | [optional] [default to 0]
|
|
**sort** | **string**| Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional] [default to desc]
|
|
|
|
### Return type
|
|
|
|
[**\Brevo\Client\Model\GetFolderLists**](../Model/GetFolderLists.md)
|
|
|
|
### 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)
|
|
|
|
# **getFolders**
|
|
> \Brevo\Client\Model\GetFolders getFolders($limit, $offset, $sort)
|
|
|
|
Get all folders
|
|
|
|
### 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\ContactsApi(
|
|
// 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
|
|
);
|
|
$limit = 10; // int | Number of documents per page
|
|
$offset = 0; // int | Index of the first document of the page
|
|
$sort = "desc"; // string | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed
|
|
|
|
try {
|
|
$result = $apiInstance->getFolders($limit, $offset, $sort);
|
|
print_r($result);
|
|
} catch (Exception $e) {
|
|
echo 'Exception when calling ContactsApi->getFolders: ', $e->getMessage(), PHP_EOL;
|
|
}
|
|
?>
|
|
```
|
|
|
|
### Parameters
|
|
|
|
Name | Type | Description | Notes
|
|
------------- | ------------- | ------------- | -------------
|
|
**limit** | **int**| Number of documents per page | [default to 10]
|
|
**offset** | **int**| Index of the first document of the page | [default to 0]
|
|
**sort** | **string**| Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional] [default to desc]
|
|
|
|
### Return type
|
|
|
|
[**\Brevo\Client\Model\GetFolders**](../Model/GetFolders.md)
|
|
|
|
### 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)
|
|
|
|
# **getList**
|
|
> \Brevo\Client\Model\GetExtendedList getList($listId, $startDate, $endDate)
|
|
|
|
Get a list's details
|
|
|
|
### 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\ContactsApi(
|
|
// 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
|
|
);
|
|
$listId = 789; // int | Id of the list
|
|
$startDate = "startDate_example"; // string | Mandatory if endDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to aggregate the sent email campaigns for a specific list id.Prefer to pass your timezone in date-time format for accurate result
|
|
$endDate = "endDate_example"; // string | Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to aggregate the sent email campaigns for a specific list id.Prefer to pass your timezone in date-time format for accurate result
|
|
|
|
try {
|
|
$result = $apiInstance->getList($listId, $startDate, $endDate);
|
|
print_r($result);
|
|
} catch (Exception $e) {
|
|
echo 'Exception when calling ContactsApi->getList: ', $e->getMessage(), PHP_EOL;
|
|
}
|
|
?>
|
|
```
|
|
|
|
### Parameters
|
|
|
|
Name | Type | Description | Notes
|
|
------------- | ------------- | ------------- | -------------
|
|
**listId** | **int**| Id of the list |
|
|
**startDate** | **string**| Mandatory if endDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to aggregate the sent email campaigns for a specific list id.Prefer to pass your timezone in date-time format for accurate result | [optional]
|
|
**endDate** | **string**| Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to aggregate the sent email campaigns for a specific list id.Prefer to pass your timezone in date-time format for accurate result | [optional]
|
|
|
|
### Return type
|
|
|
|
[**\Brevo\Client\Model\GetExtendedList**](../Model/GetExtendedList.md)
|
|
|
|
### 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)
|
|
|
|
# **getLists**
|
|
> \Brevo\Client\Model\GetLists getLists($limit, $offset, $sort)
|
|
|
|
Get all the lists
|
|
|
|
### 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\ContactsApi(
|
|
// 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
|
|
);
|
|
$limit = 10; // int | Number of documents per page
|
|
$offset = 0; // int | Index of the first document of the page
|
|
$sort = "desc"; // string | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed
|
|
|
|
try {
|
|
$result = $apiInstance->getLists($limit, $offset, $sort);
|
|
print_r($result);
|
|
} catch (Exception $e) {
|
|
echo 'Exception when calling ContactsApi->getLists: ', $e->getMessage(), PHP_EOL;
|
|
}
|
|
?>
|
|
```
|
|
|
|
### Parameters
|
|
|
|
Name | Type | Description | Notes
|
|
------------- | ------------- | ------------- | -------------
|
|
**limit** | **int**| Number of documents per page | [optional] [default to 10]
|
|
**offset** | **int**| Index of the first document of the page | [optional] [default to 0]
|
|
**sort** | **string**| Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional] [default to desc]
|
|
|
|
### Return type
|
|
|
|
[**\Brevo\Client\Model\GetLists**](../Model/GetLists.md)
|
|
|
|
### 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)
|
|
|
|
# **getSegments**
|
|
> \Brevo\Client\Model\GetSegments getSegments($limit, $offset, $sort)
|
|
|
|
Get all the Segments
|
|
|
|
### 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\ContactsApi(
|
|
// 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
|
|
);
|
|
$limit = 10; // int | Number of documents per page
|
|
$offset = 0; // int | Index of the first document of the page
|
|
$sort = "desc"; // string | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed
|
|
|
|
try {
|
|
$result = $apiInstance->getSegments($limit, $offset, $sort);
|
|
print_r($result);
|
|
} catch (Exception $e) {
|
|
echo 'Exception when calling ContactsApi->getSegments: ', $e->getMessage(), PHP_EOL;
|
|
}
|
|
?>
|
|
```
|
|
|
|
### Parameters
|
|
|
|
Name | Type | Description | Notes
|
|
------------- | ------------- | ------------- | -------------
|
|
**limit** | **int**| Number of documents per page | [default to 10]
|
|
**offset** | **int**| Index of the first document of the page | [default to 0]
|
|
**sort** | **string**| Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional] [default to desc]
|
|
|
|
### Return type
|
|
|
|
[**\Brevo\Client\Model\GetSegments**](../Model/GetSegments.md)
|
|
|
|
### 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)
|
|
|
|
# **importContacts**
|
|
> \Brevo\Client\Model\CreatedProcessId importContacts($requestContactImport)
|
|
|
|
Import contacts
|
|
|
|
It returns the background process ID which on completion calls the notify URL that you have set in the input.
|
|
|
|
### 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\ContactsApi(
|
|
// 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
|
|
);
|
|
$requestContactImport = new \Brevo\Client\Model\RequestContactImport(); // \Brevo\Client\Model\RequestContactImport | Values to import contacts in Brevo. To know more about the expected format, please have a look at ``https://help.brevo.com/hc/en-us/articles/209499265-Build-contacts-lists-for-your-email-marketing-campaigns``
|
|
|
|
try {
|
|
$result = $apiInstance->importContacts($requestContactImport);
|
|
print_r($result);
|
|
} catch (Exception $e) {
|
|
echo 'Exception when calling ContactsApi->importContacts: ', $e->getMessage(), PHP_EOL;
|
|
}
|
|
?>
|
|
```
|
|
|
|
### Parameters
|
|
|
|
Name | Type | Description | Notes
|
|
------------- | ------------- | ------------- | -------------
|
|
**requestContactImport** | [**\Brevo\Client\Model\RequestContactImport**](../Model/RequestContactImport.md)| Values to import contacts in Brevo. To know more about the expected format, please have a look at ``https://help.brevo.com/hc/en-us/articles/209499265-Build-contacts-lists-for-your-email-marketing-campaigns`` |
|
|
|
|
### Return type
|
|
|
|
[**\Brevo\Client\Model\CreatedProcessId**](../Model/CreatedProcessId.md)
|
|
|
|
### 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)
|
|
|
|
# **removeContactFromList**
|
|
> \Brevo\Client\Model\PostContactInfo removeContactFromList($listId, $contactEmails)
|
|
|
|
Delete a contact from a list
|
|
|
|
### 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\ContactsApi(
|
|
// 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
|
|
);
|
|
$listId = 789; // int | Id of the list
|
|
$contactEmails = new \Brevo\Client\Model\RemoveContactFromList(); // \Brevo\Client\Model\RemoveContactFromList | Emails addresses OR IDs of the contacts
|
|
|
|
try {
|
|
$result = $apiInstance->removeContactFromList($listId, $contactEmails);
|
|
print_r($result);
|
|
} catch (Exception $e) {
|
|
echo 'Exception when calling ContactsApi->removeContactFromList: ', $e->getMessage(), PHP_EOL;
|
|
}
|
|
?>
|
|
```
|
|
|
|
### Parameters
|
|
|
|
Name | Type | Description | Notes
|
|
------------- | ------------- | ------------- | -------------
|
|
**listId** | **int**| Id of the list |
|
|
**contactEmails** | [**\Brevo\Client\Model\RemoveContactFromList**](../Model/RemoveContactFromList.md)| Emails addresses OR IDs of the contacts |
|
|
|
|
### Return type
|
|
|
|
[**\Brevo\Client\Model\PostContactInfo**](../Model/PostContactInfo.md)
|
|
|
|
### 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)
|
|
|
|
# **requestContactExport**
|
|
> \Brevo\Client\Model\CreatedProcessId requestContactExport($requestContactExport)
|
|
|
|
Export contacts
|
|
|
|
It returns the background process ID which on completion calls the notify URL that you have set in the input. File will be available in csv.
|
|
|
|
### 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\ContactsApi(
|
|
// 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
|
|
);
|
|
$requestContactExport = new \Brevo\Client\Model\RequestContactExport(); // \Brevo\Client\Model\RequestContactExport | Values to request a contact export
|
|
|
|
try {
|
|
$result = $apiInstance->requestContactExport($requestContactExport);
|
|
print_r($result);
|
|
} catch (Exception $e) {
|
|
echo 'Exception when calling ContactsApi->requestContactExport: ', $e->getMessage(), PHP_EOL;
|
|
}
|
|
?>
|
|
```
|
|
|
|
### Parameters
|
|
|
|
Name | Type | Description | Notes
|
|
------------- | ------------- | ------------- | -------------
|
|
**requestContactExport** | [**\Brevo\Client\Model\RequestContactExport**](../Model/RequestContactExport.md)| Values to request a contact export |
|
|
|
|
### Return type
|
|
|
|
[**\Brevo\Client\Model\CreatedProcessId**](../Model/CreatedProcessId.md)
|
|
|
|
### 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)
|
|
|
|
# **updateAttribute**
|
|
> updateAttribute($attributeCategory, $attributeName, $updateAttribute)
|
|
|
|
Update contact attribute
|
|
|
|
### 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\ContactsApi(
|
|
// 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
|
|
);
|
|
$attributeCategory = "attributeCategory_example"; // string | Category of the attribute
|
|
$attributeName = "attributeName_example"; // string | Name of the existing attribute
|
|
$updateAttribute = new \Brevo\Client\Model\UpdateAttribute(); // \Brevo\Client\Model\UpdateAttribute | Values to update an attribute
|
|
|
|
try {
|
|
$apiInstance->updateAttribute($attributeCategory, $attributeName, $updateAttribute);
|
|
} catch (Exception $e) {
|
|
echo 'Exception when calling ContactsApi->updateAttribute: ', $e->getMessage(), PHP_EOL;
|
|
}
|
|
?>
|
|
```
|
|
|
|
### Parameters
|
|
|
|
Name | Type | Description | Notes
|
|
------------- | ------------- | ------------- | -------------
|
|
**attributeCategory** | **string**| Category of the attribute |
|
|
**attributeName** | **string**| Name of the existing attribute |
|
|
**updateAttribute** | [**\Brevo\Client\Model\UpdateAttribute**](../Model/UpdateAttribute.md)| Values to update an attribute |
|
|
|
|
### 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)
|
|
|
|
# **updateBatchContacts**
|
|
> updateBatchContacts($updateBatchContacts)
|
|
|
|
Update multiple contacts
|
|
|
|
### 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\ContactsApi(
|
|
// 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
|
|
);
|
|
$updateBatchContacts = new \Brevo\Client\Model\UpdateBatchContacts(); // \Brevo\Client\Model\UpdateBatchContacts | Values to update multiple contacts
|
|
|
|
try {
|
|
$apiInstance->updateBatchContacts($updateBatchContacts);
|
|
} catch (Exception $e) {
|
|
echo 'Exception when calling ContactsApi->updateBatchContacts: ', $e->getMessage(), PHP_EOL;
|
|
}
|
|
?>
|
|
```
|
|
|
|
### Parameters
|
|
|
|
Name | Type | Description | Notes
|
|
------------- | ------------- | ------------- | -------------
|
|
**updateBatchContacts** | [**\Brevo\Client\Model\UpdateBatchContacts**](../Model/UpdateBatchContacts.md)| Values to update multiple contacts |
|
|
|
|
### 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)
|
|
|
|
# **updateContact**
|
|
> updateContact($identifier, $updateContact)
|
|
|
|
Update a contact
|
|
|
|
### 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\ContactsApi(
|
|
// 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
|
|
);
|
|
$identifier = "identifier_example"; // string | Email (urlencoded) OR ID of the contact
|
|
$updateContact = new \Brevo\Client\Model\UpdateContact(); // \Brevo\Client\Model\UpdateContact | Values to update a contact
|
|
|
|
try {
|
|
$apiInstance->updateContact($identifier, $updateContact);
|
|
} catch (Exception $e) {
|
|
echo 'Exception when calling ContactsApi->updateContact: ', $e->getMessage(), PHP_EOL;
|
|
}
|
|
?>
|
|
```
|
|
|
|
### Parameters
|
|
|
|
Name | Type | Description | Notes
|
|
------------- | ------------- | ------------- | -------------
|
|
**identifier** | **string**| Email (urlencoded) OR ID of the contact |
|
|
**updateContact** | [**\Brevo\Client\Model\UpdateContact**](../Model/UpdateContact.md)| Values to update a contact |
|
|
|
|
### 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)
|
|
|
|
# **updateFolder**
|
|
> updateFolder($folderId, $updateFolder)
|
|
|
|
Update a folder
|
|
|
|
### 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\ContactsApi(
|
|
// 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
|
|
);
|
|
$folderId = 789; // int | Id of the folder
|
|
$updateFolder = new \Brevo\Client\Model\CreateUpdateFolder(); // \Brevo\Client\Model\CreateUpdateFolder | Name of the folder
|
|
|
|
try {
|
|
$apiInstance->updateFolder($folderId, $updateFolder);
|
|
} catch (Exception $e) {
|
|
echo 'Exception when calling ContactsApi->updateFolder: ', $e->getMessage(), PHP_EOL;
|
|
}
|
|
?>
|
|
```
|
|
|
|
### Parameters
|
|
|
|
Name | Type | Description | Notes
|
|
------------- | ------------- | ------------- | -------------
|
|
**folderId** | **int**| Id of the folder |
|
|
**updateFolder** | [**\Brevo\Client\Model\CreateUpdateFolder**](../Model/CreateUpdateFolder.md)| Name of the folder |
|
|
|
|
### 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)
|
|
|
|
# **updateList**
|
|
> updateList($listId, $updateList)
|
|
|
|
Update a list
|
|
|
|
### 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\ContactsApi(
|
|
// 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
|
|
);
|
|
$listId = 789; // int | Id of the list
|
|
$updateList = new \Brevo\Client\Model\UpdateList(); // \Brevo\Client\Model\UpdateList | Values to update a list
|
|
|
|
try {
|
|
$apiInstance->updateList($listId, $updateList);
|
|
} catch (Exception $e) {
|
|
echo 'Exception when calling ContactsApi->updateList: ', $e->getMessage(), PHP_EOL;
|
|
}
|
|
?>
|
|
```
|
|
|
|
### Parameters
|
|
|
|
Name | Type | Description | Notes
|
|
------------- | ------------- | ------------- | -------------
|
|
**listId** | **int**| Id of the list |
|
|
**updateList** | [**\Brevo\Client\Model\UpdateList**](../Model/UpdateList.md)| Values to update a list |
|
|
|
|
### 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)
|
|
|