def body_time_series(resource: nil, start_date: nil, end_date: nil, period: nil)
      unless resource && start_date
        raise FitgemOauth2::InvalidArgumentError, 'resource and start_date are required parameters. Please specify both.'
      end

      url = ['user', user_id, 'body', resource, 'date', format_date(start_date)].join('/')

      second = ''
      if end_date && period
        raise FitgemOauth2::InvalidArgumentError, 'Please specify either period or end date, not both.'
      end

      if period
        if BODY_TIME_SERIES_PERIODS.include?(period)
          second = period
        else
          raise FitgemOauth2::InvalidArgumentError, "Invalid Period. Body time series period must be in #{BODY_TIME_SERIES_PERIODS}"
        end
      end

      if end_date
        second = format_date(end_date)
      end

      url = [url, second].join('/')

      get_call(url + '.json')
    end
def body_time_series(resource: nil, start_date: nil, end_date: nil, period: nil)
      unless resource && start_date
        raise FitgemOauth2::InvalidArgumentError, 'resource and start_date are required parameters. Please specify both.'
      end

      url = ['user', user_id, 'body', resource, 'date', format_date(start_date)].join('/')

      second = ''
      if end_date && period
        raise FitgemOauth2::InvalidArgumentError, 'Please specify either period or end date, not both.'
      end

      if period
        if BODY_TIME_SERIES_PERIODS.include?(period)
          second = period
        else
          raise FitgemOauth2::InvalidArgumentError, "Invalid Period. Body time series period must be in #{BODY_TIME_SERIES_PERIODS}"
        end
      end

      if end_date
        second = format_date(end_date)
      end

      url = [url, second].join('/')

      get_call(url + '.json')
    end
==================================
   Body Time Series
 ==================================
 retrieve body time series for the user; provide at least one of end_date and period
 @param resource (required)the resource requested ['bmi', 'fat', or 'weight']
 @param start_date (required)the start date for the series
 @param end_date (optional)the end date for the series
 @param period (optional)period for the time series. valid periods are BODY_TIME_SERIES_PERIODS