protected function _parseBearerReply($result, $httpstatus)
  {
    list($headers, $reply) = $this->_parseApiHeaders($result);
    $reply                 = $this->_parseApiReply($reply);
    $rate                  = $this->_getRateLimitInfo($headers);
    switch ($this->_return_format) {
      case CODEBIRD_RETURNFORMAT_ARRAY:
        $reply['httpstatus'] = $httpstatus;
        $reply['rate']       = $rate;
        if ($httpstatus === 200) {
          self::setBearerToken($reply['access_token']);
        }
        break;
      case CODEBIRD_RETURNFORMAT_JSON:
        if ($httpstatus === 200) {
          $parsed = $this->_json_decode($reply);
          self::setBearerToken($parsed->access_token);
        }
        break;
      case CODEBIRD_RETURNFORMAT_OBJECT:
        $reply->httpstatus = $httpstatus;
        $reply->rate       = $rate;
        if ($httpstatus === 200) {
          self::setBearerToken($reply->access_token);
        }
        break;
    }
    return $reply;
  }