标签: google-calendar-api

未配置Google Calendar API v3访问权限

我正在尝试使用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)

api calendar google-calendar-api google-api

18
推荐指数
3
解决办法
2万
查看次数

嵌入式Google日历:如何设置显示的小时数范围?

给出以下嵌入代码:

<iframe src="https://www.google.com/calendar/embed?
title=2014 PLIDAM International Symposium (Paris)&
dates=20140611/20140615&
mode=WEEK&amp;
showNav=1&amp;
showDate=1&amp;
showPrint=1&amp;
showTabs=1&amp;
showCalendars=0&amp;
showTz=1;
height=600&amp;
wkst=2&amp;
bgcolor=%23666666&amp;
src=vdfmfbp0msroletduigs2qtkoc%40group.calendar.google.com&amp;
color=%232952A3&amp;
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天才能显示/聚焦权利.

在这里小提琴

iframe google-calendar-api google-api

17
推荐指数
1
解决办法
2934
查看次数

Google日历推送通知设置

我正在尝试使用PHP和V3 api为Google日历设置推送通知.

我获得了Auth2.0权限,并且能够从我的应用程序在谷歌上创建事件.现在我想知道用户何时在谷歌日历上进行任何更改(CRUD操作).

这是我的代码:

private $imageService;
public $google_client;
public $google_calendar;

public function __construct()
{
    $this->imageService = new ImageService();
    $this->google_client = new Google_Client();
    $this->google_client->setApplicationName($_ENV['GOOGLE_APP_NAME']);
    $this->google_client->setDeveloperKey($_ENV['GOOGLE_API_KEY']);
    $this->google_client->setClientId($_ENV['CLIENT_ID']);
    $this->google_client->setClientSecret($_ENV['CLIENT_SECRET']);
    $this->google_client->setAccessType('offline');
    $this->google_client->setIncludeGrantedScopes(true);
    $this->google_client->setScopes(array('email', 'profile', 'https://www.googleapis.com/auth/plus.me', 'https://www.googleapis.com/auth/calendar'));
    $this->google_calendar = new Google_Service_Calendar($this->google_client);

}

 public function googleCalendarWatch($uuid){

    $channel =  new Google_Service_Calendar_Channel($this->google_client);
    $channel->setId($uuid);
    $channel->setType('web_hook');
    $channel->setAddress("https://example.com/google/googleNotifications");
    $channel->setExpiration("1919995862000");
    $this->google_calendar->events->watch('primary', $channel);

}
Run Code Online (Sandbox Code Playgroud)

这个输出如下:

Google_Service_Calendar_Channel Object (
    [internal_gapi_mappings:protected] => Array ( ) 
    [address] => 
    [expiration] => 1426272395000 
    [id] => aee2b430-34bf-42bc-a597-ada46db42799 
    [kind] => api#channel 
    [params] => 
    [payload] => 
    [resourceId] => 51IKGpOwCJ6EMraQMUc1_04MODk 
    [resourceUri] => …
Run Code Online (Sandbox Code Playgroud)

php calendar google-calendar-api google-api-php-client

17
推荐指数
1
解决办法
1117
查看次数

Javascript Google Calendar API将日历设置为公开

我正在使用谷歌日历的API来显示我公司日历的精简版.我想让任何人在我的网站上查看我的日历版本.目前,只有我可以查看日历页面,如果我要与任何人共享页面URL,它不起作用 - 他们无法查看任何内容.

我在这里使用谷歌的起始代码:

var CLIENT_ID = 'MYID**';
var SCOPES = ["https://www.googleapis.com/auth/calendar.readonly"];

function checkAuth() {
    gapi.auth.authorize(
      {
        'client_id': CLIENT_ID,
        'scope': SCOPES,
        'immediate': true
      }, handleAuthResult);
}

function handleAuthResult(authResult) {
    var authorizeDiv = document.getElementById('authorize-div');
  loadCalendarApi();
}

function handleAuthClick(event) {
    gapi.auth.authorize({
        client_id: CLIENT_ID, 
        scope: SCOPES, 
        immediate: false
    }, handleAuthResult); 
    return false;
}

function loadCalendarApi() {
    gapi.client.load('calendar', 'v3', listUpcomingEvents);
}

function listUpcomingEvents() {
    var request = gapi.client.calendar.events.list({
        'calendarId': 'iorbmkj57ee8ihnko0va1snif8@group.calendar.google.com',
        'timeMin': '2011-06-03T10:00:00-07:00',
        'showDeleted': false,
        'singleEvents': true,
        'maxResults': 1000,
        'orderBy': 'startTime'
});
Run Code Online (Sandbox Code Playgroud)

但我似乎无法找到将这个日历公之于众的地方.stackoverflow上的两个示例没有解释太多,我似乎无法连接Google的API文档中的任何内容.

javascript calendar google-calendar-api

17
推荐指数
1
解决办法
729
查看次数

如何使用Google的"简单API访问密钥"访问Google日历信息(PHP)?

我正在尝试使用Google API v3访问一个Google日历,并根据此处的文档:http://code.google.com/apis/calendar/v3/using.html#intro和here:https:// code.google.com/apis/console/,我需要的解决方案是"简单API访问"和"服务器应用程序密钥(带IP锁定)".

现在,当我使用以下代码创建页面时:

session_start();

require_once 'fnc/google-api-php-client/src/apiClient.php';
require_once 'fnc/google-api-php-client/src/contrib/apiCalendarService.php';

$apiClient = new apiClient();
$apiClient->setUseObjects(true);
$service = new apiCalendarService($apiClient);

if (isset($_SESSION['oauth_access_token'])) {$apiClient->setAccessToken($_SESSION['oauth_access_token']);
} else {
    $token = $apiClient->authenticate();
    $_SESSION['oauth_access_token'] = $token;
}
Run Code Online (Sandbox Code Playgroud)

在我的"config.php"文件中,我只添加了我的开发键(代替"X"):

global $apiConfig;
$apiConfig = array(
    // True if objects should be returned by the service classes.
    // False if associative arrays should be returned (default behavior).
    'use_objects' => false,

    // The application_name is included in the User-Agent HTTP header.
    'application_name' => …
Run Code Online (Sandbox Code Playgroud)

php google-calendar-api

16
推荐指数
2
解决办法
3万
查看次数

Android日历:如何为日历INSERT编写同步适配器

我基本上想重新打开以下未答复的帖子:

我想利用Android日历提供程序API来创建日历并在其中插入事件.创建的日历不能是本地副本.它必须与Google(在线)日历同步.文档说,为了做到这一点,我必须使用同步适配器.但是我该如何编写这样的同步适配器呢?

到目前为止,我发现以下两个帖子但没有解决方案.

我想为此使用Android日历API而不是Google API,以便用户可以脱机工作.

android google-calendar-api android-calendar

16
推荐指数
1
解决办法
7872
查看次数

如何获得所选国家的国定假日

我正在编写一个允许用户从列表中选择国家/地区的应用.当他们选择一个国家时,会出现该国家的国家法定假日列表.

我见过CalendarProviderGoogle Calendar V3,但它们似乎只提供当前用户的日历.

我怎样才能获得特定国家的国定假日?任何建议都会对我有所帮助.


更新:

我发现这篇文章可以获得JSON格式的假期列表.在此示例中,国家/地区代码由日历ID定义,例如pt_br.brazilian#holiday@group.v.calendar.google.com或en.usa#holiday@group.v.calendar.google.com.

但我找不到任何关于此的文件.是否可以这种方式使用API​​?如果是,我在哪里可以获得这些日历ID?

android calendar google-calendar-api android-calendar

16
推荐指数
1
解决办法
2万
查看次数

Google API刷新令牌限制

我正在开发一个应用程序,我需要访问多个谷歌日历.所有这些日历都来自不同的用户.现在我正在使用OAuth2进行同步.但据我了解,我每个客户端ID只能生成25个刷新令牌.

Note: Save refresh tokens in secure long-term storage and continue to use 
them as long as they remain valid. Limits apply to the number of refresh 
tokens that are issued per client-user combination, and per user across all clients, 
and these limits are different. If your application requests enough refresh tokens 
to go over one of the limits, older refresh tokens stop working.
Run Code Online (Sandbox Code Playgroud)

按照建议,我在我的数据库中保留刷新令牌.但我的问题是,如果我有更多的客户想要同步他们的日历怎么办?有没有办法忽视这个极限?当然没有.我现在想到的只是创建更多客户端ID.有什么建议吗?

oauth google-calendar-api google-api google-oauth google-oauth2

16
推荐指数
1
解决办法
1万
查看次数

如何使用工具栏创建Google日历等下拉视图?

我正在尝试创建类似于Google日历下拉月小部件的内容.

在此输入图像描述

任何帮助将非常感激.

到目前为止,我有一个想法,我需要使用具有可扩展动画的工具栏,但不确定是否正确的方向进入.

android google-calendar-api toolbar dropdownbox

16
推荐指数
1
解决办法
8487
查看次数

如何为GoogleWebAuthorizationBroker.AuthorizeAsync设置return_uri?

我想在我的非MVC .NET Web应用程序中使用Google Calendar API.(这似乎是一个重要的区别.)

我试图在谷歌和Daimto的这个例子中使用这个例子中的代码以及来自这里的一些相关帖子的一些有用的提示.

我写了以下方法:

public void GetUserCredential( String userName )
{
    String clientId = ConfigurationManager.AppSettings[ "Google.ClientId" ];            //From Google Developer console https://console.developers.google.com
    String clientSecret = ConfigurationManager.AppSettings[ "Google.ClientSecret" ];    //From Google Developer console https://console.developers.google.com
    String[] scopes = new string[] {
            Google.Apis.Calendar.v3.CalendarService.Scope.Calendar          
    };

    // here is where we Request the user to give us access, or use the Refresh Token that was previously stored in %AppData%
    UserCredential …
Run Code Online (Sandbox Code Playgroud)

c# asp.net google-calendar-api oauth-2.0

16
推荐指数
2
解决办法
6826
查看次数