使用api为谷歌群组添加昵称

时间:2013-07-10 15:47:08

标签: google-groups

我一直在尝试使用directory API为群组添加别名,但这似乎不起作用,此功能是否已经可用? 谢谢!

1 个答案:

答案 0 :(得分:0)

是的,它运作正常。以下是GAM 2.995为您的参考创建域别名的示例。我需要查看代码以确定您遇到问题的位置。

$ touch gam/debug.gam
$ gam create alias test-alias@jay.powerposters.org group testme@jay.powerposters.org

Creating alias test-alias@jay.powerposters.org for group testme@jay.powerposters.org
connect: (www.googleapis.com, 443)
send: 'POST /admin/directory/v1/groups/testme@jay.powerposters.org/aliases?alt=json  HTTP/1.1
Host: www.googleapis.com
content-length: 44
accept-encoding: gzip, deflate
accept: application/json
user-agent: Google Apps Manager 2.995 / jay@ditoweb.com (Jay Lee)
            / Python 2.7.4 final
            / Linux-3.8.0-26-generic-x86_64-with-Ubuntu-13.04-raring x86_64
            / google-api-python-client/1.1
content-type: application/json
authorization: Bearer ya29.XXX

{"alias": "test-alias@jay.powerposters.org"}'

reply: 'HTTP/1.1 200 OK\r\n'
header: Cache-Control: no-cache, no-store, max-age=0, must-revalidate
header: Pragma: no-cache
header: Expires: Fri, 01 Jan 1990 00:00:00 GMT
header: Date: Wed, 10 Jul 2013 17:34:38 GMT
header: ETag: "2rnFeCLM59Q4Hv06VzEjKQtYAxk/uYyLVNg9ntD0jUUkkana74HyFfQ"
header: Content-Type: application/json; charset=UTF-8
header: Content-Encoding: gzip
header: X-Content-Type-Options: nosniff
header: X-Frame-Options: SAMEORIGIN
header: X-XSS-Protection: 1; mode=block
header: Content-Length: 112
header: Server: GSE