Google Directory Admin API in"立即试用"和" API资源管理器",始终返回"错误请求"

时间:2015-10-14 07:32:33

标签: google-api

如果我尝试其他API的API请求,它似乎工作正常,或者至少 - 返回有意义的错误响应。

但是对于Admin API,它总是返回" Bad request",例如:https://developers.google.com/apis-explorer/#search/customer/m/admin/directory_v1/directory.domains.list

我已经设置了所有API访问权限,但仍然没有运气。 例如。: 此请求(使用我正确的Google Apps域名)

enter image description here

始终返回:

400 OK

- Show headers -

{
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "badRequest",
    "message": "Bad Request"
   }
  ],
  "code": 400,
  "message": "Bad Request"
 }
}

1 个答案:

答案 0 :(得分:0)

This is the place, where I finaly found a solution. Step-by-step instruction, I could not find anywhere else. The trick is in correct variable values:

How to Change Primary Domain in Google Apps

From The Source:

  1. Login to your Google Apps Control Panel.
  2. Browse to Google Apps API Page where you change customer information. Make sure you see your Admin email address in to right corner.
  3. Click “Try it now” link.
  4. In “customerKey” field enter “my_customer“.
  5. In “fields” field enter “customerDomain“.
  6. Click “Request body” field, a drop down box will appear & select “customerDomain“.
  7. In the newly appear field, enter your Secondary Domain which you want to change to Primary Domain.
  8. Finally click the blue “AUTHORIZE AND EXECUTE” button.

When the process is done, your secondary domain is converted to Primary Domain and vise versa.