You are here

public function SendinblueMailin::getApiVersion in SendinBlue 7.2

Get the access key store in configuration.

Parameters

string $accessKey: The SiB access key.

Return value

string The SiB API version (V2 or V3)

1 call to SendinblueMailin::getApiVersion()
SendinblueMailin::updateSendinblueMailin in includes/sendinblue.mailin.php
Change Class Class in function of API version.

File

includes/sendinblue.mailin.php, line 90
Rest class file.

Class

SendinblueMailin
Sendinblue REST client.

Code

public function getApiVersion($accessKey = null) {
  if (empty($accessKey)) {
    $accessKey = $this
      ->getAccessKey();
  }
  if (strlen($accessKey) > 20 && strpos($accessKey, 'xkeysib') !== FALSE) {
    return self::SENDINBLUE_API_VERSION_V3;
  }
  return self::SENDINBLUE_API_VERSION_V2;
}