|
| 1 | +# hostinger_api.ReachContactsApi |
| 2 | + |
| 3 | +All URIs are relative to *https://developers.hostinger.com* |
| 4 | + |
| 5 | +Method | HTTP request | Description |
| 6 | +------------- | ------------- | ------------- |
| 7 | +[**create_a_new_contact_v1**](ReachContactsApi.md#create_a_new_contact_v1) | **POST** /api/reach/v1/contacts | Create a new contact |
| 8 | +[**delete_a_contact_v1**](ReachContactsApi.md#delete_a_contact_v1) | **DELETE** /api/reach/v1/contacts/{uuid} | Delete a contact |
| 9 | +[**list_contact_groups_v1**](ReachContactsApi.md#list_contact_groups_v1) | **GET** /api/reach/v1/contacts/groups | List contact groups |
| 10 | +[**list_contacts_v1**](ReachContactsApi.md#list_contacts_v1) | **GET** /api/reach/v1/contacts | List contacts |
| 11 | + |
| 12 | + |
| 13 | +# **create_a_new_contact_v1** |
| 14 | +> ReachV1ContactsContactResource create_a_new_contact_v1(reach_v1_contacts_store_request) |
| 15 | +
|
| 16 | +Create a new contact |
| 17 | + |
| 18 | +Create a new contact in the email marketing system. |
| 19 | + |
| 20 | +This endpoint allows you to create a new contact with basic information like name, email, and surname. |
| 21 | +You can optionally assign the contact to specific groups and add notes. |
| 22 | + |
| 23 | +The contact will be automatically subscribed to email communications. |
| 24 | + |
| 25 | +### Example |
| 26 | + |
| 27 | +* Bearer Authentication (apiToken): |
| 28 | + |
| 29 | +```python |
| 30 | +import hostinger_api |
| 31 | +from hostinger_api.models.reach_v1_contacts_contact_resource import ReachV1ContactsContactResource |
| 32 | +from hostinger_api.models.reach_v1_contacts_store_request import ReachV1ContactsStoreRequest |
| 33 | +from hostinger_api.rest import ApiException |
| 34 | +from pprint import pprint |
| 35 | + |
| 36 | + |
| 37 | +# Configure Bearer authorization: apiToken |
| 38 | +configuration = hostinger_api.Configuration( |
| 39 | + access_token = os.environ["BEARER_TOKEN"] |
| 40 | +) |
| 41 | + |
| 42 | +# Enter a context with an instance of the API client |
| 43 | +with hostinger_api.ApiClient(configuration) as api_client: |
| 44 | + # Create an instance of the API class |
| 45 | + api_instance = hostinger_api.ReachContactsApi(api_client) |
| 46 | + reach_v1_contacts_store_request = hostinger_api.ReachV1ContactsStoreRequest() # ReachV1ContactsStoreRequest | |
| 47 | + |
| 48 | + try: |
| 49 | + # Create a new contact |
| 50 | + api_response = api_instance.create_a_new_contact_v1(reach_v1_contacts_store_request) |
| 51 | + print("The response of ReachContactsApi->create_a_new_contact_v1:\n") |
| 52 | + pprint(api_response) |
| 53 | + except Exception as e: |
| 54 | + print("Exception when calling ReachContactsApi->create_a_new_contact_v1: %s\n" % e) |
| 55 | +``` |
| 56 | + |
| 57 | + |
| 58 | + |
| 59 | +### Parameters |
| 60 | + |
| 61 | + |
| 62 | +Name | Type | Description | Notes |
| 63 | +------------- | ------------- | ------------- | ------------- |
| 64 | + **reach_v1_contacts_store_request** | [**ReachV1ContactsStoreRequest**](ReachV1ContactsStoreRequest.md)| | |
| 65 | + |
| 66 | +### Return type |
| 67 | + |
| 68 | +[**ReachV1ContactsContactResource**](ReachV1ContactsContactResource.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_v1** |
| 91 | +> CommonSuccessEmptyResource delete_a_contact_v1(uuid) |
| 92 | +
|
| 93 | +Delete a contact |
| 94 | + |
| 95 | +Delete a contact with the specified UUID. |
| 96 | + |
| 97 | +This endpoint permanently removes a contact from the email marketing system. |
| 98 | + |
| 99 | +### Example |
| 100 | + |
| 101 | +* Bearer Authentication (apiToken): |
| 102 | + |
| 103 | +```python |
| 104 | +import hostinger_api |
| 105 | +from hostinger_api.models.common_success_empty_resource import CommonSuccessEmptyResource |
| 106 | +from hostinger_api.rest import ApiException |
| 107 | +from pprint import pprint |
| 108 | + |
| 109 | + |
| 110 | +# Configure Bearer authorization: apiToken |
| 111 | +configuration = hostinger_api.Configuration( |
| 112 | + access_token = os.environ["BEARER_TOKEN"] |
| 113 | +) |
| 114 | + |
| 115 | +# Enter a context with an instance of the API client |
| 116 | +with hostinger_api.ApiClient(configuration) as api_client: |
| 117 | + # Create an instance of the API class |
| 118 | + api_instance = hostinger_api.ReachContactsApi(api_client) |
| 119 | + uuid = 'uuid_example' # str | UUID of the contact to delete |
| 120 | + |
| 121 | + try: |
| 122 | + # Delete a contact |
| 123 | + api_response = api_instance.delete_a_contact_v1(uuid) |
| 124 | + print("The response of ReachContactsApi->delete_a_contact_v1:\n") |
| 125 | + pprint(api_response) |
| 126 | + except Exception as e: |
| 127 | + print("Exception when calling ReachContactsApi->delete_a_contact_v1: %s\n" % e) |
| 128 | +``` |
| 129 | + |
| 130 | + |
| 131 | + |
| 132 | +### Parameters |
| 133 | + |
| 134 | + |
| 135 | +Name | Type | Description | Notes |
| 136 | +------------- | ------------- | ------------- | ------------- |
| 137 | + **uuid** | **str**| UUID of the contact to delete | |
| 138 | + |
| 139 | +### Return type |
| 140 | + |
| 141 | +[**CommonSuccessEmptyResource**](CommonSuccessEmptyResource.md) |
| 142 | + |
| 143 | +### Authorization |
| 144 | + |
| 145 | +[apiToken](../README.md#apiToken) |
| 146 | + |
| 147 | +### HTTP request headers |
| 148 | + |
| 149 | + - **Content-Type**: Not defined |
| 150 | + - **Accept**: application/json |
| 151 | + |
| 152 | +### HTTP response details |
| 153 | + |
| 154 | +| Status code | Description | Response headers | |
| 155 | +|-------------|-------------|------------------| |
| 156 | +**200** | Success response | - | |
| 157 | +**401** | Unauthenticated response | - | |
| 158 | +**500** | Error response | - | |
| 159 | + |
| 160 | +[[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) |
| 161 | + |
| 162 | +# **list_contact_groups_v1** |
| 163 | +> List[ReachV1ContactsGroupsContactGroupResource] list_contact_groups_v1() |
| 164 | +
|
| 165 | +List contact groups |
| 166 | + |
| 167 | +Get a list of all contact groups. |
| 168 | + |
| 169 | +This endpoint returns a list of contact groups that can be used to organize contacts. |
| 170 | + |
| 171 | +### Example |
| 172 | + |
| 173 | +* Bearer Authentication (apiToken): |
| 174 | + |
| 175 | +```python |
| 176 | +import hostinger_api |
| 177 | +from hostinger_api.models.reach_v1_contacts_groups_contact_group_resource import ReachV1ContactsGroupsContactGroupResource |
| 178 | +from hostinger_api.rest import ApiException |
| 179 | +from pprint import pprint |
| 180 | + |
| 181 | + |
| 182 | +# Configure Bearer authorization: apiToken |
| 183 | +configuration = hostinger_api.Configuration( |
| 184 | + access_token = os.environ["BEARER_TOKEN"] |
| 185 | +) |
| 186 | + |
| 187 | +# Enter a context with an instance of the API client |
| 188 | +with hostinger_api.ApiClient(configuration) as api_client: |
| 189 | + # Create an instance of the API class |
| 190 | + api_instance = hostinger_api.ReachContactsApi(api_client) |
| 191 | + |
| 192 | + try: |
| 193 | + # List contact groups |
| 194 | + api_response = api_instance.list_contact_groups_v1() |
| 195 | + print("The response of ReachContactsApi->list_contact_groups_v1:\n") |
| 196 | + pprint(api_response) |
| 197 | + except Exception as e: |
| 198 | + print("Exception when calling ReachContactsApi->list_contact_groups_v1: %s\n" % e) |
| 199 | +``` |
| 200 | + |
| 201 | + |
| 202 | + |
| 203 | +### Parameters |
| 204 | + |
| 205 | +This endpoint does not need any parameter. |
| 206 | + |
| 207 | +### Return type |
| 208 | + |
| 209 | +[**List[ReachV1ContactsGroupsContactGroupResource]**](ReachV1ContactsGroupsContactGroupResource.md) |
| 210 | + |
| 211 | +### Authorization |
| 212 | + |
| 213 | +[apiToken](../README.md#apiToken) |
| 214 | + |
| 215 | +### HTTP request headers |
| 216 | + |
| 217 | + - **Content-Type**: Not defined |
| 218 | + - **Accept**: application/json |
| 219 | + |
| 220 | +### HTTP response details |
| 221 | + |
| 222 | +| Status code | Description | Response headers | |
| 223 | +|-------------|-------------|------------------| |
| 224 | +**200** | Success response | - | |
| 225 | +**401** | Unauthenticated response | - | |
| 226 | +**500** | Error response | - | |
| 227 | + |
| 228 | +[[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) |
| 229 | + |
| 230 | +# **list_contacts_v1** |
| 231 | +> ReachListContactsV1200Response list_contacts_v1(group_uuid=group_uuid, subscription_status=subscription_status, page=page) |
| 232 | +
|
| 233 | +List contacts |
| 234 | + |
| 235 | +Get a list of contacts, optionally filtered by group and subscription status. |
| 236 | + |
| 237 | +This endpoint returns a paginated list of contacts with their basic information. |
| 238 | +You can filter contacts by group UUID and subscription status. |
| 239 | + |
| 240 | +### Example |
| 241 | + |
| 242 | +* Bearer Authentication (apiToken): |
| 243 | + |
| 244 | +```python |
| 245 | +import hostinger_api |
| 246 | +from hostinger_api.models.reach_list_contacts_v1200_response import ReachListContactsV1200Response |
| 247 | +from hostinger_api.rest import ApiException |
| 248 | +from pprint import pprint |
| 249 | + |
| 250 | + |
| 251 | +# Configure Bearer authorization: apiToken |
| 252 | +configuration = hostinger_api.Configuration( |
| 253 | + access_token = os.environ["BEARER_TOKEN"] |
| 254 | +) |
| 255 | + |
| 256 | +# Enter a context with an instance of the API client |
| 257 | +with hostinger_api.ApiClient(configuration) as api_client: |
| 258 | + # Create an instance of the API class |
| 259 | + api_instance = hostinger_api.ReachContactsApi(api_client) |
| 260 | + group_uuid = '550e8400-e29b-41d4-a716-446655440000' # str | Filter contacts by group UUID (optional) |
| 261 | + subscription_status = 'subscribed' # str | Filter contacts by subscription status (optional) |
| 262 | + page = 1 # int | Page number (optional) |
| 263 | + |
| 264 | + try: |
| 265 | + # List contacts |
| 266 | + api_response = api_instance.list_contacts_v1(group_uuid=group_uuid, subscription_status=subscription_status, page=page) |
| 267 | + print("The response of ReachContactsApi->list_contacts_v1:\n") |
| 268 | + pprint(api_response) |
| 269 | + except Exception as e: |
| 270 | + print("Exception when calling ReachContactsApi->list_contacts_v1: %s\n" % e) |
| 271 | +``` |
| 272 | + |
| 273 | + |
| 274 | + |
| 275 | +### Parameters |
| 276 | + |
| 277 | + |
| 278 | +Name | Type | Description | Notes |
| 279 | +------------- | ------------- | ------------- | ------------- |
| 280 | + **group_uuid** | **str**| Filter contacts by group UUID | [optional] |
| 281 | + **subscription_status** | **str**| Filter contacts by subscription status | [optional] |
| 282 | + **page** | **int**| Page number | [optional] |
| 283 | + |
| 284 | +### Return type |
| 285 | + |
| 286 | +[**ReachListContactsV1200Response**](ReachListContactsV1200Response.md) |
| 287 | + |
| 288 | +### Authorization |
| 289 | + |
| 290 | +[apiToken](../README.md#apiToken) |
| 291 | + |
| 292 | +### HTTP request headers |
| 293 | + |
| 294 | + - **Content-Type**: Not defined |
| 295 | + - **Accept**: application/json |
| 296 | + |
| 297 | +### HTTP response details |
| 298 | + |
| 299 | +| Status code | Description | Response headers | |
| 300 | +|-------------|-------------|------------------| |
| 301 | +**200** | Success response | - | |
| 302 | +**401** | Unauthenticated response | - | |
| 303 | +**500** | Error response | - | |
| 304 | + |
| 305 | +[[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) |
| 306 | + |
0 commit comments