Getting started

Libraries

The easiest way to get started with our API is to use one of our libraries. These libraries do all of the hard work for you. Once you've downloaded a library, all you'll need is an API key to get started.

Custom modules

To interact properly with the CSW API your application should have a way for users to submit if a comment is spam or ham, in addition to making comment checks. This makes detection more accurate in the long-run.

API calls

There are 3 API calls available through the CSW API:

API Key for developers

If you are accessing the API server directly, or you are writing your own plugin, you can send the API Key as a POST variable just like the rest of the parameters. The API Key parameter is named HTTP_X_API_KEY.


Key verification

Key Verification verifies if your key is valid. It is called before the other calls.

URL

api.spamwipe.com/1.0/comments/verify-key/

Parameters

All parameters are sent by POST.

SDK example

$csw = new CSW_SDK;
echo $csw->verify_key('API_KEY','client_url');


Comment check

Comment check classify the comment/post/etc. as SPAM or HAM.

URL

api.spamwipe.com/1.0/comments/classify/

Parameters

All parameters are sent by POST.

Return

Returns 'true' if the comment is SPAM, 'false' if HAM and 'hold' if uncertain.

SDK example

$csw = new CSW_SDK;
$param['ip'] = 'IP';
$param['name'] = 'NAME';
$param['email'] = 'EMAIL';
$param['comment'] = 'COMMENT';
$csw->set_params(array('site_lang' => 'fr'));
$csw->set_params(array('site_ip' => '1.1.1.1'));
$csw->api_key('API_KEY');
echo $csw->classify($param);


Mark as SPAM

Mark as SPAM marks the comment/post/etc. as SPAM.

URL

api.spamwipe.com/1.0/comments/markas-spam/

Parameters

All parameters are sent by POST.

SDK example

$csw = new CSW_SDK;
$param['ip'] = 'IP';
$param['name'] = 'NAME';
$param['email'] = 'EMAIL';
$param['comment'] = 'COMMENT';
$csw->set_params(array('site_lang' => 'fr'));
$csw->set_params(array('site_ip' => '1.1.1.1'));
$csw->api_key('API_KEY');
echo $csw->markas_spam($param);


Mark as HAM

Mark as HAM marks the comment/post/etc. as HAM.

URL

api.spamwipe.com/1.0/comments/markas-ham/

Parameters

All parameters are sent by POST.

SDK example

$csw = new CSW_SDK;
$param['ip'] = 'IP';
$param['name'] = 'NAME';
$param['email'] = 'EMAIL';
$param['comment'] = 'COMMENT';
$csw->set_params(array('site_lang' => 'fr'));
$csw->set_params(array('site_ip' => '1.1.1.1'));
$csw->api_key('API_KEY');
echo $csw->markas_ham($param);

Index

API Console


You can test the API calls from our console.