-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdemo.php
68 lines (61 loc) · 1.67 KB
/
demo.php
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
59
60
61
62
63
64
65
66
67
68
<?php
/**
* Authoria DNS Library Demo
* This file demonstrates the usage of the AuthoriaDNS library
* @package AuthoriaDNS
* @author Alex Javadi
* @version 1.0.0
* @since 1.0.0
*/
// Include the Composer autoloader
require_once __DIR__ . '/../vendor/autoload.php';
// Use the AuthoriaDNS namespace
use Javadi\Authoria\Dns\AuthoriaDNS;
// Create a new AuthoriaDNS object
$authoria = new AuthoriaDNS("YOUR_INSTANCE_URL");
// New Verification Request
print_r($authoria->new("example.com"));
// Response:
/*
Array
(
[id] => UUID
[token] => authoria-dns-verification=HASH_TOKEN
[how_to_verify] => Add a TXT record with the value 'authoria-dns-verification=HASH_TOKEN' to your domain's DNS records
)
*/
// Get Verification Request Status
print_r($authoria->verify("YOUR-VERIFICATION-ID"));
// Response:
/*
Array
(
[id] => UUID
[domain] => example.com
[verified] => true || false (boolean)
[status] => PENDING || VERIFIED || EXPIRED || NOT_FOUND (string)
)
*/
// Bulk Verification Request Status
print_r($authoria->bulkVerify(["YOUR-VERIFICATION-ID-1", "YOUR-VERIFICATION-ID-2"]));
// Response:
/*
Array
(
Array
(
[id] => UUID
[domain] => example.com
[verified] => true || false (boolean)
[status] => PENDING || VERIFIED || EXPIRED || NOT_FOUND (string)
)
,
Array
(
[id] => UUID
[domain] => example.com
[verified] => true || false (boolean)
[status] => PENDING || VERIFIED || EXPIRED || NOT_FOUND (string)
)
)
*/