/docs/Api/FoldersApi.md
https://github.com/sendinblue/APIv3-php-library · Markdown · 366 lines · 272 code · 94 blank · 0 comment · 0 complexity · 0aeb0e8e75b0a52632403f1ddb685920 MD5 · raw file
- # SendinBlue\Client\FoldersApi
- All URIs are relative to *https://api.sendinblue.com/v3*
- Method | HTTP request | Description
- ------------- | ------------- | -------------
- [**createFolder**](FoldersApi.md#createFolder) | **POST** /contacts/folders | Create a folder
- [**deleteFolder**](FoldersApi.md#deleteFolder) | **DELETE** /contacts/folders/{folderId} | Delete a folder (and all its lists)
- [**getFolder**](FoldersApi.md#getFolder) | **GET** /contacts/folders/{folderId} | Returns a folder's details
- [**getFolderLists**](FoldersApi.md#getFolderLists) | **GET** /contacts/folders/{folderId}/lists | Get lists in a folder
- [**getFolders**](FoldersApi.md#getFolders) | **GET** /contacts/folders | Get all folders
- [**updateFolder**](FoldersApi.md#updateFolder) | **PUT** /contacts/folders/{folderId} | Update a folder
- # **createFolder**
- > \SendinBlue\Client\Model\CreateModel createFolder($createFolder)
- Create a folder
- ### Example
- ```php
- <?php
- require_once(__DIR__ . '/vendor/autoload.php');
- // Configure API key authorization: api-key
- $config = SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY');
- // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
- // $config = SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
- // Configure API key authorization: partner-key
- $config = SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
- // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
- // $config = SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
- $apiInstance = new SendinBlue\Client\Api\FoldersApi(
- // 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 \SendinBlue\Client\Model\CreateUpdateFolder(); // \SendinBlue\Client\Model\CreateUpdateFolder | Name of the folder
- try {
- $result = $apiInstance->createFolder($createFolder);
- print_r($result);
- } catch (Exception $e) {
- echo 'Exception when calling FoldersApi->createFolder: ', $e->getMessage(), PHP_EOL;
- }
- ?>
- ```
- ### Parameters
- Name | Type | Description | Notes
- ------------- | ------------- | ------------- | -------------
- **createFolder** | [**\SendinBlue\Client\Model\CreateUpdateFolder**](../Model/CreateUpdateFolder.md)| Name of the folder |
- ### Return type
- [**\SendinBlue\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)
- # **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 = SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY');
- // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
- // $config = SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
- // Configure API key authorization: partner-key
- $config = SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
- // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
- // $config = SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
- $apiInstance = new SendinBlue\Client\Api\FoldersApi(
- // 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 FoldersApi->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)
- # **getFolder**
- > \SendinBlue\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 = SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY');
- // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
- // $config = SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
- // Configure API key authorization: partner-key
- $config = SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
- // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
- // $config = SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
- $apiInstance = new SendinBlue\Client\Api\FoldersApi(
- // 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 FoldersApi->getFolder: ', $e->getMessage(), PHP_EOL;
- }
- ?>
- ```
- ### Parameters
- Name | Type | Description | Notes
- ------------- | ------------- | ------------- | -------------
- **folderId** | **int**| id of the folder |
- ### Return type
- [**\SendinBlue\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**
- > \SendinBlue\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 = SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY');
- // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
- // $config = SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
- // Configure API key authorization: partner-key
- $config = SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
- // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
- // $config = SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
- $apiInstance = new SendinBlue\Client\Api\FoldersApi(
- // 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 FoldersApi->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
- [**\SendinBlue\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**
- > \SendinBlue\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 = SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY');
- // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
- // $config = SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
- // Configure API key authorization: partner-key
- $config = SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
- // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
- // $config = SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
- $apiInstance = new SendinBlue\Client\Api\FoldersApi(
- // 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 FoldersApi->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
- [**\SendinBlue\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)
- # **updateFolder**
- > updateFolder($folderId, $updateFolder)
- Update a folder
- ### Example
- ```php
- <?php
- require_once(__DIR__ . '/vendor/autoload.php');
- // Configure API key authorization: api-key
- $config = SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY');
- // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
- // $config = SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
- // Configure API key authorization: partner-key
- $config = SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
- // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
- // $config = SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
- $apiInstance = new SendinBlue\Client\Api\FoldersApi(
- // 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 \SendinBlue\Client\Model\CreateUpdateFolder(); // \SendinBlue\Client\Model\CreateUpdateFolder | Name of the folder
- try {
- $apiInstance->updateFolder($folderId, $updateFolder);
- } catch (Exception $e) {
- echo 'Exception when calling FoldersApi->updateFolder: ', $e->getMessage(), PHP_EOL;
- }
- ?>
- ```
- ### Parameters
- Name | Type | Description | Notes
- ------------- | ------------- | ------------- | -------------
- **folderId** | **int**| Id of the folder |
- **updateFolder** | [**\SendinBlue\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)