You are here

public static function API::method__security_logs in Anti Spam by CleanTalk 9.1.x

Same name and namespace in other branches
  1. 8.4 src/lib/Cleantalk/Common/API.php \Cleantalk\Common\API::method__security_logs()

* Wrapper for security_logs API method. * Sends security logs to the cloud. * *

Parameters

string $api_key: * @param array $data * @param bool $do_check * * @return array|bool|mixed

File

src/lib/Cleantalk/Common/API.php, line 302

Class

API
CleanTalk API class. Mostly contains wrappers for API methods. Check and send mehods. Compatible with any CMS.

Namespace

Cleantalk\Common

Code

public static function method__security_logs($api_key, $data, $do_check = true) {
  $request = array(
    'auth_key' => $api_key,
    'method_name' => 'security_logs',
    'timestamp' => static::getCurrentTimestamp(),
    'data' => json_encode($data),
    'rows' => count($data),
  );
  $result = static::send_request($request);
  $result = $do_check ? static::check_response($result, 'security_logs') : $result;
  return $result;
}