如何将访问令牌参数发布到Gmail API [英] How to post access token parameter to the Gmail api

查看:106
本文介绍了如何将访问令牌参数发布到Gmail API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用gmail api为某条消息修改某些标签

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

https://developers.google.com/gmail/api/v1/ reference / users / messages / modify
没有说明需要传入访问令牌,如何将访问令牌传递给api来修改messsage的标签?

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

推荐答案

您可以将它放在查询参数中:

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}

或者在Authorization标题中:

Or in the Authorization header:

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

这篇关于如何将访问令牌参数发布到Gmail API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆