从JavaScript创建共享日历中的事件 [英] Creating an event in a shared calendar from JavaScript

查看:64
本文介绍了从JavaScript创建共享日历中的事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在JavaScript的共享日历中创建一个事件,我收到错误"错误调用API:访问令牌没有对资源的正确权限。"

I am trying to create an event in a shared calendar from JavaScript and I get the error "Error calling API: The access token doesn't have the correct permission for the resource."

我在我的公司帐户中创建了一个共享日历,我与我的个人帐户共享,我已经确定了读写权限(也尝试过共同所有者)我试图从我的个人帐户创建一个事件来自Hotmail日历页面的商业帐户的共享日历
,并且说得很好,因此权限必须良好。

I have created a shared calendar in my business account, I shared it with my personal account, I settled the permissions to read-write (also tried co-owner) I tried to create an event from my personal account into the shared calendar of the business account from the Hotmail calendar page and it word well so the permissions must be good.

当我尝试使用JavaScript创建事件时它运作良好的商业帐户,所以代码是好的,但当我使用个人帐户时,我收到错误"访问令牌没有资源的正确权限。"

When I try to create the event from JavaScript if I use the business account it work well so the code is good but when I use the personal account I get the error "The access token doesn't have the correct permission for the resource."

这里是代码片段:

function onCreateEvent() {
     WL.login({
         scope: "wl.calendars_update"
     }).then(
         function (response) {
             WL.api({
                 path: "calendar.818d2c3f4a244704.51ab4d025d774078a081d95953bc7b68/events",
                 method: "POST",
                 body: {
                     name: "Created Event",
                     description: "Event created in JavaScript",
                     start_time: "2012-12-31T12:00:00-05:00",
                     end_time: "2012-12-31T13:00:00-05:00",
                     location: "Office",
                     is_all_day_event: "false",
                     availability: "busy",
                     visibility: "public"
                 }
             }).then(
                 function (response) {
                     document.getElementById('result').innerHTML =
                         "ID: " + response.id +
                         "<br/>Name: " + response.name;
                 },
                 function (failed) {
                     document.getElementById('error').innerText =
                         "Error calling API: " + failed.error.message;
                 }
             );
         },
         function (failed) {
             document.getElementById('error').innerText =
                 "Error signing in: " + failed.error_description;
         }
     );
 }


知道我做错了什么?

Any idea of what I am doing wrong?

推荐答案

我检查了这一点 - 目前不支持通过Live Connect在共享日历中创建事件。
I checked on this -- creating events in shared calendars via Live Connect is not supported at this time.


这篇关于从JavaScript创建共享日历中的事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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