|
| 1 | +# Hostinger\ReachContactsApi |
| 2 | + |
| 3 | +All URIs are relative to https://developers.hostinger.com, except if the operation defines another base path. |
| 4 | + |
| 5 | +| Method | HTTP request | Description | |
| 6 | +| ------------- | ------------- | ------------- | |
| 7 | +| [**createANewContactV1()**](ReachContactsApi.md#createANewContactV1) | **POST** /api/reach/v1/contacts | Create a new contact | |
| 8 | +| [**deleteAContactV1()**](ReachContactsApi.md#deleteAContactV1) | **DELETE** /api/reach/v1/contacts/{uuid} | Delete a contact | |
| 9 | +| [**listContactGroupsV1()**](ReachContactsApi.md#listContactGroupsV1) | **GET** /api/reach/v1/contacts/groups | List contact groups | |
| 10 | +| [**listContactsV1()**](ReachContactsApi.md#listContactsV1) | **GET** /api/reach/v1/contacts | List contacts | |
| 11 | + |
| 12 | + |
| 13 | +## `createANewContactV1()` |
| 14 | + |
| 15 | +```php |
| 16 | +createANewContactV1($reachV1ContactsStoreRequest): \Hostinger\Model\ReachV1ContactsContactResource |
| 17 | +``` |
| 18 | + |
| 19 | +Create a new contact |
| 20 | + |
| 21 | +Create a new contact in the email marketing system. This endpoint allows you to create a new contact with basic information like name, email, and surname. You can optionally assign the contact to specific groups and add notes. The contact will be automatically subscribed to email communications. |
| 22 | + |
| 23 | +### Example |
| 24 | + |
| 25 | +```php |
| 26 | +<?php |
| 27 | +require_once(__DIR__ . '/vendor/autoload.php'); |
| 28 | + |
| 29 | + |
| 30 | +// Configure Bearer authorization: apiToken |
| 31 | +$config = Hostinger\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); |
| 32 | + |
| 33 | + |
| 34 | +$apiInstance = new Hostinger\Api\ReachContactsApi(config: $config); |
| 35 | +$reachV1ContactsStoreRequest = new \Hostinger\Model\ReachV1ContactsStoreRequest(); // \Hostinger\Model\ReachV1ContactsStoreRequest |
| 36 | + |
| 37 | +try { |
| 38 | + $result = $apiInstance->createANewContactV1($reachV1ContactsStoreRequest); |
| 39 | + print_r($result); |
| 40 | +} catch (Exception $e) { |
| 41 | + echo 'Exception when calling ReachContactsApi->createANewContactV1: ', $e->getMessage(), PHP_EOL; |
| 42 | +} |
| 43 | +``` |
| 44 | + |
| 45 | +### Parameters |
| 46 | + |
| 47 | +| Name | Type | Description | Notes | |
| 48 | +| ------------- | ------------- | ------------- | ------------- | |
| 49 | +| **reachV1ContactsStoreRequest** | [**\Hostinger\Model\ReachV1ContactsStoreRequest**](../Model/ReachV1ContactsStoreRequest.md)| | | |
| 50 | + |
| 51 | +### Return type |
| 52 | + |
| 53 | +[**\Hostinger\Model\ReachV1ContactsContactResource**](../Model/ReachV1ContactsContactResource.md) |
| 54 | + |
| 55 | +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) |
| 56 | +[[Back to Model list]](../../README.md#models) |
| 57 | +[[Back to README]](../../README.md) |
| 58 | + |
| 59 | +## `deleteAContactV1()` |
| 60 | + |
| 61 | +```php |
| 62 | +deleteAContactV1($uuid): \Hostinger\Model\CommonSuccessEmptyResource |
| 63 | +``` |
| 64 | + |
| 65 | +Delete a contact |
| 66 | + |
| 67 | +Delete a contact with the specified UUID. This endpoint permanently removes a contact from the email marketing system. |
| 68 | + |
| 69 | +### Example |
| 70 | + |
| 71 | +```php |
| 72 | +<?php |
| 73 | +require_once(__DIR__ . '/vendor/autoload.php'); |
| 74 | + |
| 75 | + |
| 76 | +// Configure Bearer authorization: apiToken |
| 77 | +$config = Hostinger\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); |
| 78 | + |
| 79 | + |
| 80 | +$apiInstance = new Hostinger\Api\ReachContactsApi(config: $config); |
| 81 | +$uuid = 'uuid_example'; // string | UUID of the contact to delete |
| 82 | + |
| 83 | +try { |
| 84 | + $result = $apiInstance->deleteAContactV1($uuid); |
| 85 | + print_r($result); |
| 86 | +} catch (Exception $e) { |
| 87 | + echo 'Exception when calling ReachContactsApi->deleteAContactV1: ', $e->getMessage(), PHP_EOL; |
| 88 | +} |
| 89 | +``` |
| 90 | + |
| 91 | +### Parameters |
| 92 | + |
| 93 | +| Name | Type | Description | Notes | |
| 94 | +| ------------- | ------------- | ------------- | ------------- | |
| 95 | +| **uuid** | **string**| UUID of the contact to delete | | |
| 96 | + |
| 97 | +### Return type |
| 98 | + |
| 99 | +[**\Hostinger\Model\CommonSuccessEmptyResource**](../Model/CommonSuccessEmptyResource.md) |
| 100 | + |
| 101 | +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) |
| 102 | +[[Back to Model list]](../../README.md#models) |
| 103 | +[[Back to README]](../../README.md) |
| 104 | + |
| 105 | +## `listContactGroupsV1()` |
| 106 | + |
| 107 | +```php |
| 108 | +listContactGroupsV1(): \Hostinger\Model\ReachV1ContactsGroupsContactGroupResource[] |
| 109 | +``` |
| 110 | + |
| 111 | +List contact groups |
| 112 | + |
| 113 | +Get a list of all contact groups. This endpoint returns a list of contact groups that can be used to organize contacts. |
| 114 | + |
| 115 | +### Example |
| 116 | + |
| 117 | +```php |
| 118 | +<?php |
| 119 | +require_once(__DIR__ . '/vendor/autoload.php'); |
| 120 | + |
| 121 | + |
| 122 | +// Configure Bearer authorization: apiToken |
| 123 | +$config = Hostinger\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); |
| 124 | + |
| 125 | + |
| 126 | +$apiInstance = new Hostinger\Api\ReachContactsApi(config: $config); |
| 127 | + |
| 128 | +try { |
| 129 | + $result = $apiInstance->listContactGroupsV1(); |
| 130 | + print_r($result); |
| 131 | +} catch (Exception $e) { |
| 132 | + echo 'Exception when calling ReachContactsApi->listContactGroupsV1: ', $e->getMessage(), PHP_EOL; |
| 133 | +} |
| 134 | +``` |
| 135 | + |
| 136 | +### Parameters |
| 137 | + |
| 138 | +This endpoint does not need any parameter. |
| 139 | + |
| 140 | +### Return type |
| 141 | + |
| 142 | +[**\Hostinger\Model\ReachV1ContactsGroupsContactGroupResource[]**](../Model/ReachV1ContactsGroupsContactGroupResource.md) |
| 143 | + |
| 144 | +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) |
| 145 | +[[Back to Model list]](../../README.md#models) |
| 146 | +[[Back to README]](../../README.md) |
| 147 | + |
| 148 | +## `listContactsV1()` |
| 149 | + |
| 150 | +```php |
| 151 | +listContactsV1($groupUuid, $subscriptionStatus, $page): \Hostinger\Model\ReachListContactsV1200Response |
| 152 | +``` |
| 153 | + |
| 154 | +List contacts |
| 155 | + |
| 156 | +Get a list of contacts, optionally filtered by group and subscription status. This endpoint returns a paginated list of contacts with their basic information. You can filter contacts by group UUID and subscription status. |
| 157 | + |
| 158 | +### Example |
| 159 | + |
| 160 | +```php |
| 161 | +<?php |
| 162 | +require_once(__DIR__ . '/vendor/autoload.php'); |
| 163 | + |
| 164 | + |
| 165 | +// Configure Bearer authorization: apiToken |
| 166 | +$config = Hostinger\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); |
| 167 | + |
| 168 | + |
| 169 | +$apiInstance = new Hostinger\Api\ReachContactsApi(config: $config); |
| 170 | +$groupUuid = 550e8400-e29b-41d4-a716-446655440000; // string | Filter contacts by group UUID |
| 171 | +$subscriptionStatus = subscribed; // string | Filter contacts by subscription status |
| 172 | +$page = 1; // int | Page number |
| 173 | + |
| 174 | +try { |
| 175 | + $result = $apiInstance->listContactsV1($groupUuid, $subscriptionStatus, $page); |
| 176 | + print_r($result); |
| 177 | +} catch (Exception $e) { |
| 178 | + echo 'Exception when calling ReachContactsApi->listContactsV1: ', $e->getMessage(), PHP_EOL; |
| 179 | +} |
| 180 | +``` |
| 181 | + |
| 182 | +### Parameters |
| 183 | + |
| 184 | +| Name | Type | Description | Notes | |
| 185 | +| ------------- | ------------- | ------------- | ------------- | |
| 186 | +| **groupUuid** | **string**| Filter contacts by group UUID | [optional] | |
| 187 | +| **subscriptionStatus** | **string**| Filter contacts by subscription status | [optional] | |
| 188 | +| **page** | **int**| Page number | [optional] | |
| 189 | + |
| 190 | +### Return type |
| 191 | + |
| 192 | +[**\Hostinger\Model\ReachListContactsV1200Response**](../Model/ReachListContactsV1200Response.md) |
| 193 | + |
| 194 | +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) |
| 195 | +[[Back to Model list]](../../README.md#models) |
| 196 | +[[Back to README]](../../README.md) |
0 commit comments