谷歌API客户端JavaScript库 - 404方法调用 [英] Google APIs Client Library for JavaScript - 404 on method call

查看:185
本文介绍了谷歌API客户端JavaScript库 - 404方法调用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

上午起,使用GAPI我所有的应用程序了。

Since this morning all my applications using gapi are down.

我使用:
https://apis.google.com/js/client.js

与我的谷歌的AppEngine应用的端点进行通信,例如:

to communicate with the Endpoints of my Google Appengine applications, for example:

gapi.client.load('public', 'v2', function(){
    gapi.client.public.organizations().execute(function(response){ 
        console.log(response); 
    }); 
}, 'https://XXX.appspot.com/_ah/api');

截至今天所有的呼叫都报以下面的错误消息:

As of today all calls are responded with the following error message:

[{"error":{"code":404,"message":"Not Found","data":[{"domain":"global","reason":"notFound","message":"Not Found"}]},"id":"gapiRpc"}]

我的应用程序不会记录任何错误。
我可以到达终点API资源管理器(/ _ah / API / Explorer)而且没有错误。
我可以让没有错误的HTTP请求调用,例如

My applications are not logging any errors. I can reach the Endpoint API explorer (/_ah/api/explorer) without errors. I can make HTTP-request calls without errors, e.g

https://XXX.appspot.com/_ah/api/public/v2/organizations

在GAPI-object加载没有错误。我的公开端点还装载,我可以使用JavaScript控制台列出所有的方法。

The "gapi"-object is loaded without errors. My "public" endpoint is also loaded and I can list all methods using the javascript console.

我已经报告这个错误给谷歌。

I have reported this error to Google.

任何人有这个问题?没有任何人有任何快速解决方案或解决方法?有我或许错过了一些谷歌更新或API的变化?

Anybody else having this issue? Does anybody have any quick solutions or workarounds? Have I perhaps missed some Google updates or API-changes?

感谢

推荐答案

这似乎是此刻,不限于端点的API的JS客户端库一般的问题,而是影响到所有谷歌的API。

It seems to be a general issue with the JS Client library at the moment, not limited to Endpoints APIs, but affecting all Google APIs.

https://开头code.google.com / p /谷歌API的JavaScript客户端/问题/细节?ID = 136

只有真正的工作围绕不依赖于客户端的JS库(这在过去以及稳定性问题),并构建了http请求自己,这是我所知道的是不是一个快速的解决方案。

Only real "work around" is not to depend on the JS Client Library (which had stability issues in the past as well) and construct the HTTP Requests yourself, which I know isn't a quick solution.

您也可以尝试使用 gapi.client.request 直接REST请求方法,这似乎是在为我的端点API之一。 (再次,不是一个快速解决方案,但可能会更好/更容易,因为你仍然有通过认证的客户端库的工作)。

You can also try using the gapi.client.request method for direct REST requests which seems to be working for one of my endpoints APIs. (again, not a quick solution, but probably better/easier since you still have the authentication working via the client library).

gapi.client.request({
  "path": "/public/v2/organizations",
  "root": "https://XXX.appspot.com/_ah/api"
}).execute(function (response) { 
  console.log(response); 
});

编辑:从链接的问题更新

Update from the linked issue

他们将回滚断更新,这将需要几个小时才能完成(没有准确的ETA还)。

They will be rolling back the broken update which will take several hours to complete (no exact ETA yet).

作为一个快修复您可以将apiVersion明确地添加到每个请求(请注意:在 B 在回滚后可能会改变,但它现在的工作):

As a "quick" fix you can explicitely add the apiVersion to each request (careful: the B might change after the rollback, but it works now):

var request = gapi.client.public.organizations();
request.B.apiVersion = "v2";
request.execute(function (response) {
  console.log(response);
});

编辑2:一切似乎又回到了正常,现在

Edit 2: Everything seems to be back to normal now.

这篇关于谷歌API客户端JavaScript库 - 404方法调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆