Can Gmail messages be archived via the API?

混江龙づ霸主 提交于 2019-12-11 03:35:50

问题


It doesn't appear to be possible to archive mail using the API. Archiving in the web interface involves moving, rather than labeling a message to "All Mail". Not only is there no "All Mail" label listed by the API, but move is missing as well. There is only modify and this allows only adding or removing labels from a message. This is strange, because the docs say it's possible to "Create filters to automatically label, forward, or archive messages". Additionally, the filters action API includes only forward, addLabelIds and removeLabelIds.

Is there something I'm not seeing, yet?


回答1:


if you check the documentation filters it appears that you need to remove the label INBOX

action.removeLabelIds=['INBOX']


来源:https://stackoverflow.com/questions/48701092/can-gmail-messages-be-archived-via-the-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!