/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

  1. # SendinBlue\Client\FoldersApi
  2. All URIs are relative to *https://api.sendinblue.com/v3*
  3. Method | HTTP request | Description
  4. ------------- | ------------- | -------------
  5. [**createFolder**](FoldersApi.md#createFolder) | **POST** /contacts/folders | Create a folder
  6. [**deleteFolder**](FoldersApi.md#deleteFolder) | **DELETE** /contacts/folders/{folderId} | Delete a folder (and all its lists)
  7. [**getFolder**](FoldersApi.md#getFolder) | **GET** /contacts/folders/{folderId} | Returns a folder's details
  8. [**getFolderLists**](FoldersApi.md#getFolderLists) | **GET** /contacts/folders/{folderId}/lists | Get lists in a folder
  9. [**getFolders**](FoldersApi.md#getFolders) | **GET** /contacts/folders | Get all folders
  10. [**updateFolder**](FoldersApi.md#updateFolder) | **PUT** /contacts/folders/{folderId} | Update a folder
  11. # **createFolder**
  12. > \SendinBlue\Client\Model\CreateModel createFolder($createFolder)
  13. Create a folder
  14. ### Example
  15. ```php
  16. <?php
  17. require_once(__DIR__ . '/vendor/autoload.php');
  18. // Configure API key authorization: api-key
  19. $config = SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY');
  20. // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
  21. // $config = SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
  22. // Configure API key authorization: partner-key
  23. $config = SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
  24. // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
  25. // $config = SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
  26. $apiInstance = new SendinBlue\Client\Api\FoldersApi(
  27. // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
  28. // This is optional, `GuzzleHttp\Client` will be used as default.
  29. new GuzzleHttp\Client(),
  30. $config
  31. );
  32. $createFolder = new \SendinBlue\Client\Model\CreateUpdateFolder(); // \SendinBlue\Client\Model\CreateUpdateFolder | Name of the folder
  33. try {
  34. $result = $apiInstance->createFolder($createFolder);
  35. print_r($result);
  36. } catch (Exception $e) {
  37. echo 'Exception when calling FoldersApi->createFolder: ', $e->getMessage(), PHP_EOL;
  38. }
  39. ?>
  40. ```
  41. ### Parameters
  42. Name | Type | Description | Notes
  43. ------------- | ------------- | ------------- | -------------
  44. **createFolder** | [**\SendinBlue\Client\Model\CreateUpdateFolder**](../Model/CreateUpdateFolder.md)| Name of the folder |
  45. ### Return type
  46. [**\SendinBlue\Client\Model\CreateModel**](../Model/CreateModel.md)
  47. ### Authorization
  48. [api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
  49. ### HTTP request headers
  50. - **Content-Type**: application/json
  51. - **Accept**: application/json
  52. [[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)
  53. # **deleteFolder**
  54. > deleteFolder($folderId)
  55. Delete a folder (and all its lists)
  56. ### Example
  57. ```php
  58. <?php
  59. require_once(__DIR__ . '/vendor/autoload.php');
  60. // Configure API key authorization: api-key
  61. $config = SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY');
  62. // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
  63. // $config = SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
  64. // Configure API key authorization: partner-key
  65. $config = SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
  66. // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
  67. // $config = SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
  68. $apiInstance = new SendinBlue\Client\Api\FoldersApi(
  69. // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
  70. // This is optional, `GuzzleHttp\Client` will be used as default.
  71. new GuzzleHttp\Client(),
  72. $config
  73. );
  74. $folderId = 789; // int | Id of the folder
  75. try {
  76. $apiInstance->deleteFolder($folderId);
  77. } catch (Exception $e) {
  78. echo 'Exception when calling FoldersApi->deleteFolder: ', $e->getMessage(), PHP_EOL;
  79. }
  80. ?>
  81. ```
  82. ### Parameters
  83. Name | Type | Description | Notes
  84. ------------- | ------------- | ------------- | -------------
  85. **folderId** | **int**| Id of the folder |
  86. ### Return type
  87. void (empty response body)
  88. ### Authorization
  89. [api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
  90. ### HTTP request headers
  91. - **Content-Type**: application/json
  92. - **Accept**: application/json
  93. [[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)
  94. # **getFolder**
  95. > \SendinBlue\Client\Model\GetFolder getFolder($folderId)
  96. Returns a folder's details
  97. ### Example
  98. ```php
  99. <?php
  100. require_once(__DIR__ . '/vendor/autoload.php');
  101. // Configure API key authorization: api-key
  102. $config = SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY');
  103. // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
  104. // $config = SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
  105. // Configure API key authorization: partner-key
  106. $config = SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
  107. // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
  108. // $config = SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
  109. $apiInstance = new SendinBlue\Client\Api\FoldersApi(
  110. // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
  111. // This is optional, `GuzzleHttp\Client` will be used as default.
  112. new GuzzleHttp\Client(),
  113. $config
  114. );
  115. $folderId = 789; // int | id of the folder
  116. try {
  117. $result = $apiInstance->getFolder($folderId);
  118. print_r($result);
  119. } catch (Exception $e) {
  120. echo 'Exception when calling FoldersApi->getFolder: ', $e->getMessage(), PHP_EOL;
  121. }
  122. ?>
  123. ```
  124. ### Parameters
  125. Name | Type | Description | Notes
  126. ------------- | ------------- | ------------- | -------------
  127. **folderId** | **int**| id of the folder |
  128. ### Return type
  129. [**\SendinBlue\Client\Model\GetFolder**](../Model/GetFolder.md)
  130. ### Authorization
  131. [api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
  132. ### HTTP request headers
  133. - **Content-Type**: application/json
  134. - **Accept**: application/json
  135. [[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)
  136. # **getFolderLists**
  137. > \SendinBlue\Client\Model\GetFolderLists getFolderLists($folderId, $limit, $offset, $sort)
  138. Get lists in a folder
  139. ### Example
  140. ```php
  141. <?php
  142. require_once(__DIR__ . '/vendor/autoload.php');
  143. // Configure API key authorization: api-key
  144. $config = SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY');
  145. // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
  146. // $config = SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
  147. // Configure API key authorization: partner-key
  148. $config = SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
  149. // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
  150. // $config = SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
  151. $apiInstance = new SendinBlue\Client\Api\FoldersApi(
  152. // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
  153. // This is optional, `GuzzleHttp\Client` will be used as default.
  154. new GuzzleHttp\Client(),
  155. $config
  156. );
  157. $folderId = 789; // int | Id of the folder
  158. $limit = 10; // int | Number of documents per page
  159. $offset = 0; // int | Index of the first document of the page
  160. $sort = "desc"; // string | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed
  161. try {
  162. $result = $apiInstance->getFolderLists($folderId, $limit, $offset, $sort);
  163. print_r($result);
  164. } catch (Exception $e) {
  165. echo 'Exception when calling FoldersApi->getFolderLists: ', $e->getMessage(), PHP_EOL;
  166. }
  167. ?>
  168. ```
  169. ### Parameters
  170. Name | Type | Description | Notes
  171. ------------- | ------------- | ------------- | -------------
  172. **folderId** | **int**| Id of the folder |
  173. **limit** | **int**| Number of documents per page | [optional] [default to 10]
  174. **offset** | **int**| Index of the first document of the page | [optional] [default to 0]
  175. **sort** | **string**| Sort the results in the ascending/descending order of record creation. Default order is **descending** if &#x60;sort&#x60; is not passed | [optional] [default to desc]
  176. ### Return type
  177. [**\SendinBlue\Client\Model\GetFolderLists**](../Model/GetFolderLists.md)
  178. ### Authorization
  179. [api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
  180. ### HTTP request headers
  181. - **Content-Type**: application/json
  182. - **Accept**: application/json
  183. [[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)
  184. # **getFolders**
  185. > \SendinBlue\Client\Model\GetFolders getFolders($limit, $offset, $sort)
  186. Get all folders
  187. ### Example
  188. ```php
  189. <?php
  190. require_once(__DIR__ . '/vendor/autoload.php');
  191. // Configure API key authorization: api-key
  192. $config = SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY');
  193. // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
  194. // $config = SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
  195. // Configure API key authorization: partner-key
  196. $config = SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
  197. // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
  198. // $config = SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
  199. $apiInstance = new SendinBlue\Client\Api\FoldersApi(
  200. // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
  201. // This is optional, `GuzzleHttp\Client` will be used as default.
  202. new GuzzleHttp\Client(),
  203. $config
  204. );
  205. $limit = 10; // int | Number of documents per page
  206. $offset = 0; // int | Index of the first document of the page
  207. $sort = "desc"; // string | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed
  208. try {
  209. $result = $apiInstance->getFolders($limit, $offset, $sort);
  210. print_r($result);
  211. } catch (Exception $e) {
  212. echo 'Exception when calling FoldersApi->getFolders: ', $e->getMessage(), PHP_EOL;
  213. }
  214. ?>
  215. ```
  216. ### Parameters
  217. Name | Type | Description | Notes
  218. ------------- | ------------- | ------------- | -------------
  219. **limit** | **int**| Number of documents per page | [default to 10]
  220. **offset** | **int**| Index of the first document of the page | [default to 0]
  221. **sort** | **string**| Sort the results in the ascending/descending order of record creation. Default order is **descending** if &#x60;sort&#x60; is not passed | [optional] [default to desc]
  222. ### Return type
  223. [**\SendinBlue\Client\Model\GetFolders**](../Model/GetFolders.md)
  224. ### Authorization
  225. [api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
  226. ### HTTP request headers
  227. - **Content-Type**: application/json
  228. - **Accept**: application/json
  229. [[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)
  230. # **updateFolder**
  231. > updateFolder($folderId, $updateFolder)
  232. Update a folder
  233. ### Example
  234. ```php
  235. <?php
  236. require_once(__DIR__ . '/vendor/autoload.php');
  237. // Configure API key authorization: api-key
  238. $config = SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY');
  239. // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
  240. // $config = SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
  241. // Configure API key authorization: partner-key
  242. $config = SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
  243. // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
  244. // $config = SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
  245. $apiInstance = new SendinBlue\Client\Api\FoldersApi(
  246. // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
  247. // This is optional, `GuzzleHttp\Client` will be used as default.
  248. new GuzzleHttp\Client(),
  249. $config
  250. );
  251. $folderId = 789; // int | Id of the folder
  252. $updateFolder = new \SendinBlue\Client\Model\CreateUpdateFolder(); // \SendinBlue\Client\Model\CreateUpdateFolder | Name of the folder
  253. try {
  254. $apiInstance->updateFolder($folderId, $updateFolder);
  255. } catch (Exception $e) {
  256. echo 'Exception when calling FoldersApi->updateFolder: ', $e->getMessage(), PHP_EOL;
  257. }
  258. ?>
  259. ```
  260. ### Parameters
  261. Name | Type | Description | Notes
  262. ------------- | ------------- | ------------- | -------------
  263. **folderId** | **int**| Id of the folder |
  264. **updateFolder** | [**\SendinBlue\Client\Model\CreateUpdateFolder**](../Model/CreateUpdateFolder.md)| Name of the folder |
  265. ### Return type
  266. void (empty response body)
  267. ### Authorization
  268. [api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key)
  269. ### HTTP request headers
  270. - **Content-Type**: application/json
  271. - **Accept**: application/json
  272. [[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)