Example #1
0
 /**
  * Make an API call.
  *
  * @param string $httpmethod The HTTP method to use. get/post/patch/merge/delete.
  * @param string $apimethod The API endpoint/method to call.
  * @param string $params Additional paramters to include.
  * @param array $options Additional options for the request.
  * @return string The result of the API call.
  */
 public function tenantapicall($httpmethod, $apimethod, $params = '', $options = array())
 {
     $config = get_config('local_o365');
     if (empty($config->aadtenant)) {
         throw new \moodle_exception('erroracplocalo365notconfig', 'local_o365');
     }
     $apimethod = '/' . $config->aadtenant . $apimethod;
     return parent::apicall($httpmethod, $apimethod, $params, $options);
 }
Example #2
0
 /**
  * Make an API call.
  *
  * @param string $httpmethod The HTTP method to use. get/post/patch/merge/delete.
  * @param string $apimethod The API endpoint/method to call.
  * @param string $params Additional paramters to include.
  * @param array $options Additional options for the request.
  * @return string The result of the API call.
  */
 public function apicall($httpmethod, $apimethod, $params = '', $options = array())
 {
     $options['CURLOPT_SSLVERSION'] = 4;
     return parent::apicall($httpmethod, $apimethod, $params, $options);
 }