You are here

public static function API::method__get_api_key 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__get_api_key()

* Wrapper for get_api_key API method. * Gets access key automatically. * *

Parameters

string $product_name Type of product: * @param string $email Website admin email * @param string $website Website host * @param string $platform Website platform * @param string|null $timezone * @param string|null $language * @param string|null $user_ip * @param bool $wpms * @param bool $white_label * @param string $hoster_api_key * @param bool $do_check * * @return array|bool|mixed

File

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

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__get_api_key($product_name, $email, $website, $platform, $timezone = null, $language = null, $user_ip = null, $wpms = false, $white_label = false, $hoster_api_key = '', $do_check = true) {
  $request = array(
    'method_name' => 'get_api_key',
    'product_name' => $product_name,
    'email' => $email,
    'website' => $website,
    'platform' => $platform,
    'timezone' => $timezone,
    'http_accept_language' => $language,
    'user_ip' => $user_ip,
    'wpms_setup' => $wpms,
    'hoster_whitelabel' => $white_label,
    'hoster_api_key' => $hoster_api_key,
  );
  $result = static::send_request($request);
  $result = $do_check ? static::check_response($result, 'get_api_key') : $result;
  return $result;
}