API

We provide API access for interaction with Get & Check service. You need to login to be able to view your API key.

Current API version: 1.0. Min version of API: 1.0

Templates and push messages in html

You can get push notification messages of your community while rendering html on mobile devices. Firstly you need to get device_token (ID of client, unique for for each device). Just put to your html $$device_token$$ and it will replaced by user token while rendering. For example your HTML
device token is '$$device_token$$';
Will be replaced to
device token is '123123_d41d8cd98f00b204e9800998ecf8427e';
Where d41d8cd98f00b204e9800998ecf8427e - device id. After that receive last messages in json via request:
/api/?method=getLastMessages&device_token=$$device_token$$[&offset=0]

Also you can get device OS via $$os$$ (result is [android|ios|win]) param

Example scheme of usage


Our real example for linking devices with TrinityCore (World Of Warcraft emu) - https://github.com/BeLove/getandcheck-trinitycore
Go back to contents

Update HTML content

Request. GET data http://getandcheck.com/api/?method=updateContent&developer_key=_developer_key_&community_id=_community_id_&api_version=1.0

POST data: content=_YOUR_HTML_GOES_HERE_

if success:

{"status":"ok"}

if error:

{"status":"error","message":"_message_"}

Example in PHP with cURL:

<?php
$getParams = array ('developer_key' => '_developer_key_',
                    'method' => 'updateContent',
                    'community_id' => '_your_community_id_',
		'api_version'=>'1.0');
$content = "<!DOCTYPE html>
<html>
<body>
<h1>Hey!</h1>
<p>You just updated your community via Get & Check API!</p>
</body>
</html>";
$url = 'http://getandcheck.com/api/?'.http_build_query($getParams);
if ($ch = curl_init()) {
 $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url );
    curl_setopt($ch, CURLOPT_POST, true );
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true );
    curl_setopt($ch, CURLOPT_POST, true);
    curl_setopt($ch, CURLOPT_POSTFIELDS, 'content='.urlencode($content));
    $result = curl_exec($ch);
    if (curl_errno($ch)) {
        echo 'Error: ' . curl_error( $ch );
    }
    curl_close( $ch );
    echo $result;
} else echo 'Error while init cURL';
Go back to contents

Send push notification

Request. GET data http://getandcheck.com/api/?method=sendPushNotification&developer_key=_developer_key_&community_id=_community_id_&api_version=1.0

POST data: message=_YOUR_MESSAGE_HERE_

if success:

{"status":"ok"}

if error:

{"status":"error","message":"_message_"}

Example in PHP with cURL:

<?php
$getParams = array ('developer_key' => '_developer_key_',
                    'method' => 'sendPushNotification',
                    'community_id' => '_your_community_id_',
		'api_version'=>'1.0');
$message = "Hi to all!";
$url = 'http://getandcheck.com/api/?'.http_build_query($getParams);
if ($ch = curl_init()) {
 $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url );
    curl_setopt($ch, CURLOPT_POST, true );
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true );
    curl_setopt($ch, CURLOPT_POST, true);
    curl_setopt($ch, CURLOPT_POSTFIELDS, 'message='.urlencode($message));
    $result = curl_exec($ch);
    if (curl_errno($ch)) {
        echo 'Error: ' . curl_error( $ch );
    }
    curl_close( $ch );
    echo $result;
} else echo 'Error while init cURL';
Go back to contents

Get my (developer's!) communities

Request. GET data http://getandcheck.com/api/?method=getMyCommunities&developer_key=_developer_key_&api_version=1.0

if success:

{"status":"ok","communities":[{"id":"...}

if error:

{"status":"error","message":"_message_"}