我使用新的Gmail API为我的用户创建草稿.API响应提供新创建的消息ID.
然后我可以用URL打开撰写窗口https://mail.google.com/mail/#drafts?compose=[message-id].但是我想打开一个全屏(弹出)组合窗口.是否有URL?当然,必须使用消息ID对此URL进行参数化.
我正在尝试使用Google API的v3从客户的公共日历中获取事件列表.我将日历ID输入API Explorer,我得到了一个积极的结果:
https://www.googleapis.com/calendar/v3/calendars/rpsj44u6koirtq5hehkt21qs6k%40group.calendar.google.com/events?key={YOUR_API_KEY}`
=> [List of events here, as expected]
Run Code Online (Sandbox Code Playgroud)
为了创建API密钥,我在Google Developer Console中创建了一个项目,创建了一个公共API访问密钥(API&auth> Credentials),并{YOUR_API_KEY}在上面替换为我的实际密钥.我确保打开了Calendar API(API和auth> API).当我在浏览器中粘贴此URL时,我收到此错误响应:
{
"error": {
"errors": [
{
"domain": "usageLimits",
"reason": "accessNotConfigured",
"message": "Access Not Configured. The API is not enabled for your project, or there is a per-IP or per-Referer restriction configured on your API key and the request does not match these restrictions. Please use the Google Developers Console to update your configuration.",
"extendedHelp": "https://console.developers.google.com" …Run Code Online (Sandbox Code Playgroud) 关于"G Suite/Google Apps API"的可用性,我有几个问题.我想将某种文档/电子表格/演示文稿管理直接集成到我正在构建的应用程序中.
这项服务必须能够导入和导出到DOC/XLS/PPT/PDF等......所以像Feng Office这样的东西(如果你听说过的话)就不适合这种需要.
为此,我正在研究存在这样的事情.在我开始这项努力之前,我想知道:
对于问题的崩溃列表感到抱歉,但如果有人可以帮助解决这些问题,我们将不胜感激.
spryno724
google-api google-docs google-apps-script google-api-client google-drive-api
我使用google.loader.ClientLocation进行了一些测试:
但我在测试中得到null:
if (google.loader.ClientLocation)
Run Code Online (Sandbox Code Playgroud)
这是谷歌找不到IP信息时的行为.
我搜索了StackOverflow并且有很多关于它的问题,但没有好的答案.
我在网上搜索了这两个链接:
这似乎说应该使用导航器HTML地理位置.
Google API文档不再提及它了.
我想确认谷歌google.loader.clientlocation是否还在工作?
我的代码如下:
<html>
<head>
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
</head>
<body>
<script type="text/javascript">
function geoTest() {
if (google.loader.ClientLocation) {
var latitude = google.loader.ClientLocation.latitude;
var longitude = google.loader.ClientLocation.longitude;
var city = google.loader.ClientLocation.address.city;
var country = google.loader.ClientLocation.address.country;
var country_code = google.loader.ClientLocation.address.country_code;
var region = google.loader.ClientLocation.address.region;
var text = 'Your Location<br /><br />Latitude: ' + latitude + '<br />Longitude: ' + longitude + '<br />City: ' + city + '<br />Country: …Run Code Online (Sandbox Code Playgroud) 给出以下嵌入代码:
<iframe src="https://www.google.com/calendar/embed?
title=2014 PLIDAM International Symposium (Paris)&
dates=20140611/20140615&
mode=WEEK&
showNav=1&
showDate=1&
showPrint=1&
showTabs=1&
showCalendars=0&
showTz=1;
height=600&
wkst=2&
bgcolor=%23666666&
src=vdfmfbp0msroletduigs2qtkoc%40group.calendar.google.com&
color=%232952A3&
ctz=Europe%2FParis"
style=" border:solid 1px #777 " width="800" height="600" frameborder="0" scrolling="no"></iframe>
Run Code Online (Sandbox Code Playgroud)
是否有一个参数来设置从09:00到18:00(下午6点)显示/ focus_on的小时数,即工作时间?几天相同,是否只有4天才能显示/聚焦权利.
我目前正在使用BigQuery做很多事情,而且我正在使用很多东西try... except....看起来我从BigQuery返回的每个错误都是apiclient.errors.HttpError,但附加了不同的字符串,即:
<HttpError 409 when requesting https://www.googleapis.com/bigquery/v2/projects/some_id/datasets/some_dataset/tables?alt=json returned "Already Exists: Table some_id:some_dataset.some_table">
<HttpError 404 when requesting https://www.googleapis.com/bigquery/v2/projects/some_id/jobs/sdfgsdfg?alt=json returned "Not Found: Job some_id:sdfgsdfg">
其中许多人.现在,我看到处理这些问题的唯一方法是对错误消息运行正则表达式,但这很麻烦,绝对不理想.有没有更好的办法?
我正在尝试构建一个用于将视频上传到YouTube的服务器应用程序.在我的服务器应用程序中,用户可以将视频直接上传到我的YouTube频道以公开.

为了使这项工作,我创建了一个虚拟Web应用程序,可以捕获生成的刷新令牌,并将其存储在一个key.txt文件中
{"access_token":"MYTOKEN","token_type":"Bearer","expires_in":3600,"created":1435654774}
Run Code Online (Sandbox Code Playgroud)
该upload_video.php脚本会自动更新"key.txt",如果文件access_token是过时的.这是来自的代码upload_video.php:
$key = file_get_contents('key.txt');
$application_name = 'YouTube_Upload';
$client_secret = 'MY_CLIENT_SECRET';
$client_id = 'MY_CLIENT_ID';
$scope = array('https://www.googleapis.com/auth/youtube.upload', 'https://www.googleapis.com/auth/youtube', 'https://www.googleapis.com/auth/youtubepartner');
$videoPath = "Test.f4v";
$videoTitle = "A tutorial video";
$videoDescription = "A video tutorial on how to upload to YouTube";
$videoCategory = "22";
$videoTags = array("youtube", "tutorial");
try{
// Client init
$client = new Google_Client();
$client->setApplicationName($application_name);
$client->setClientId($client_id);
$client->setAccessType('offline');
$client->setAccessToken($key);
$client->setScopes($scope);
$client->setClientSecret($client_secret);
if ($client->getAccessToken()) {
/**
* Check …Run Code Online (Sandbox Code Playgroud) 我正在使用xmpp客户端进行谷歌聊天.我需要Google Talk ID,其类似于用户的"xxxxx@public.talk.google.com".使用oauth2,我可以获取电子邮件ID(gmail)和其他个人资料信息,但我无法弄清楚如何获取Google聊天ID.
我知道我可以使用电子邮件ID代替Google聊天ID用于所有目的.我需要Google聊天ID,因为我在我的用户表中使用电子邮件ID作为标识符.每当用户在Google聊天(环聊)中收到消息时,我都会将ID从"xxxxx@public.talk.google.com"获取.我无法检查我的用户表中是否有发件人记录.如果我可以在人们使用我的客户端进行身份验证时检索Google聊天ID,我可以将其存储在用户表中,并在用户收到消息时使用它来匹配.
发送邮件工作正常,因为我有目标用户的电子邮件ID,我可以用它来发送邮件.
请建议是否可以获取Google聊天ID
没有关于如何将Java Translate API Cliente库用于java的示例.
在此页面中,Google建议搜索其API的示例,但Google Translate API没有一个示例:https://github.com/google/google-api-java-client-samples
由于我没有找到任何谷歌翻译API的例子,我没有任何关于如何使用他们的官方Java库的线索.
我想提出一个简单的请求,将文本(例如Hello World从英语翻译成西班牙语)与Google制作的官方图书馆:https://developers.google.com/api-client-library/java/apis/translate/v2但没有可供公众使用的文档或示例.
有没有人知道如何在java中使用谷歌翻译API客户端库,我已经google了,我根本没有运气.
我已经将所有jar包含在我的项目中,但是我不知道我必须使用哪些类或者哪些对象实例化以便从一种语言转换为另一种语言.我根本不知道.我只需要像其他Google API的示例存储库中那样简单地剪切代码.
更新2:我重新审视了这个问题,并通过仔细遵循下面链接的doco解决了这个问题.但首先,对于那些正在努力解决这个问题的人来说,你们的团结良好.谷歌有很多版本的doco令人困惑!你在html中包含了platform.js或client.js吗?你加载gapi.auth或gapi.auth2?你使用gapi.auth2.render或gapi.auth.authorize,还是gapi.auth2.init等等.
返回access_token的方式(截至本文日期)在下面链接.我设法通过使用platform.js仔细遵循指南和参考来实现这一点.然后使用gapi.load('drive',callback)动态加载其他库,例如client.js.
https://developers.google.com/identity/sign-in/web/listeners https://developers.google.com/identity/sign-in/web/reference
====繁荣的原始问题====
更新1: 我已更新代码示例以对googleUser对象进行递归搜索.至少这不应该在随后的库中中断.
下面是一个代码片段,用于处理Google gapi.auth2.AuthResponse对象中的access_token不在顶层的问题...它被隐藏:(在对象的深处!
所以它是可以检索的,但不是顶级的!! 我注意到它似乎是一个计时问题...一旦应用程序在后续检查中运行了一段时间,它确实包含顶级访问令牌!
var authResponse = _.googleUser.getAuthResponse();
_.id_token = authResponse.id_token; // Always exists
// access_token should also be a param of authResponse
if (authResponse.access_token) {
debug("Worked this time?");
_.access_token = authResponse.access_token;
} else {
// !!! Internal object access !!!
debug("Attempt to get access token from base object.");
_.access_token = _.objRecursiveSearch("access_token", _.googleUser);
if (_.access_token) {
debug("Access token wasn't on authResponse but was on the base object, WTF?");
} else {
debug("Unable …Run Code Online (Sandbox Code Playgroud) google-api ×10
api ×2
google-oauth ×2
calendar ×1
email ×1
geolocation ×1
gmail ×1
gmail-api ×1
google-docs ×1
google-talk ×1
hangout ×1
html5 ×1
iframe ×1
java ×1
php ×1
python ×1
youtube-api ×1