Reputation: 29
I'm using this slice of code to try to remove the label "INBOX" from a message, but i'm getting error "no label to remove or specify"
message = service.users().messages().modify(userId='me', id=id, body='INBOX').execute();
Upvotes: 0
Views: 815
Reputation: 116968
I think your body is wrong the body is a json object probably something like this
msg_labels = {'removeLabelIds': ['INBOX'], 'addLabelIds': []}
message = service.users().messages().modify(userId=user_id, id=msg_id,
body=msg_labels).execute()
You might want to check the documented example my python is very basic messages.modify python
Upvotes: 1