JAVA:Google实时索引API 403错误-项目中未使用索引API

JAVA:Google实时索引API 403错误-项目中未使用索引API,java,google-realtime-api,Java,Google Realtime Api,我正试图为谷歌实时索引做一篇文章。我只是想把一个空的atom发送给google——我主要是测试shell,看看将来会有什么amp帖子。我的空atom帖子出现以下错误: "error": { "code": 403, "message": "Google Indexing API has not been used in project api-project-xxx before or it is disabled. Enable it by visiting https://

我正试图为谷歌实时索引做一篇文章。我只是想把一个空的atom发送给google——我主要是测试shell,看看将来会有什么amp帖子。我的空atom帖子出现以下错误:

"error": {
    "code": 403,
    "message": "Google Indexing API has not been used in project api-project-xxx before or it is disabled. 
Enable it by visiting https://console.developers.google.com/apis/api/indexing.googleapis.com/overview?project=api-project-xxx  then retry. 
If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry."    
}
我按照上面的链接看到我没有权限查看那里的内容。。。我得到了一个.json api项目文件,我认为该文件可以作为身份验证文件使用,我不确定问题是否出在使用“api project.json”文件或其他文件上。以下是产生上述错误的基本脚本:

String scopes = "https://www.googleapis.com/auth/indexing";
String endPoint = "https://indexing.googleapis.com/xxx...";
genericUrl = new GenericUrl(endPoint);

httpTransport = GoogleNetHttpTransport.newTrustedTransport();
requestFactory = httpTransport.createRequestFactory();
jsonFactory = new JacksonFactory();
InputStream in = IOUtils.toInputStream("api-project.json");

String atom = "< ... basic atom shell  is here .... >"  
request = requestFactory.buildPostRequest(genericUrl, ByteArrayContent.fromString(null, atom));
credentials = GoogleCredential.fromStream(in, httpTransport, jsonFactory).createScoped(Collections.singleton(scopes));
credentials.initialize(request);
HttpResponse response = request.execute();
String作用域=”https://www.googleapis.com/auth/indexing";
字符串端点=”https://indexing.googleapis.com/xxx...";
genericUrl=新的genericUrl(端点);
httpTransport=GoogleNetHttpTransport.newTrustedTransport();
requestFactory=httpTransport.createRequestFactory();
jsonFactory=新的JacksonFactory();
InputStream in=IOUtils.toInputStream(“api project.json”);
String atom=“<…基本原子壳在这里…”
request=requestFactory.buildPostRequest(genericUrl,ByteArrayContent.fromString(null,atom));
credentials=GoogleCredential.fromStream(in,httpTransport,jsonFactory).createScope(Collections.singleton(scopes));
初始化(请求);
HttpResponse response=request.execute();

这里的任何指导都将不胜感激。非常感谢

上面的脚本很好-脚本之外几乎没有问题。第一个是我们的域名没有为谷歌的项目设置,第二个是我用作凭证的文件。一旦我得到了正确的文件,我得到了回复200