|
| 1 | +# Hostinger\AgencyHostingSSLApi |
| 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 | +| [**getWebsiteSSLStatusV1()**](AgencyHostingSSLApi.md#getWebsiteSSLStatusV1) | **GET** /api/agency-hosting/v1/websites/{website_uid}/domains/{domain}/ssl/status | Get website SSL status | |
| 8 | +| [**installWebsiteSSLV1()**](AgencyHostingSSLApi.md#installWebsiteSSLV1) | **POST** /api/agency-hosting/v1/websites/{website_uid}/domains/{domain}/ssl/setup | Install website SSL | |
| 9 | +| [**reinstallWebsiteSSLV1()**](AgencyHostingSSLApi.md#reinstallWebsiteSSLV1) | **POST** /api/agency-hosting/v1/websites/{website_uid}/domains/{domain}/ssl/reinstall | Reinstall website SSL | |
| 10 | +| [**uninstallWebsiteSSLV1()**](AgencyHostingSSLApi.md#uninstallWebsiteSSLV1) | **DELETE** /api/agency-hosting/v1/websites/{website_uid}/domains/{domain}/ssl | Uninstall website SSL | |
| 11 | + |
| 12 | + |
| 13 | +## `getWebsiteSSLStatusV1()` |
| 14 | + |
| 15 | +```php |
| 16 | +getWebsiteSSLStatusV1($websiteUid, $domain): \Hostinger\Model\AgencyHostingV1SslSslStatusResource |
| 17 | +``` |
| 18 | + |
| 19 | +Get website SSL status |
| 20 | + |
| 21 | +Returns the SSL state of one domain of an Agency Plan website: the certificate `status`, whether the certificate was uploaded by the customer, and when it stops being valid. `installing` means a certificate setup is running or retrying; the `ssl_setup` entry of `List website processes` shows the same progress. `active` means a valid certificate is in place: uploaded by the customer, issued by the platform, or a lifetime certificate bought for the domain. `failed` means the last setup gave up and no valid certificate is in place. `expired` means the certificate has run out. `not_installed` means the domain has no certificate and no setup process. Returns 404 when the website or the domain does not exist. |
| 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\AgencyHostingSSLApi(config: $config); |
| 35 | +$websiteUid = zpwlGlp19; // string | Agency Plan website UID |
| 36 | +$domain = mydomain.tld; // string | Domain name |
| 37 | + |
| 38 | +try { |
| 39 | + $result = $apiInstance->getWebsiteSSLStatusV1($websiteUid, $domain); |
| 40 | + print_r($result); |
| 41 | +} catch (Exception $e) { |
| 42 | + echo 'Exception when calling AgencyHostingSSLApi->getWebsiteSSLStatusV1: ', $e->getMessage(), PHP_EOL; |
| 43 | +} |
| 44 | +``` |
| 45 | + |
| 46 | +### Parameters |
| 47 | + |
| 48 | +| Name | Type | Description | Notes | |
| 49 | +| ------------- | ------------- | ------------- | ------------- | |
| 50 | +| **websiteUid** | **string**| Agency Plan website UID | | |
| 51 | +| **domain** | **string**| Domain name | | |
| 52 | + |
| 53 | +### Return type |
| 54 | + |
| 55 | +[**\Hostinger\Model\AgencyHostingV1SslSslStatusResource**](../Model/AgencyHostingV1SslSslStatusResource.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 | +## `installWebsiteSSLV1()` |
| 62 | + |
| 63 | +```php |
| 64 | +installWebsiteSSLV1($websiteUid, $domain): \Hostinger\Model\CommonSuccessEmptyResource |
| 65 | +``` |
| 66 | + |
| 67 | +Install website SSL |
| 68 | + |
| 69 | +Starts a Let's Encrypt certificate setup for the domain and returns at once; the setup runs in the background. `Get website SSL status` reports `installing` while it runs, then `active` or `failed`; the `ssl_setup` entry of `List website processes` shows the same progress. Returns 422 when the domain already has a platform certificate that is not expired, when a certificate process is recorded for the domain (a failed setup counts until it is cleaned up), or when the domain hit its limit of three setups per seven days. Returns 429 when the same domain was requested less than a minute ago, 403 when the website is suspended or locked, and 404 when the website or the domain does not exist. |
| 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\AgencyHostingSSLApi(config: $config); |
| 83 | +$websiteUid = zpwlGlp19; // string | Agency Plan website UID |
| 84 | +$domain = mydomain.tld; // string | Domain name |
| 85 | + |
| 86 | +try { |
| 87 | + $result = $apiInstance->installWebsiteSSLV1($websiteUid, $domain); |
| 88 | + print_r($result); |
| 89 | +} catch (Exception $e) { |
| 90 | + echo 'Exception when calling AgencyHostingSSLApi->installWebsiteSSLV1: ', $e->getMessage(), PHP_EOL; |
| 91 | +} |
| 92 | +``` |
| 93 | + |
| 94 | +### Parameters |
| 95 | + |
| 96 | +| Name | Type | Description | Notes | |
| 97 | +| ------------- | ------------- | ------------- | ------------- | |
| 98 | +| **websiteUid** | **string**| Agency Plan website UID | | |
| 99 | +| **domain** | **string**| Domain name | | |
| 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 | +## `reinstallWebsiteSSLV1()` |
| 110 | + |
| 111 | +```php |
| 112 | +reinstallWebsiteSSLV1($websiteUid, $domain): \Hostinger\Model\CommonSuccessEmptyResource |
| 113 | +``` |
| 114 | + |
| 115 | +Reinstall website SSL |
| 116 | + |
| 117 | +Replaces the Let's Encrypt certificate of the domain: the current platform certificate, when one is recorded, is revoked and removed, then a new setup starts in the background. Returns at once; `Get website SSL status` reports `installing` while it runs, then `active` or `failed`. Returns 422 for free subdomains, when a certificate process is recorded for the domain (a failed setup counts until it is cleaned up), or when the domain hit its limit of three setups per seven days. Returns 429 when the same domain was requested less than a minute ago, and 403 when the website is suspended or locked, and 404 when the website or the domain does not exist. |
| 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\AgencyHostingSSLApi(config: $config); |
| 131 | +$websiteUid = zpwlGlp19; // string | Agency Plan website UID |
| 132 | +$domain = mydomain.tld; // string | Domain name |
| 133 | + |
| 134 | +try { |
| 135 | + $result = $apiInstance->reinstallWebsiteSSLV1($websiteUid, $domain); |
| 136 | + print_r($result); |
| 137 | +} catch (Exception $e) { |
| 138 | + echo 'Exception when calling AgencyHostingSSLApi->reinstallWebsiteSSLV1: ', $e->getMessage(), PHP_EOL; |
| 139 | +} |
| 140 | +``` |
| 141 | + |
| 142 | +### Parameters |
| 143 | + |
| 144 | +| Name | Type | Description | Notes | |
| 145 | +| ------------- | ------------- | ------------- | ------------- | |
| 146 | +| **websiteUid** | **string**| Agency Plan website UID | | |
| 147 | +| **domain** | **string**| Domain name | | |
| 148 | + |
| 149 | +### Return type |
| 150 | + |
| 151 | +[**\Hostinger\Model\CommonSuccessEmptyResource**](../Model/CommonSuccessEmptyResource.md) |
| 152 | + |
| 153 | +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) |
| 154 | +[[Back to Model list]](../../README.md#models) |
| 155 | +[[Back to README]](../../README.md) |
| 156 | + |
| 157 | +## `uninstallWebsiteSSLV1()` |
| 158 | + |
| 159 | +```php |
| 160 | +uninstallWebsiteSSLV1($websiteUid, $domain): \Hostinger\Model\CommonSuccessEmptyResource |
| 161 | +``` |
| 162 | + |
| 163 | +Uninstall website SSL |
| 164 | + |
| 165 | +Removes the platform-issued Let's Encrypt certificate of the domain: the certificate is revoked and deleted before the response, so the domain is no longer served with a platform certificate until a new setup completes. Also succeeds when the domain has no platform certificate to remove. Uploaded (custom) certificates are not affected. Returns 422 when a certificate process is recorded for the domain (a failed setup counts until it is cleaned up), 429 when the same domain was requested less than a minute ago, and 403 when the website is suspended or locked, and 404 when the website or the domain does not exist. |
| 166 | + |
| 167 | +### Example |
| 168 | + |
| 169 | +```php |
| 170 | +<?php |
| 171 | +require_once(__DIR__ . '/vendor/autoload.php'); |
| 172 | + |
| 173 | + |
| 174 | +// Configure Bearer authorization: apiToken |
| 175 | +$config = Hostinger\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); |
| 176 | + |
| 177 | + |
| 178 | +$apiInstance = new Hostinger\Api\AgencyHostingSSLApi(config: $config); |
| 179 | +$websiteUid = zpwlGlp19; // string | Agency Plan website UID |
| 180 | +$domain = mydomain.tld; // string | Domain name |
| 181 | + |
| 182 | +try { |
| 183 | + $result = $apiInstance->uninstallWebsiteSSLV1($websiteUid, $domain); |
| 184 | + print_r($result); |
| 185 | +} catch (Exception $e) { |
| 186 | + echo 'Exception when calling AgencyHostingSSLApi->uninstallWebsiteSSLV1: ', $e->getMessage(), PHP_EOL; |
| 187 | +} |
| 188 | +``` |
| 189 | + |
| 190 | +### Parameters |
| 191 | + |
| 192 | +| Name | Type | Description | Notes | |
| 193 | +| ------------- | ------------- | ------------- | ------------- | |
| 194 | +| **websiteUid** | **string**| Agency Plan website UID | | |
| 195 | +| **domain** | **string**| Domain name | | |
| 196 | + |
| 197 | +### Return type |
| 198 | + |
| 199 | +[**\Hostinger\Model\CommonSuccessEmptyResource**](../Model/CommonSuccessEmptyResource.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