Bernd Wurst commited on 2018-01-24 10:34:58
Zeige 2 geänderte Dateien mit 1 Einfügungen und 26 Löschungen.
| ... | ... |
@@ -16,31 +16,7 @@ Nevertheless, in case you use a significant part of this code, we ask (but not r |
| 16 | 16 |
|
| 17 | 17 |
require_once('contacts.php');
|
| 18 | 18 |
require_once('inc/debug.php');
|
| 19 |
- |
|
| 20 |
-function api_request($method, $input_data) |
|
| 21 |
-{
|
|
| 22 |
- $url = config('http.net-apiurl').'domain/v1/json/'.$method;
|
|
| 23 |
- $input_data['authToken'] = config('http.net-apikey');
|
|
| 24 |
- DEBUG('======= API REQUEST ==========');
|
|
| 25 |
- DEBUG($url); |
|
| 26 |
- DEBUG($input_data); |
|
| 27 |
- $curl = curl_init($url); |
|
| 28 |
- $json = json_encode($input_data); |
|
| 29 |
- curl_setopt($curl, CURLOPT_POST, 1); |
|
| 30 |
- curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); |
|
| 31 |
- curl_setopt($curl, CURLOPT_POSTFIELDS, $json); |
|
| 32 |
- curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
|
|
| 33 |
- $result = curl_exec($curl); |
|
| 34 |
- if ($result === FALSE) {
|
|
| 35 |
- system_failure("API-Anfrage kaputt");
|
|
| 36 |
- } |
|
| 37 |
- DEBUG('==============================');
|
|
| 38 |
- DEBUG($result); |
|
| 39 |
- $output_data = json_decode($result, true); |
|
| 40 |
- DEBUG($output_data); |
|
| 41 |
- return $output_data; |
|
| 42 |
-} |
|
| 43 |
- |
|
| 19 |
+require_once('inc/api.php');
|
|
| 44 | 20 |
|
| 45 | 21 |
|
| 46 | 22 |
function contact_to_apicontact($c) |