谷歌人/我API中的GoogleJsonResponseException

时间:2018-06-08 17:20:50

标签: android google-api google-oauth google-people

我可以使用其他OAuth客户端ID在调试版本变体中使用Google com.google.api.client.googleapis.json.GoogleJsonResponseException: 400 Bad Request { "code" : 400, "message" : "Invalid JSON payload received. Unknown name \"WP\": Cannot bind query parameter. Field 'WP' could not be found in request message.", "errors" : [ { "message" : "Invalid JSON payload received. Unknown name \"WP\": Cannot bind query parameter. Field 'WP' could not be found in request message.", "domain" : "global", "reason" : "badRequest" } ], "status" : "INVALID_ARGUMENT" } API。但在发布版本类型中,API会提供400 Bad Request(使用版本OAuth Client Id)。我确信这与OAuth客户端ID无关,否则OAuth会失败。以下是错误日志:

android.accounts.Account

People API请求:此处 params 的类型为GoogleAccountCredential credential = GoogleAccountCredential.usingOAuth2( MyActivity.this, Collections.singleton("https://www.googleapis.com/auth/contacts.readonly")); credential.setSelectedAccount(params[0]); PeopleService service = new PeopleService.Builder(HTTP_TRANSPORT, JSON_FACTORY, credential) .setApplicationName(getString(R.string.app_name)) .build(); ListConnectionsResponse connectionsResponse = service .people() .connections() .list("people/me") .setPersonFields("names,emailAddresses") .execute(); return connectionsResponse.getConnections();

<select>
    <option repeat.for="element of elementList" model.bind="element.id">
      ${element.value}   <== How to translate the value ?
    </option>
</select>

0 个答案:

没有答案