Repository navigation
Expand file tree
/
Copy pathputExample.php
More file actions
58 lines (54 loc) · 1.44 KB
/
Copy pathputExample.php
File metadata and controls
58 lines (54 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<?php
require_once __DIR__ . '/../vendor/autoload.php'; // Autoload files using Composer autoload
/**
* Create a new api-client instance
*
* Replace {yourToken} with your secret token
*
* For further informations please visit
* @see https://developer.checkdomain.de/guide/#1-registration-for-api-access
*/
$client = new \ApiClient\Client(
'v1',
'{yourToken}'
);
/**
* Example: How to replace all nameserver records for a given domain
*
* Replace {domains} with identifier
*
* For further informations please visit
* @see https://developer.checkdomain.de/reference/v1/domains/%7Bdomain%7D/nameservers/records/
*/
$response = $client->put('domains/{domain}/nameservers/records', [
[
'name' => '@',
'value' => '172.0.0.88',
'ttl' => 180,
'priority' => 0,
'type' => 'A',
],[
'name' => '@',
'value' => '172.0.0.99',
'ttl' => 180,
'priority' => 0,
'type' => 'A',
]
]);
var_dump($response);
/**
* Example: How to replace a nameserver record for a given domain
*
* Replace {domains} and {record} with identifier
*
* For further informations please visit
* @see https://developer.checkdomain.de/reference/v1/domains/%7Bdomain%7D/nameservers/records/
*/
$response = $client->put('domains/{domain}/nameservers/records/{record}', [
'name' => '@',
'value' => '172.0.0.88',
'ttl' => 180,
'priority' => 0,
'type' => 'A',
]);
var_dump($response);