How to post access token parameter to the Gmail api

房东的猫 提交于 2019-12-11 12:46:04

问题


I am using gmail api to modify some label for a certain message below

POST https://www.googleapis.com/gmail/v1/users/userId/messages/id/modify

but the google developer in https://developers.google.com/gmail/api/v1/reference/users/messages/modify did not state the need to pass in the access token, how do I pass the access token to the api to modify the label for the messsage?

Rgds

Vincent


回答1:


You could either put it in a query parameter:

POST https://www.googleapis.com/gmail/v1/users/userId/messages/id/modify?access_token={ACCESS_TOKEN}

Or in the Authorization header:

POST https://www.googleapis.com/gmail/v1/users/userId/messages/id/modify
Authorization: Bearer {ACCESS_TOKEN}


来源:https://stackoverflow.com/questions/35433362/how-to-post-access-token-parameter-to-the-gmail-api

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