-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.php
More file actions
59 lines (50 loc) · 1.32 KB
/
Copy pathexample.php
File metadata and controls
59 lines (50 loc) · 1.32 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
59
<?php
$curl_url = 'https://api.jump.bg/api.php';
// Making a request
$curl_post = [
'api_userid' => 'username',
'api_password' => 'password',
'type' => 'domain',
'action' => 'request',
'domain' => 'example.bg,example2.bg|1,example3.bg',
'reg_period' => 1,
];
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => $curl_url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => $curl_post,
]);
$response = curl_exec($curl);
curl_close($curl);
var_dump($response); //It will return the result in JSON
// Registering a domain
$curl_post = [
'api_userid' => 'username',
'api_password' => 'password',
'type' => 'domain',
'action' => 'register',
'domain' => 'example.com',
'reg_period' => 1,
];
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => $curl_url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => $curl_post,
]);
$response = curl_exec($curl);
curl_close($curl);
var_dump($response); //It will return the result in JSON