1 | <?php |
||
5 | class SandCage { |
||
6 | // Your SandCage API Key |
||
7 | // This can be retrieved from https://www.sandcage.com/panel/api_key |
||
8 | protected $sandcage_api_key = '[YOUR SANDCAGE API KEY]'; |
||
9 | |||
10 | // SandCage API version |
||
11 | protected $sandcage_api_version = '0.2'; |
||
12 | protected $sandcage_api_endpoint_base; |
||
13 | protected $user_agent; |
||
14 | protected $follow_location = false; |
||
15 | protected $timeout = 30; |
||
16 | protected $post_fields; |
||
17 | public $status; |
||
18 | public $response; |
||
19 | |||
20 | public function __construct($sandcage_api_key = null) { |
||
31 | |||
32 | /** |
||
33 | * Send a requst using cURL |
||
34 | * @param string $service endpoint to request |
||
35 | * @param array $payload values to send |
||
36 | * @param string $callback_endpoint to send the callback to. Optional |
||
37 | */ |
||
38 | public function call($service, $payload, $callback_endpoint = '') { |
||
42 | |||
43 | /** |
||
44 | * Send a requst using cURL |
||
45 | * @param string $service_endpoint to request |
||
46 | */ |
||
47 | public function curlCall($service_endpoint) { |
||
65 | |||
66 | /** |
||
67 | * Build the payload array |
||
68 | * @param array $payload values to send |
||
69 | * @param string $callback_endpoint to send the callback to |
||
70 | */ |
||
71 | private function payloadArray($payload, $callback_endpoint) { |
||
78 | } |
||
79 |