protected function _callApiPreparations(
    $httpmethod, $method, $method_template, $params, $multipart, $app_only_auth
  )
  {
    $url             = $this->_getEndpoint($method, $method_template);
    $request_headers = [];
    if ($httpmethod === 'GET') {
      // GET
      list ($authorization, $url) =
        $this->_callApiPreparationsGet($httpmethod, $url, $params, $app_only_auth);
    } else {
      // POST
      list ($authorization, $params, $request_headers) =
        $this->_callApiPreparationsPost($httpmethod, $url, $method, $method_template, $params, $multipart, $app_only_auth);
    }
    if ($app_only_auth) {
      $authorization = $this->_getBearerAuthorization();
    }

    return [
      $authorization, $url, $params, $request_headers
    ];
  }
protected function _callApiPreparations(
    $httpmethod, $method, $method_template, $params, $multipart, $app_only_auth
  )
  {
    $url             = $this->_getEndpoint($method, $method_template);
    $request_headers = [];
    if ($httpmethod === 'GET') {
      // GET
      list ($authorization, $url) =
        $this->_callApiPreparationsGet($httpmethod, $url, $params, $app_only_auth);
    } else {
      // POST
      list ($authorization, $params, $request_headers) =
        $this->_callApiPreparationsPost($httpmethod, $url, $method, $method_template, $params, $multipart, $app_only_auth);
    }
    if ($app_only_auth) {
      $authorization = $this->_getBearerAuthorization();
    }

    return [
      $authorization, $url, $params, $request_headers
    ];
  }
protected function _callApiPreparations ( $ httpmethod , $ method , $ method_template , $ params , $ multipart , $ app_only_auth ) { $ url = $ this -> _getEndpoint ( $ method , $ method_template ) ; $ request_headers = [ ] ; if ( $ httpmethod === 'GET' ) { // GET list ( $ authorization , $ url ) = $ this -> _callApiPreparationsGet ( $ httpmethod , $ url , $ params , $ app_only_auth ) ; } else { // POST list ( $ authorization , $ params , $ request_headers ) = $ this -> _callApiPreparationsPost ( $ httpmethod , $ url , $ method , $ method_template , $ params , $ multipart , $ app_only_auth ) ; } if ( $ app_only_auth ) { $ authorization = $ this -> _getBearerAuthorization ( ) ; } return [ $ authorization , $ url , $ params , $ request_headers ] ; }
Do preparations to make the API call

@param string  $httpmethod      The HTTP method to use for making the request
@param string  $method          The API method to call
@param string  $method_template The API method template to call
@param array   $params          The parameters to send along
@param bool    $multipart       Whether to use multipart/form-data
@param bool    $app_only_auth   Whether to use app-only bearer authentication

@return array (string authorization, string url, array params, array request_headers)
Do preparations to make the API call