• API Schnittstelle
    • Authentification
    • Request
  • JSON - Response
  • XML - Response
  • Downloads



API Schnittstelle

Authentification

PHP Parameter
            						
define("API_ACCESS_TOKEN", "1234567890");
define("API_URL", "https://api.ooekultur-verwaltung.at");
define("API_VERSION", 1);

Authentification per HTTPHeader Bearer
            						
'Authorization:Bearer 1234567890'));
            						
            					

PHP Tutorial
  • PHP CODE
  • FORM
  •             						
    function request($date_begin, $date_end, $search, $sort, $state, $format) {
    $url = API_URL."/repsonse/".API_VERSION."/checkout/index.php";
    $data = "date_begin=".$date_begin."" .
    "&date_end=".$date_end."" .
    "&sort=".$sort."" .
    "&state=".$state."" .
    "&search=".$search."" .
    "&format=".$format."";
    
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_HTTPHEADER, array(
    'Authorization:Bearer '.API_ACCESS_TOKEN.''));
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);// this should be set to true in production
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    $responseData = curl_exec($ch);
    if(curl_errno($ch)) {
    return curl_error($ch);
    }
    curl_close($ch);
    return $responseData;
    }
    
                						
                					
  • API REQUEST

Request

JSON

echo request("2021-01-01", "2021-02-01", "desc", "", "", "JSON");

            					
XML (nicht aktiv)

echo request("2021-01-01", "2021-02-01", "desc", "", "", "XML");

            					

JSON - Response

        							
{"api":{
	"results":[
		{"ID":18629,
			"Von":{
				"date":"2012-04-12 08:00:00.000000",
				"timezone_type":3,
				"timezone":"Europe\/Belgrade"
				},
			"Bis":{
				"date":"2012-04-12 20:00:00.000000",
				"timezone_type":3,
				"timezone":"Europe\/Belgrade"
				},
			"Betreff":"Name",
			"DescriptionLong":"",
			"DescriptionShort":"",
			"Ort":"UH Ursulinensaal",
			"Oeffentlich":0,
			"TypeID":1,
			"Typ":"Veranstaltung",
			"VeranstaltungsstatusID":20,
			"Veranstaltungsstatus":"Anfrage fix",
			"StatusColor":"#ff0000",
			"Bilder": [{
				"Bild_name":"mode.jpg",
				"Bild_src":"BASE64",
				"Bild_default":0
				}]
			createuser	"username"
			createdatetime	"2021-01-14 13:43:20"
			updateuser	"username"
			updatedatetime	"2021-01-14 13:51:34"
		}],
	}
}	
									
        						

XML - Response (nicht aktiv)

        							
<?xml version="1.0"?>
<response>
    <Results>
        <Result/>
    </Results>
</response>
									
        						

Downloads

API - Tutorial als Zip
        							

$api_bearer = ""; // Authorization
$api_version = "1"; // API Version
$api_date_begin = "20210101"; // Zeitraum von
$api_date_end = "20210201"; // Zeitraum bis
$api_search = ""; // nicht aktiv
$api_sort = "DESC"; // nicht aktiv
$api_state = ""; // "","1","0"
$api_format = "JSON"; // JSON, XML nicht aktiv

if(isset($_POST)){
    if(isset($_POST["api-bearer"])){
        $api_bearer = $_POST["api-bearer"];
    }
    if(isset($_POST["api-version"])){
        $api_version = $_POST["api-version"];
    }
    if(isset($_POST["api-date-begin"])){
        $api_date_begin = $_POST["api-date-begin"];
    }
    if(isset($_POST["api-date-end"])){
        $api_date_end = $_POST["api-date-end"];
    }
    if(isset($_POST["api-search"])){
        $api_search = $_POST["api-search"];
    }
    if(isset($_POST["api-sort"])){
        $api_sort = $_POST["api-sort"];
    }
    if(isset($_POST["api-format"])){
        $api_format = $_POST["api-format"];
    }
}
//CODE
define("API_ACCESS_TOKEN",  $api_bearer);
define("API_URL",           "https://api.ooekultur-verwaltung.at");
define("API_VERSION",       $api_version);

function request($date_begin, $date_end, $search, $sort, $state, $format) {
    $url = API_URL."/response/".API_VERSION."/checkout/index.php";
    $data = "date_begin=".$date_begin."" .
        "&date_end=".$date_end."" .
        "&sort=".$sort."" .
        "&state=".$state."" .
        "&search=".$search."" .
        "&format=".$format."";
    
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_HTTPHEADER, array(
        'Authorization:Bearer '.API_ACCESS_TOKEN.''));
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);// this should be set to true in production
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    $responseData = curl_exec($ch);
    if(curl_errno($ch)) {
        return curl_error($ch);
    }
    curl_close($ch);
    return $responseData;
}

header('Content-Type: application/json; charset=utf-8');
echo request($api_date_begin, $api_date_end, $api_search, $api_sort, $api_state,  $api_format);
									
        						
© 2021 Entwickelt by incos . IT-Systemhaus, Version 1.0.0.0