You are here

public function LingotekApi::createCommunity in Lingotek Translation 7.3

Same name and namespace in other branches
  1. 7.7 lib/Drupal/lingotek/LingotekApi.php \LingotekApi::createCommunity()
  2. 7.2 lib/Drupal/lingotek/LingotekApi.php \LingotekApi::createCommunity()
  3. 7.4 lib/Drupal/lingotek/LingotekApi.php \LingotekApi::createCommunity()
  4. 7.5 lib/Drupal/lingotek/LingotekApi.php \LingotekApi::createCommunity()
  5. 7.6 lib/Drupal/lingotek/LingotekApi.php \LingotekApi::createCommunity()

Calls a Lingotek API to provision a new Community (account). Modified version of the request() method.

Return value

mixed On success, a stdClass object of the returned response data, FALSE on error.

File

lib/Drupal/lingotek/LingotekApi.php, line 1034
Defines Drupal\lingotek\LingotekApi

Class

LingotekApi
@file Defines Drupal\lingotek\LingotekApi

Code

public function createCommunity($parameters = array(), $callback_url = NULL) {
  $credentials = array(
    'consumer_key' => LINGOTEK_AP_OAUTH_KEY,
    'consumer_secret' => LINGOTEK_AP_OAUTH_SECRET,
  );
  if (isset($callback_url)) {
    $parameters['callbackUrl'] = $callback_url;
  }
  $response = $this
    ->request('autoProvisionCommunity', $parameters, 'POST', $credentials);
  return $response;
}