code: def sync(self, api_token, sync_token, resource_types='["all"]', **kwargs):
          
          params = {
              'token': api_token,
              'sync_token': sync_token,
          }
          req_func = self._post
          if 'commands' not in kwargs:  # GET if we're not changing data.
              req_func = self._get
              params['resource_types'] = resource_types
          return req_func('sync', params, **kwargs)
docs: Update and retrieve Todoist data.
  
          :param api_token: The user's login api_token.
          :type api_token: str
          :param seq_no: The request sequence number. On initial request pass
              ``0``. On all others pass the last seq_no you received.
          :type seq_no: int
          :param seq_no_global: The request sequence number. On initial request
              pass ``0``. On all others pass the last seq_no you received.
          :type seq_no_global: int
          :param resource_types: Specifies which subset of data you want to
             receive e.g. only projects. Defaults to all data.
          :type resources_types: str
          :param commands: A list of JSON commands to perform.
          :type commands: list (str)
          :return: The HTTP response to the request.
          :rtype: :class:`requests.Response`
  
          >>> from pytodoist.api import TodoistAPI
          >>> api = TodoistAPI()
          >>> response = api.register('john.doe@gmail.com', 'John Doe',
          ...                         'password')
          >>> user_info = response.json()
          >>> api_token = user_info['api_token']
          >>> response = api.sync(api_token, 0, 0, '["projects"]')
          >>> print(response.json())
          {'seq_no_global': 3848029654, 'seq_no': 3848029654, 'Projects': ...}