Can someone help me out please, Im trying to execute this API. it can be used with multiple languages, Including javascript and PHP, so im trying to use it, because surely it works with construct2 right?
But when using the ajax, i test for a error, and i get one. Nothing specific, just using the AJAX on error event, set text to 'error'.
Well here is the PHP -
// Submit those variables to the server
$post_data = array(
'api_key' => 'f2eb0260b6073a40f4b0b128a66709aaebbeb754',
'game_id' => 'Rf2x0WpI8',
'response' => 'JSON'
);
// Send a request to example.com
$result = post_request('https://www.scoreoid.com/api/getNotification', $post_data);
if ($result['status'] == 'ok'){
// Print headers
echo $result['header'];
echo '<hr />';
// print the result of the whole request:
echo $result['content'];
}
else {
echo 'A error occured: ' . $result['error'];
}
I Also tried to use the javascript version, using the callJS plugin, But I do not know what to call, $.post?
$.post("https://www.scoreoid.com/api/getNotification", { api_key: "f2eb0260b6073a40f4b0b128a66709aaebbeb754", game_id: "Rf2x0WpI8", response: "JSON"},
function(data) {
alert("Data Loaded: " + data);
},
"json"
);