title: Gmail API Python SDK batchModify not working
body: <p>I'm trying to mark some unread emails as read in a batch request using the Gmail API client for python. This is what I'm doing:</p>
  
  <pre><code>response = service.users().messages().list(userId='me', labelIds=['Label_8','UNREAD']).execute()
  msg_ids = []
  
  for msg in response['messages']:
      msg_id = msg['id']
      msg_ids.append(msg_id)
      # do something with the message
  
  print("Marking messages as READ =&gt; %s" % msg_ids)
  body = {'ids': msg_ids, 'addLabelIds': [], 'removeLabelIds': ['UNREAD']}
  resp = service.users().messages().batchModify(userId='me', body=body)
  print("Response ==&gt; %s" % resp.body)
  </code></pre>
  
  <p>In my test there are 2 unread messages, and the final output from above is:</p>
  
  <pre><code>Response ==&gt; {"ids": ["abc123xyz", "abc456xyz"], "removeLabelIds": ["UNREAD"]}
  </code></pre>
  
  <p>...but the messages are not marked as read. There is no error. However, it works if I mark the messages as read individually during the loop using the single version of modify, like this:</p>
  
  <pre><code>response = service.users().messages().list(userId='me', labelIds=['Label_8','UNREAD']).execute()
  msg_ids = []
  
  for msg in response['messages']:
      msg_id = msg['id']
      msg_ids.append(msg_id)
      # do something with the message
  
      body = {'addLabelIds': [], 'removeLabelIds': ['UNREAD']}
      service.users().messages().modify(userId='me', id=msg_id, body=body).execute()
  </code></pre>
  
  <p>But why won't the batch request work? Like I said, there's no error, and I'm using it <a href="https://developers.google.com/resources/api-libraries/documentation/gmail/v1/python/latest/gmail_v1.users.messages.html#batchModify" rel="nofollow noreferrer">exactly as the docs say</a>.</p>