This is an old revision of the document!
This page explains the ways to interact with the Abuse Manager Pro API.
The Abuse Manager Pro API can be consumed from:
https://URL-TO-YOUR-WHMCS/modules/addons/abusemanagerpro/includes/api.php
Action | Description |
---|---|
Create | Creates an abuse report automatically |
Code | Description |
---|---|
AMP001 | TBD |
AMP002 | TBD |
AMP003 | TBD |
AMP004 | TBD |
Action | create |
---|---|
HTTP Method | POST |
Authentication Required | Yes |
Variables | * service_id (required - this is the WHMCS ID of the service that the abuse report will be created for) * category (required - this is the category of abuse - can be any value e.g. 'Spam' or 'High I/O' or 'Hacking Attempts' etc.) * service_ip (optional - if not passed X) * suspend_method (optional - defaults to nosuspend - available options are 'nosuspend', 'immediate', and 'timelimit') * allow_unsuspend (optional - defaults to false - if you want to give the customer the option to self unsuspend set to true) * additional_info (optional - This is the additional information field - this is visible to the customer) * admin_notes (optional - This is the admin notes field - this is only visible to the admins) |
Success JSON Output | "{"status":"success","report_id":92}" |
The example shows how to integrate Clickatell's API using the Custom Dev Kit.
<?php $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://URL-TO-YOUR-WHMCS/modules/addons/abusemanagerpro/includes/api.php'); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query( array( 'action' => 'create', // required - 'create' is to be used to create an abuse report 'service_id' => '1', // required - this is the WHMCS ID of the service that the abuse report will be created for 'category' => 'Spam', // required - this is the category of abuse - can be any value e.g. 'Spam' or 'High I/O' or 'Hacking Attempts' etc. 'service_ip' => '1.2.3.4', // optional - if not passed X 'suspend_method' => 'suspend', // optional - defaults to nosuspend - available options are 'nosuspend', 'immediate', and 'timelimit' 'allow_unsuspend' => true, // optional - defaults to false - if you want to give the customer the option to self unsuspend set to true 'additional_info' => 'This is the additional info field', // optional - This is the additional information field - this is visible to the customer 'admin_notes' => 'This is the admin notes field', // optional - This is the admin notes field - this is only visible to the admins ) ) ); curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'API_ID: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', // required - this header is required for authentication )); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $response = curl_exec($ch); curl_close($ch); ?>