Skip to content

Latest commit

 

History

History
148 lines (97 loc) · 4.64 KB

File metadata and controls

148 lines (97 loc) · 4.64 KB

Hostinger\DomainsForwardingApi

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()

createDomainForwardingV1($domainsV1ForwardingStoreRequest): \Hostinger\Model\DomainsV1ForwardingForwardingResource

Create domain forwarding

Create domain forwarding configuration. Use this endpoint to set up domain redirects to other URLs.

Example

<?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;
}

Parameters

Name Type Description Notes
domainsV1ForwardingStoreRequest \Hostinger\Model\DomainsV1ForwardingStoreRequest

Return type

\Hostinger\Model\DomainsV1ForwardingForwardingResource

[Back to top] [Back to API list] [Back to Model list] [Back to README]

deleteDomainForwardingV1()

deleteDomainForwardingV1($domain): \Hostinger\Model\CommonSuccessEmptyResource

Delete domain forwarding

Delete domain forwarding data. Use this endpoint to remove redirect configuration from domains.

Example

<?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;
}

Parameters

Name Type Description Notes
domain string Domain name

Return type

\Hostinger\Model\CommonSuccessEmptyResource

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getDomainForwardingV1()

getDomainForwardingV1($domain): \Hostinger\Model\DomainsV1ForwardingForwardingResource

Get domain forwarding

Retrieve domain forwarding data. Use this endpoint to view current redirect configuration for domains.

Example

<?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;
}

Parameters

Name Type Description Notes
domain string Domain name

Return type

\Hostinger\Model\DomainsV1ForwardingForwardingResource

[Back to top] [Back to API list] [Back to Model list] [Back to README]