0

我无法让 Google Groups Migration API 正常工作。我可以访问 API,但是一旦获得访问权限,我就无法做任何事情。

developer playground中,在 Select & Authorize APIs 标题下,我将此自定义范围添加到输入字段中:

https://www.googleapis.com/auth/apps.groups.migration

这是谷歌文档中列出的范围,所以我很确定它是正确的。

我同意开发者游乐场的 OAuth 访问,然后在第 2 步中,我可以用访问令牌交换令牌。

问题是在第 3 步,当我按下标有“列出可能的操作”的按钮时,它告诉我没有可用的操作。

总而言之,我能够获得 Google Groups Migration API 的访问令牌,但不允许我执行任何操作。

知道我在这里做错了什么吗?

4

1 回答 1

2

并非所有 API 都列出了可能的操作,因此您需要手动配置操作。根据 Groups Migration archive.insert()参考,您需要:

  1. 将 HTTP 方法设置为“POST”
  2. 将内容类型更改为自定义,“message/rfc822”
  3. 将请求 URI 设置为“ https://www.googleapis.com/upload/groups/v1/groups/GROUPEMAIL/archive?uploadType=media ”(将 GROUPEMAIL 替换为组的实际地址)
  4. 输入如下示例消息的正文请求(确保您具有所有需要的标头,例如 from、to、subject、message-id 等)。

Received: by 10.143.160.15 with HTTP; Mon, 16 Jul 2007 10:12:26 -0700 (PDT) Message-ID: Date: Mon, 16 Jul 2007 10:12:26 -0700 From: "samplesender@example.com" To: "samplegroup@googlegroups.com" Subject: SUBJECT MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Delivered-To: samplegroup@samplegroup.com

This is the body of the migrated email message.

拥有所有这些元素后,发送请求应该会成功,并且您应该会在组存档中看到该消息。

请注意,该 API 仅适用于 Google Groups for Business。您必须以 Google Apps 超级管理员用户身份进行身份验证,并发布到 Google Groups for Business 群组(不以 @googlegroups.com 结尾)。这些要求在文档中有详细说明

于 2014-10-04T15:31:54.530 回答