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:
- Key verification - used to check if the API Key if valid and matches the site it is used on.
- Comment check - used to check if a comment/post/etc. is SPAM.
- Mark as SPAM or HAM - used to mark a comment/post/etc. as SPAM or HAM.
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.
- key - API Key (string) - required
- site - Site URL (string) - required
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.
- ip - Poster's IP (string) - required
- name - Poster's name (string) - required
- email - Poster's email (string) - required
- comment - Comment (string) - required
- site_ip - Site IP (string) - required
- site_lang - Site language (string) - optional
- client_url - Site URL (string) - optional
- client_referer - Poster's referer (string) - optional
- client_ua - Poster's User Agent (string) - optional
- client_proxy - If the post was proxied ("y"/"n") - optional
- client_lang - Poster's language (string) - optional
- type - Post type - "comment","trackback","pingback","post" or custom (string) - optional
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.
- ip - Poster's IP (string) - required
- name - Poster's name (string) - required
- email - Poster's email (string) - required
- comment - Comment (string) - required
- site_ip - Site IP (string) - required
- site_lang - Site language (string) - optional
- client_url - Site URL (string) - optional
- client_referer - Poster's referer (string) - optional
- client_ua - Poster's User Agent (string) - optional
- client_proxy - If the post was proxied ("y"/"n") - optional
- client_lang - Poster's language (string) - optional
- type - Post type - "comment","trackback","pingback","post" or custom (string) - optional
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.
- ip - Poster's IP (string) - required
- name - Poster's name (string) - required
- email - Poster's email (string) - required
- comment - Comment (string) - required
- site_ip - Site IP (string) - required
- site_lang - Site language (string) - optional
- client_url - Site URL (string) - optional
- client_referer - Poster's referer (string) - optional
- client_ua - Poster's User Agent (string) - optional
- client_proxy - If the post was proxied ("y"/"n") - optional
- client_lang - Poster's language (string) - optional
- type - Post type - "comment","trackback","pingback","post" or custom (string) - optional
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);