@@ -7,28 +7,32 @@ It's build upon the official API documentation at https://github.com/ssllabs/ssl
7
7
8
8
require_once 'sslLabsApi.php';
9
9
10
+ //Return API response as JSON string
10
11
$api = new sslLabsApi();
11
12
13
+ //Return API response as JSON object
14
+ //$api = new sslLabsApi(true);
15
+
12
16
//Set content-type header for JSON output
13
17
header('Content-Type: application/json');
14
18
15
19
//get API information
16
- echo $api->fetchApiInfo();
20
+ var_dump( $api->fetchApiInfo() );
17
21
18
22
?>
19
23
```
20
-
21
- ## fetchApiInfo()
24
+ ## Methods
25
+ ### fetchApiInfo()
22
26
No parameters needed
23
27
24
28
Returns an Info object (see https://github.com/ssllabs/ssllabs-scan/blob/master/ssllabs-api-docs.md#info ).
25
29
26
- ## fetchStatusCodes()
30
+ ### fetchStatusCodes()
27
31
No parameters needed
28
32
29
33
Returns a StatusCodes instance (see https://github.com/ssllabs/ssllabs-scan/blob/master/ssllabs-api-docs.md#statuscodes ).
30
34
31
- ## fetchHostInformation()
35
+ ### fetchHostInformation()
32
36
See https://github.com/ssllabs/ssllabs-scan/blob/master/ssllabs-api-docs.md#invoke-assessment-and-check-progress for parameter description.
33
37
34
38
| Parameter | Type | Default value | |
@@ -45,7 +49,7 @@ Returns a Host object (see https://github.com/ssllabs/ssllabs-scan/blob/master/s
45
49
46
50
Make sure to check the 'status' attribute inside Host object.
47
51
48
- ## fetchHostInformationCached()
52
+ ### fetchHostInformationCached()
49
53
You can also use fetchHostInformation() with the proper parameters, this is just a helper function.
50
54
51
55
| Parameter | Type | Default value | |
@@ -59,7 +63,7 @@ Returns a Host object (see https://github.com/ssllabs/ssllabs-scan/blob/master/s
59
63
60
64
Also make sure to check the 'status' attribute inside Host object.
61
65
62
- ## fetchEndpointData()
66
+ ### fetchEndpointData()
63
67
See https://github.com/ssllabs/ssllabs-scan/blob/master/ssllabs-api-docs.md#retrieve-detailed-endpoint-information for parameter description.
64
68
65
69
| Parameter | Type | Default value | |
@@ -70,7 +74,7 @@ See https://github.com/ssllabs/ssllabs-scan/blob/master/ssllabs-api-docs.md#retr
70
74
71
75
Returns an Endpoint object (see https://github.com/ssllabs/ssllabs-scan/blob/master/ssllabs-api-docs.md#endpoint ).
72
76
73
- ## Custom API calls
77
+ ### Custom API calls
74
78
Use sendApiRequest() method to create custom API calls.
75
79
76
80
| Parameter | Type | Default value | |
@@ -82,7 +86,17 @@ Use sendApiRequest() method to create custom API calls.
82
86
$api->sendApiRequest('apiCallName', array('p1' => 'p1_value', 'p2' => 'p2_value'));
83
87
```
84
88
85
- ## Example output
89
+ ### getReturnJsonObjects()
90
+ Getter for returnJsonObjects
91
+
92
+ ### setReturnJsonObjects()
93
+ Setter for returnJsonObjects
94
+
95
+ | Parameter | Type | Default value | |
96
+ | -----------------------| ---------| ---------------| ----------|
97
+ | ** returnJsonObjects** | boolean | | Required |
98
+
99
+ ## Example output (as JSON strings)
86
100
### Get API information
87
101
``` PHP
88
102
$api->fetchApiInfo();
@@ -220,4 +234,4 @@ $api->fetchEndpointData('https://www.google.de', '74.125.239.111');
220
234
```
221
235
222
236
# Terms and Conditions
223
- As this is just a PHP library for SSL Labs API please refer to SSL Labs Terms and Conditions at https://www.ssllabs.com/about/terms.html
237
+ As this is just a PHP library for SSL Labs API please refer to SSL Labs terms and conditions at https://www.ssllabs.com/about/terms.html
0 commit comments