我正在为 ruby 使用 google-api-client 客户端 gem,并且每当我调用 API 时都会收到 403 Access Not Configured 错误。
require 'google/api_client'
client = Google::APIClient.new
client.authorization = nil
search = client.discovered_api('customsearch')
response = client.execute( search.cse.list, 'key' => '<<MY KEY>>', 'cx' => '<<MY CX>>', 'alt' => 'json', 'q' => 'hello world')
我试图在不使用 OAuth 的情况下进行搜索,而只使用 API 密钥。
任何帮助,将不胜感激。谢谢!