|
| 1 | +# hostinger_api.MailOrdersApi |
| 2 | + |
| 3 | +All URIs are relative to *https://developers.hostinger.com* |
| 4 | + |
| 5 | +Method | HTTP request | Description |
| 6 | +------------- | ------------- | ------------- |
| 7 | +[**get_mail_order_list_v1**](MailOrdersApi.md#get_mail_order_list_v1) | **GET** /api/mail/v1/orders | Get mail order list |
| 8 | + |
| 9 | + |
| 10 | +# **get_mail_order_list_v1** |
| 11 | +> MailGetMailOrderListV1200Response get_mail_order_list_v1(domain=domain, status=status, is_trial=is_trial, sort=sort, page=page, per_page=per_page) |
| 12 | +
|
| 13 | +Get mail order list |
| 14 | + |
| 15 | +Retrieve a paginated list of mail orders associated with your account. |
| 16 | + |
| 17 | +Use this endpoint to monitor your mail services, including their status, |
| 18 | +plan, attached domain, and expiration details. |
| 19 | + |
| 20 | +### Example |
| 21 | + |
| 22 | +* Bearer Authentication (apiToken): |
| 23 | + |
| 24 | +```python |
| 25 | +import hostinger_api |
| 26 | +from hostinger_api.models.mail_get_mail_order_list_v1200_response import MailGetMailOrderListV1200Response |
| 27 | +from hostinger_api.rest import ApiException |
| 28 | +from pprint import pprint |
| 29 | + |
| 30 | + |
| 31 | +# Configure Bearer authorization: apiToken |
| 32 | +configuration = hostinger_api.Configuration( |
| 33 | + access_token = os.environ["BEARER_TOKEN"] |
| 34 | +) |
| 35 | + |
| 36 | +# Enter a context with an instance of the API client |
| 37 | +with hostinger_api.ApiClient(configuration) as api_client: |
| 38 | + # Create an instance of the API class |
| 39 | + api_instance = hostinger_api.MailOrdersApi(api_client) |
| 40 | + domain = 'example.com' # str | Filter orders by domain name (exact match) (optional) |
| 41 | + status = 'active' # str | Filter orders by status (optional) |
| 42 | + is_trial = false # bool | Filter orders by trial state (optional) |
| 43 | + sort = -created_at # str | Sort orders by field. Prefix with `-` for descending order. (optional) (default to -created_at) |
| 44 | + page = 1 # int | Page number (optional) |
| 45 | + per_page = 25 # int | Number of items per page (optional) (default to 25) |
| 46 | + |
| 47 | + try: |
| 48 | + # Get mail order list |
| 49 | + api_response = api_instance.get_mail_order_list_v1(domain=domain, status=status, is_trial=is_trial, sort=sort, page=page, per_page=per_page) |
| 50 | + print("The response of MailOrdersApi->get_mail_order_list_v1:\n") |
| 51 | + pprint(api_response) |
| 52 | + except Exception as e: |
| 53 | + print("Exception when calling MailOrdersApi->get_mail_order_list_v1: %s\n" % e) |
| 54 | +``` |
| 55 | + |
| 56 | + |
| 57 | + |
| 58 | +### Parameters |
| 59 | + |
| 60 | + |
| 61 | +Name | Type | Description | Notes |
| 62 | +------------- | ------------- | ------------- | ------------- |
| 63 | + **domain** | **str**| Filter orders by domain name (exact match) | [optional] |
| 64 | + **status** | **str**| Filter orders by status | [optional] |
| 65 | + **is_trial** | **bool**| Filter orders by trial state | [optional] |
| 66 | + **sort** | **str**| Sort orders by field. Prefix with `-` for descending order. | [optional] [default to -created_at] |
| 67 | + **page** | **int**| Page number | [optional] |
| 68 | + **per_page** | **int**| Number of items per page | [optional] [default to 25] |
| 69 | + |
| 70 | +### Return type |
| 71 | + |
| 72 | +[**MailGetMailOrderListV1200Response**](MailGetMailOrderListV1200Response.md) |
| 73 | + |
| 74 | +### Authorization |
| 75 | + |
| 76 | +[apiToken](../README.md#apiToken) |
| 77 | + |
| 78 | +### HTTP request headers |
| 79 | + |
| 80 | + - **Content-Type**: Not defined |
| 81 | + - **Accept**: application/json |
| 82 | + |
| 83 | +### HTTP response details |
| 84 | + |
| 85 | +| Status code | Description | Response headers | |
| 86 | +|-------------|-------------|------------------| |
| 87 | +**200** | Success response | - | |
| 88 | +**401** | Unauthenticated response | - | |
| 89 | +**422** | Error response | - | |
| 90 | +**500** | Error response | - | |
| 91 | + |
| 92 | +[[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) |
| 93 | + |
0 commit comments