|
| 1 | +# Hostinger\ReachContactFieldsApi |
| 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 | +| [**createAContactFieldV1()**](ReachContactFieldsApi.md#createAContactFieldV1) | **POST** /api/reach/v1/profiles/{profileUuid}/contacts/fields | Create a contact field | |
| 8 | +| [**deleteAContactFieldV1()**](ReachContactFieldsApi.md#deleteAContactFieldV1) | **DELETE** /api/reach/v1/profiles/{profileUuid}/contacts/fields/{fieldUuid} | Delete a contact field | |
| 9 | +| [**listContactFieldsV1()**](ReachContactFieldsApi.md#listContactFieldsV1) | **GET** /api/reach/v1/profiles/{profileUuid}/contacts/fields | List contact fields | |
| 10 | +| [**updateAContactFieldV1()**](ReachContactFieldsApi.md#updateAContactFieldV1) | **PATCH** /api/reach/v1/profiles/{profileUuid}/contacts/fields/{fieldUuid} | Update a contact field | |
| 11 | + |
| 12 | + |
| 13 | +## `createAContactFieldV1()` |
| 14 | + |
| 15 | +```php |
| 16 | +createAContactFieldV1($profileUuid, $reachV1ContactsFieldsStoreRequest): \Hostinger\Model\ReachV1ContactsFieldsContactFieldResource |
| 17 | +``` |
| 18 | + |
| 19 | +Create a contact field |
| 20 | + |
| 21 | +Define a new custom contact field in a profile. The `slug` is derived from the label and, like the field type, cannot be changed later. Use the returned uuid to set values on contacts. |
| 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\ReachContactFieldsApi(config: $config); |
| 35 | +$profileUuid = 550e8400-e09b-41d4-a716-400055000000; // string | Profile uuid parameter |
| 36 | +$reachV1ContactsFieldsStoreRequest = new \Hostinger\Model\ReachV1ContactsFieldsStoreRequest(); // \Hostinger\Model\ReachV1ContactsFieldsStoreRequest |
| 37 | + |
| 38 | +try { |
| 39 | + $result = $apiInstance->createAContactFieldV1($profileUuid, $reachV1ContactsFieldsStoreRequest); |
| 40 | + print_r($result); |
| 41 | +} catch (Exception $e) { |
| 42 | + echo 'Exception when calling ReachContactFieldsApi->createAContactFieldV1: ', $e->getMessage(), PHP_EOL; |
| 43 | +} |
| 44 | +``` |
| 45 | + |
| 46 | +### Parameters |
| 47 | + |
| 48 | +| Name | Type | Description | Notes | |
| 49 | +| ------------- | ------------- | ------------- | ------------- | |
| 50 | +| **profileUuid** | **string**| Profile uuid parameter | | |
| 51 | +| **reachV1ContactsFieldsStoreRequest** | [**\Hostinger\Model\ReachV1ContactsFieldsStoreRequest**](../Model/ReachV1ContactsFieldsStoreRequest.md)| | | |
| 52 | + |
| 53 | +### Return type |
| 54 | + |
| 55 | +[**\Hostinger\Model\ReachV1ContactsFieldsContactFieldResource**](../Model/ReachV1ContactsFieldsContactFieldResource.md) |
| 56 | + |
| 57 | +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) |
| 58 | +[[Back to Model list]](../../README.md#models) |
| 59 | +[[Back to README]](../../README.md) |
| 60 | + |
| 61 | +## `deleteAContactFieldV1()` |
| 62 | + |
| 63 | +```php |
| 64 | +deleteAContactFieldV1($profileUuid, $fieldUuid): \Hostinger\Model\CommonSuccessEmptyResource |
| 65 | +``` |
| 66 | + |
| 67 | +Delete a contact field |
| 68 | + |
| 69 | +Delete a custom contact field. Every value contacts hold for the field is deleted with it, and for the choice types so are its options. The contacts themselves are not affected. |
| 70 | + |
| 71 | +### Example |
| 72 | + |
| 73 | +```php |
| 74 | +<?php |
| 75 | +require_once(__DIR__ . '/vendor/autoload.php'); |
| 76 | + |
| 77 | + |
| 78 | +// Configure Bearer authorization: apiToken |
| 79 | +$config = Hostinger\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); |
| 80 | + |
| 81 | + |
| 82 | +$apiInstance = new Hostinger\Api\ReachContactFieldsApi(config: $config); |
| 83 | +$profileUuid = 550e8400-e09b-41d4-a716-400055000000; // string | Profile uuid parameter |
| 84 | +$fieldUuid = 550e8400-e29b-41d4-a716-446655440000; // string | Contact field uuid parameter |
| 85 | + |
| 86 | +try { |
| 87 | + $result = $apiInstance->deleteAContactFieldV1($profileUuid, $fieldUuid); |
| 88 | + print_r($result); |
| 89 | +} catch (Exception $e) { |
| 90 | + echo 'Exception when calling ReachContactFieldsApi->deleteAContactFieldV1: ', $e->getMessage(), PHP_EOL; |
| 91 | +} |
| 92 | +``` |
| 93 | + |
| 94 | +### Parameters |
| 95 | + |
| 96 | +| Name | Type | Description | Notes | |
| 97 | +| ------------- | ------------- | ------------- | ------------- | |
| 98 | +| **profileUuid** | **string**| Profile uuid parameter | | |
| 99 | +| **fieldUuid** | **string**| Contact field uuid parameter | | |
| 100 | + |
| 101 | +### Return type |
| 102 | + |
| 103 | +[**\Hostinger\Model\CommonSuccessEmptyResource**](../Model/CommonSuccessEmptyResource.md) |
| 104 | + |
| 105 | +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) |
| 106 | +[[Back to Model list]](../../README.md#models) |
| 107 | +[[Back to README]](../../README.md) |
| 108 | + |
| 109 | +## `listContactFieldsV1()` |
| 110 | + |
| 111 | +```php |
| 112 | +listContactFieldsV1($profileUuid): \Hostinger\Model\ReachV1ContactsFieldsContactFieldResource[] |
| 113 | +``` |
| 114 | + |
| 115 | +List contact fields |
| 116 | + |
| 117 | +Get the custom contact fields defined in a profile. Custom fields let you store your own attributes on contacts. The returned uuids are what you pass to the contact update endpoint to set values, and choice fields also list the options available to pick from. |
| 118 | + |
| 119 | +### Example |
| 120 | + |
| 121 | +```php |
| 122 | +<?php |
| 123 | +require_once(__DIR__ . '/vendor/autoload.php'); |
| 124 | + |
| 125 | + |
| 126 | +// Configure Bearer authorization: apiToken |
| 127 | +$config = Hostinger\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); |
| 128 | + |
| 129 | + |
| 130 | +$apiInstance = new Hostinger\Api\ReachContactFieldsApi(config: $config); |
| 131 | +$profileUuid = 550e8400-e09b-41d4-a716-400055000000; // string | Profile uuid parameter |
| 132 | + |
| 133 | +try { |
| 134 | + $result = $apiInstance->listContactFieldsV1($profileUuid); |
| 135 | + print_r($result); |
| 136 | +} catch (Exception $e) { |
| 137 | + echo 'Exception when calling ReachContactFieldsApi->listContactFieldsV1: ', $e->getMessage(), PHP_EOL; |
| 138 | +} |
| 139 | +``` |
| 140 | + |
| 141 | +### Parameters |
| 142 | + |
| 143 | +| Name | Type | Description | Notes | |
| 144 | +| ------------- | ------------- | ------------- | ------------- | |
| 145 | +| **profileUuid** | **string**| Profile uuid parameter | | |
| 146 | + |
| 147 | +### Return type |
| 148 | + |
| 149 | +[**\Hostinger\Model\ReachV1ContactsFieldsContactFieldResource[]**](../Model/ReachV1ContactsFieldsContactFieldResource.md) |
| 150 | + |
| 151 | +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) |
| 152 | +[[Back to Model list]](../../README.md#models) |
| 153 | +[[Back to README]](../../README.md) |
| 154 | + |
| 155 | +## `updateAContactFieldV1()` |
| 156 | + |
| 157 | +```php |
| 158 | +updateAContactFieldV1($profileUuid, $fieldUuid, $reachV1ContactsFieldsUpdateRequest): \Hostinger\Model\ReachV1ContactsFieldsContactFieldResource |
| 159 | +``` |
| 160 | + |
| 161 | +Update a contact field |
| 162 | + |
| 163 | +Rename a custom contact field and, for the choice types, replace its option set. Options carrying a uuid are kept and relabelled, options without one are created, and any existing option left out of the list is deleted along with the values contacts hold for it. The field type and slug cannot be changed. |
| 164 | + |
| 165 | +### Example |
| 166 | + |
| 167 | +```php |
| 168 | +<?php |
| 169 | +require_once(__DIR__ . '/vendor/autoload.php'); |
| 170 | + |
| 171 | + |
| 172 | +// Configure Bearer authorization: apiToken |
| 173 | +$config = Hostinger\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); |
| 174 | + |
| 175 | + |
| 176 | +$apiInstance = new Hostinger\Api\ReachContactFieldsApi(config: $config); |
| 177 | +$profileUuid = 550e8400-e09b-41d4-a716-400055000000; // string | Profile uuid parameter |
| 178 | +$fieldUuid = 550e8400-e29b-41d4-a716-446655440000; // string | Contact field uuid parameter |
| 179 | +$reachV1ContactsFieldsUpdateRequest = new \Hostinger\Model\ReachV1ContactsFieldsUpdateRequest(); // \Hostinger\Model\ReachV1ContactsFieldsUpdateRequest |
| 180 | + |
| 181 | +try { |
| 182 | + $result = $apiInstance->updateAContactFieldV1($profileUuid, $fieldUuid, $reachV1ContactsFieldsUpdateRequest); |
| 183 | + print_r($result); |
| 184 | +} catch (Exception $e) { |
| 185 | + echo 'Exception when calling ReachContactFieldsApi->updateAContactFieldV1: ', $e->getMessage(), PHP_EOL; |
| 186 | +} |
| 187 | +``` |
| 188 | + |
| 189 | +### Parameters |
| 190 | + |
| 191 | +| Name | Type | Description | Notes | |
| 192 | +| ------------- | ------------- | ------------- | ------------- | |
| 193 | +| **profileUuid** | **string**| Profile uuid parameter | | |
| 194 | +| **fieldUuid** | **string**| Contact field uuid parameter | | |
| 195 | +| **reachV1ContactsFieldsUpdateRequest** | [**\Hostinger\Model\ReachV1ContactsFieldsUpdateRequest**](../Model/ReachV1ContactsFieldsUpdateRequest.md)| | | |
| 196 | + |
| 197 | +### Return type |
| 198 | + |
| 199 | +[**\Hostinger\Model\ReachV1ContactsFieldsContactFieldResource**](../Model/ReachV1ContactsFieldsContactFieldResource.md) |
| 200 | + |
| 201 | +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) |
| 202 | +[[Back to Model list]](../../README.md#models) |
| 203 | +[[Back to README]](../../README.md) |
0 commit comments