All URIs are relative to https://developers.hostinger.com, except if the operation defines another base path.
| Method | HTTP request | Description |
|---|---|---|
| createDomainForwardingV1() | POST /api/domains/v1/forwarding | Create domain forwarding |
| deleteDomainForwardingV1() | DELETE /api/domains/v1/forwarding/{domain} | Delete domain forwarding |
| getDomainForwardingV1() | GET /api/domains/v1/forwarding/{domain} | Get domain forwarding |
createDomainForwardingV1($domainsV1ForwardingStoreRequest): \Hostinger\Model\DomainsV1ForwardingForwardingResourceCreate domain forwarding
Create domain forwarding configuration. Use this endpoint to set up domain redirects to other URLs.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure Bearer authorization: apiToken
$config = Hostinger\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new Hostinger\Api\DomainsForwardingApi(config: $config);
$domainsV1ForwardingStoreRequest = new \Hostinger\Model\DomainsV1ForwardingStoreRequest(); // \Hostinger\Model\DomainsV1ForwardingStoreRequest
try {
$result = $apiInstance->createDomainForwardingV1($domainsV1ForwardingStoreRequest);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling DomainsForwardingApi->createDomainForwardingV1: ', $e->getMessage(), PHP_EOL;
}| Name | Type | Description | Notes |
|---|---|---|---|
| domainsV1ForwardingStoreRequest | \Hostinger\Model\DomainsV1ForwardingStoreRequest |
\Hostinger\Model\DomainsV1ForwardingForwardingResource
[Back to top] [Back to API list] [Back to Model list] [Back to README]
deleteDomainForwardingV1($domain): \Hostinger\Model\CommonSuccessEmptyResourceDelete domain forwarding
Delete domain forwarding data. Use this endpoint to remove redirect configuration from domains.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure Bearer authorization: apiToken
$config = Hostinger\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new Hostinger\Api\DomainsForwardingApi(config: $config);
$domain = mydomain.tld; // string | Domain name
try {
$result = $apiInstance->deleteDomainForwardingV1($domain);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling DomainsForwardingApi->deleteDomainForwardingV1: ', $e->getMessage(), PHP_EOL;
}| Name | Type | Description | Notes |
|---|---|---|---|
| domain | string | Domain name |
\Hostinger\Model\CommonSuccessEmptyResource
[Back to top] [Back to API list] [Back to Model list] [Back to README]
getDomainForwardingV1($domain): \Hostinger\Model\DomainsV1ForwardingForwardingResourceGet domain forwarding
Retrieve domain forwarding data. Use this endpoint to view current redirect configuration for domains.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure Bearer authorization: apiToken
$config = Hostinger\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new Hostinger\Api\DomainsForwardingApi(config: $config);
$domain = mydomain.tld; // string | Domain name
try {
$result = $apiInstance->getDomainForwardingV1($domain);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling DomainsForwardingApi->getDomainForwardingV1: ', $e->getMessage(), PHP_EOL;
}| Name | Type | Description | Notes |
|---|---|---|---|
| domain | string | Domain name |
\Hostinger\Model\DomainsV1ForwardingForwardingResource
[Back to top] [Back to API list] [Back to Model list] [Back to README]