Google网上论坛迁移API不允许任何API请求

时间:2014-10-01 15:57:33

标签: google-api google-groups google-groups-api

我无法让Google网上论坛迁移API正常运行。我可以访问API,但一旦访问我就无法做任何事情。

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

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

这是Google's docutmention中列出的范围,所以我很确定它是正确的。

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

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

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

知道我在这里做错了吗?

1 个答案:

答案 0 :(得分:2)

并非所有API都列出了可能的操作,因此您需要手动配置操作。根据群组迁移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等)。
  5. 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结尾)。这些要求为spelled out in the documentation