|
| 1 | +# hostinger_api.ReachContactFieldsApi |
| 2 | + |
| 3 | +All URIs are relative to *https://developers.hostinger.com* |
| 4 | + |
| 5 | +Method | HTTP request | Description |
| 6 | +------------- | ------------- | ------------- |
| 7 | +[**create_a_contact_field_v1**](ReachContactFieldsApi.md#create_a_contact_field_v1) | **POST** /api/reach/v1/profiles/{profileUuid}/contacts/fields | Create a contact field |
| 8 | +[**delete_a_contact_field_v1**](ReachContactFieldsApi.md#delete_a_contact_field_v1) | **DELETE** /api/reach/v1/profiles/{profileUuid}/contacts/fields/{fieldUuid} | Delete a contact field |
| 9 | +[**list_contact_fields_v1**](ReachContactFieldsApi.md#list_contact_fields_v1) | **GET** /api/reach/v1/profiles/{profileUuid}/contacts/fields | List contact fields |
| 10 | +[**update_a_contact_field_v1**](ReachContactFieldsApi.md#update_a_contact_field_v1) | **PATCH** /api/reach/v1/profiles/{profileUuid}/contacts/fields/{fieldUuid} | Update a contact field |
| 11 | + |
| 12 | + |
| 13 | +# **create_a_contact_field_v1** |
| 14 | +> ReachV1ContactsFieldsContactFieldResource create_a_contact_field_v1(profile_uuid, reach_v1_contacts_fields_store_request) |
| 15 | +
|
| 16 | +Create a contact field |
| 17 | + |
| 18 | +Define a new custom contact field in a profile. |
| 19 | + |
| 20 | +The `slug` is derived from the label and, like the field type, cannot be changed later. |
| 21 | +Use the returned uuid to set values on contacts. |
| 22 | + |
| 23 | +### Example |
| 24 | + |
| 25 | +* Bearer Authentication (apiToken): |
| 26 | + |
| 27 | +```python |
| 28 | +import hostinger_api |
| 29 | +from hostinger_api.models.reach_v1_contacts_fields_contact_field_resource import ReachV1ContactsFieldsContactFieldResource |
| 30 | +from hostinger_api.models.reach_v1_contacts_fields_store_request import ReachV1ContactsFieldsStoreRequest |
| 31 | +from hostinger_api.rest import ApiException |
| 32 | +from pprint import pprint |
| 33 | + |
| 34 | + |
| 35 | +# Configure Bearer authorization: apiToken |
| 36 | +configuration = hostinger_api.Configuration( |
| 37 | + access_token = os.environ["BEARER_TOKEN"] |
| 38 | +) |
| 39 | + |
| 40 | +# Enter a context with an instance of the API client |
| 41 | +with hostinger_api.ApiClient(configuration) as api_client: |
| 42 | + # Create an instance of the API class |
| 43 | + api_instance = hostinger_api.ReachContactFieldsApi(api_client) |
| 44 | + profile_uuid = '550e8400-e09b-41d4-a716-400055000000' # str | Profile uuid parameter |
| 45 | + reach_v1_contacts_fields_store_request = hostinger_api.ReachV1ContactsFieldsStoreRequest() # ReachV1ContactsFieldsStoreRequest | |
| 46 | + |
| 47 | + try: |
| 48 | + # Create a contact field |
| 49 | + api_response = api_instance.create_a_contact_field_v1(profile_uuid, reach_v1_contacts_fields_store_request) |
| 50 | + print("The response of ReachContactFieldsApi->create_a_contact_field_v1:\n") |
| 51 | + pprint(api_response) |
| 52 | + except Exception as e: |
| 53 | + print("Exception when calling ReachContactFieldsApi->create_a_contact_field_v1: %s\n" % e) |
| 54 | +``` |
| 55 | + |
| 56 | + |
| 57 | + |
| 58 | +### Parameters |
| 59 | + |
| 60 | + |
| 61 | +Name | Type | Description | Notes |
| 62 | +------------- | ------------- | ------------- | ------------- |
| 63 | + **profile_uuid** | **str**| Profile uuid parameter | |
| 64 | + **reach_v1_contacts_fields_store_request** | [**ReachV1ContactsFieldsStoreRequest**](ReachV1ContactsFieldsStoreRequest.md)| | |
| 65 | + |
| 66 | +### Return type |
| 67 | + |
| 68 | +[**ReachV1ContactsFieldsContactFieldResource**](ReachV1ContactsFieldsContactFieldResource.md) |
| 69 | + |
| 70 | +### Authorization |
| 71 | + |
| 72 | +[apiToken](../README.md#apiToken) |
| 73 | + |
| 74 | +### HTTP request headers |
| 75 | + |
| 76 | + - **Content-Type**: application/json |
| 77 | + - **Accept**: application/json |
| 78 | + |
| 79 | +### HTTP response details |
| 80 | + |
| 81 | +| Status code | Description | Response headers | |
| 82 | +|-------------|-------------|------------------| |
| 83 | +**200** | Success response | - | |
| 84 | +**422** | Validation error response | - | |
| 85 | +**401** | Unauthenticated response | - | |
| 86 | +**500** | Error response | - | |
| 87 | + |
| 88 | +[[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) |
| 89 | + |
| 90 | +# **delete_a_contact_field_v1** |
| 91 | +> CommonSuccessEmptyResource delete_a_contact_field_v1(profile_uuid, field_uuid) |
| 92 | +
|
| 93 | +Delete a contact field |
| 94 | + |
| 95 | +Delete a custom contact field. |
| 96 | + |
| 97 | +Every value contacts hold for the field is deleted with it, and for the choice types so |
| 98 | +are its options. The contacts themselves are not affected. |
| 99 | + |
| 100 | +### Example |
| 101 | + |
| 102 | +* Bearer Authentication (apiToken): |
| 103 | + |
| 104 | +```python |
| 105 | +import hostinger_api |
| 106 | +from hostinger_api.models.common_success_empty_resource import CommonSuccessEmptyResource |
| 107 | +from hostinger_api.rest import ApiException |
| 108 | +from pprint import pprint |
| 109 | + |
| 110 | + |
| 111 | +# Configure Bearer authorization: apiToken |
| 112 | +configuration = hostinger_api.Configuration( |
| 113 | + access_token = os.environ["BEARER_TOKEN"] |
| 114 | +) |
| 115 | + |
| 116 | +# Enter a context with an instance of the API client |
| 117 | +with hostinger_api.ApiClient(configuration) as api_client: |
| 118 | + # Create an instance of the API class |
| 119 | + api_instance = hostinger_api.ReachContactFieldsApi(api_client) |
| 120 | + profile_uuid = '550e8400-e09b-41d4-a716-400055000000' # str | Profile uuid parameter |
| 121 | + field_uuid = '550e8400-e29b-41d4-a716-446655440000' # str | Contact field uuid parameter |
| 122 | + |
| 123 | + try: |
| 124 | + # Delete a contact field |
| 125 | + api_response = api_instance.delete_a_contact_field_v1(profile_uuid, field_uuid) |
| 126 | + print("The response of ReachContactFieldsApi->delete_a_contact_field_v1:\n") |
| 127 | + pprint(api_response) |
| 128 | + except Exception as e: |
| 129 | + print("Exception when calling ReachContactFieldsApi->delete_a_contact_field_v1: %s\n" % e) |
| 130 | +``` |
| 131 | + |
| 132 | + |
| 133 | + |
| 134 | +### Parameters |
| 135 | + |
| 136 | + |
| 137 | +Name | Type | Description | Notes |
| 138 | +------------- | ------------- | ------------- | ------------- |
| 139 | + **profile_uuid** | **str**| Profile uuid parameter | |
| 140 | + **field_uuid** | **str**| Contact field uuid parameter | |
| 141 | + |
| 142 | +### Return type |
| 143 | + |
| 144 | +[**CommonSuccessEmptyResource**](CommonSuccessEmptyResource.md) |
| 145 | + |
| 146 | +### Authorization |
| 147 | + |
| 148 | +[apiToken](../README.md#apiToken) |
| 149 | + |
| 150 | +### HTTP request headers |
| 151 | + |
| 152 | + - **Content-Type**: Not defined |
| 153 | + - **Accept**: application/json |
| 154 | + |
| 155 | +### HTTP response details |
| 156 | + |
| 157 | +| Status code | Description | Response headers | |
| 158 | +|-------------|-------------|------------------| |
| 159 | +**200** | Success empty response | - | |
| 160 | +**401** | Unauthenticated response | - | |
| 161 | +**500** | Error response | - | |
| 162 | + |
| 163 | +[[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) |
| 164 | + |
| 165 | +# **list_contact_fields_v1** |
| 166 | +> List[ReachV1ContactsFieldsContactFieldResource] list_contact_fields_v1(profile_uuid) |
| 167 | +
|
| 168 | +List contact fields |
| 169 | + |
| 170 | +Get the custom contact fields defined in a profile. |
| 171 | + |
| 172 | +Custom fields let you store your own attributes on contacts. The returned uuids are what |
| 173 | +you pass to the contact update endpoint to set values, and choice fields also list the |
| 174 | +options available to pick from. |
| 175 | + |
| 176 | +### Example |
| 177 | + |
| 178 | +* Bearer Authentication (apiToken): |
| 179 | + |
| 180 | +```python |
| 181 | +import hostinger_api |
| 182 | +from hostinger_api.models.reach_v1_contacts_fields_contact_field_resource import ReachV1ContactsFieldsContactFieldResource |
| 183 | +from hostinger_api.rest import ApiException |
| 184 | +from pprint import pprint |
| 185 | + |
| 186 | + |
| 187 | +# Configure Bearer authorization: apiToken |
| 188 | +configuration = hostinger_api.Configuration( |
| 189 | + access_token = os.environ["BEARER_TOKEN"] |
| 190 | +) |
| 191 | + |
| 192 | +# Enter a context with an instance of the API client |
| 193 | +with hostinger_api.ApiClient(configuration) as api_client: |
| 194 | + # Create an instance of the API class |
| 195 | + api_instance = hostinger_api.ReachContactFieldsApi(api_client) |
| 196 | + profile_uuid = '550e8400-e09b-41d4-a716-400055000000' # str | Profile uuid parameter |
| 197 | + |
| 198 | + try: |
| 199 | + # List contact fields |
| 200 | + api_response = api_instance.list_contact_fields_v1(profile_uuid) |
| 201 | + print("The response of ReachContactFieldsApi->list_contact_fields_v1:\n") |
| 202 | + pprint(api_response) |
| 203 | + except Exception as e: |
| 204 | + print("Exception when calling ReachContactFieldsApi->list_contact_fields_v1: %s\n" % e) |
| 205 | +``` |
| 206 | + |
| 207 | + |
| 208 | + |
| 209 | +### Parameters |
| 210 | + |
| 211 | + |
| 212 | +Name | Type | Description | Notes |
| 213 | +------------- | ------------- | ------------- | ------------- |
| 214 | + **profile_uuid** | **str**| Profile uuid parameter | |
| 215 | + |
| 216 | +### Return type |
| 217 | + |
| 218 | +[**List[ReachV1ContactsFieldsContactFieldResource]**](ReachV1ContactsFieldsContactFieldResource.md) |
| 219 | + |
| 220 | +### Authorization |
| 221 | + |
| 222 | +[apiToken](../README.md#apiToken) |
| 223 | + |
| 224 | +### HTTP request headers |
| 225 | + |
| 226 | + - **Content-Type**: Not defined |
| 227 | + - **Accept**: application/json |
| 228 | + |
| 229 | +### HTTP response details |
| 230 | + |
| 231 | +| Status code | Description | Response headers | |
| 232 | +|-------------|-------------|------------------| |
| 233 | +**200** | Success response | - | |
| 234 | +**401** | Unauthenticated response | - | |
| 235 | +**500** | Error response | - | |
| 236 | + |
| 237 | +[[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) |
| 238 | + |
| 239 | +# **update_a_contact_field_v1** |
| 240 | +> ReachV1ContactsFieldsContactFieldResource update_a_contact_field_v1(profile_uuid, field_uuid, reach_v1_contacts_fields_update_request) |
| 241 | +
|
| 242 | +Update a contact field |
| 243 | + |
| 244 | +Rename a custom contact field and, for the choice types, replace its option set. |
| 245 | + |
| 246 | +Options carrying a uuid are kept and relabelled, options without one are created, and any |
| 247 | +existing option left out of the list is deleted along with the values contacts hold for |
| 248 | +it. The field type and slug cannot be changed. |
| 249 | + |
| 250 | +### Example |
| 251 | + |
| 252 | +* Bearer Authentication (apiToken): |
| 253 | + |
| 254 | +```python |
| 255 | +import hostinger_api |
| 256 | +from hostinger_api.models.reach_v1_contacts_fields_contact_field_resource import ReachV1ContactsFieldsContactFieldResource |
| 257 | +from hostinger_api.models.reach_v1_contacts_fields_update_request import ReachV1ContactsFieldsUpdateRequest |
| 258 | +from hostinger_api.rest import ApiException |
| 259 | +from pprint import pprint |
| 260 | + |
| 261 | + |
| 262 | +# Configure Bearer authorization: apiToken |
| 263 | +configuration = hostinger_api.Configuration( |
| 264 | + access_token = os.environ["BEARER_TOKEN"] |
| 265 | +) |
| 266 | + |
| 267 | +# Enter a context with an instance of the API client |
| 268 | +with hostinger_api.ApiClient(configuration) as api_client: |
| 269 | + # Create an instance of the API class |
| 270 | + api_instance = hostinger_api.ReachContactFieldsApi(api_client) |
| 271 | + profile_uuid = '550e8400-e09b-41d4-a716-400055000000' # str | Profile uuid parameter |
| 272 | + field_uuid = '550e8400-e29b-41d4-a716-446655440000' # str | Contact field uuid parameter |
| 273 | + reach_v1_contacts_fields_update_request = hostinger_api.ReachV1ContactsFieldsUpdateRequest() # ReachV1ContactsFieldsUpdateRequest | |
| 274 | + |
| 275 | + try: |
| 276 | + # Update a contact field |
| 277 | + api_response = api_instance.update_a_contact_field_v1(profile_uuid, field_uuid, reach_v1_contacts_fields_update_request) |
| 278 | + print("The response of ReachContactFieldsApi->update_a_contact_field_v1:\n") |
| 279 | + pprint(api_response) |
| 280 | + except Exception as e: |
| 281 | + print("Exception when calling ReachContactFieldsApi->update_a_contact_field_v1: %s\n" % e) |
| 282 | +``` |
| 283 | + |
| 284 | + |
| 285 | + |
| 286 | +### Parameters |
| 287 | + |
| 288 | + |
| 289 | +Name | Type | Description | Notes |
| 290 | +------------- | ------------- | ------------- | ------------- |
| 291 | + **profile_uuid** | **str**| Profile uuid parameter | |
| 292 | + **field_uuid** | **str**| Contact field uuid parameter | |
| 293 | + **reach_v1_contacts_fields_update_request** | [**ReachV1ContactsFieldsUpdateRequest**](ReachV1ContactsFieldsUpdateRequest.md)| | |
| 294 | + |
| 295 | +### Return type |
| 296 | + |
| 297 | +[**ReachV1ContactsFieldsContactFieldResource**](ReachV1ContactsFieldsContactFieldResource.md) |
| 298 | + |
| 299 | +### Authorization |
| 300 | + |
| 301 | +[apiToken](../README.md#apiToken) |
| 302 | + |
| 303 | +### HTTP request headers |
| 304 | + |
| 305 | + - **Content-Type**: application/json |
| 306 | + - **Accept**: application/json |
| 307 | + |
| 308 | +### HTTP response details |
| 309 | + |
| 310 | +| Status code | Description | Response headers | |
| 311 | +|-------------|-------------|------------------| |
| 312 | +**200** | Success response | - | |
| 313 | +**422** | Validation error response | - | |
| 314 | +**401** | Unauthenticated response | - | |
| 315 | +**500** | Error response | - | |
| 316 | + |
| 317 | +[[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) |
| 318 | + |
0 commit comments