Drupal日历使用JSON填充的SharePoint Online日历 [英] SharePoint Online Calendar Populated by Drupal Calendar Using JSON

查看:68
本文介绍了Drupal日历使用JSON填充的SharePoint Online日历的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们使用SharePoint Online,而我们的合作伙伴将Drupal用于他们说支持JSON的日历.他们的日历可以在互联网上公开获得.我们的目标是在SharePoint Online网站中拥有一个SharePoint日历,以从事件中提取事件. Drupal日历.他们说我们可以使用JSON来做到这一点.我可以看到SharePoint Online允许在SharePoint列表中的字段级别上添加JSON,但是我无法想象如何使用JSON从其系统中获取日历条目.也许 是否有可以使用的API?如果是这样的话,如果有人可以将我指向如何实现此目标的文档或博客,或者对从何处开始寻找有关这项工作需要进行规划的信息的任何见解,我将不胜感激.

We use SharePoint Online and our partner uses Drupal for a calendar for which they say supports JSON. Their calendar is publicly available on the internet. Our goal is to have a SharePoint calendar in our SharePoint Online site that pulls events from their Drupal calendar. They say that we can use JSON to do this.  I can see that SharePoint Online allows JSON to be added on a field level in a SharePoint list, but I can't image how we could use JSON to get calendar entries from their system.  Perhaps there is an API that could be used?  If so, I would appreciate it if anyone could point me to a document or blog about how this might be accomplished or any insight on where to start to find information about what this work would entail for planning purposes.

谢谢!

推荐答案

要从Drupal获取json数据,您必须联系Drupal或在Drupal相关论坛中发布要求,当您获取json数据时,可以通过REST将事件添加到SharePoint日历中api.

示例代码:

function Insert() {
            var item = {
                "__metadata": { "type": "SP.Data.MyCalendarListItem" },
                "Title": "testEvent-Insert",
                "EventDate": "2018-03-29T02:00:00Z",
                "EndDate": "2018-03-29T04:00:00Z",
                "Description": "<p>​description<br></p>",
                "Category":"Metting"
            };


.ajax({ 网址:_spPageContextInfo.siteAbsoluteUrl +"/_api/web/lists/getbytitle('myCalendar')/Items", 类型:"POST", 数据:JSON.stringify(item), 标头:{ "accept":"application/json; odata = verbose", "X-RequestDigest":
.ajax({ url: _spPageContextInfo.siteAbsoluteUrl + "/_api/web/lists/getbytitle('myCalendar')/Items", type: "POST", data: JSON.stringify(item), headers: { "accept": "application/json;odata=verbose", "X-RequestDigest":


(" #__ REQUESTDIGEST).val(), "content-Type":"application/json; odata = verbose", }, 成功:函数successHandler(data,textStatus,jqXHR){ alert("successHandler" +"textstatus:" + textStatus +"data:" + data); }, 错误:函数errorHandler(xhr,ajaxOptions,thrownError){ alert('请求失败:'+ xhr.status +'\ n'+ thrownError +'\ n'+ xhr.responseText); } }); }
("#__REQUESTDIGEST").val(), "content-Type": "application/json;odata=verbose", }, success: function successHandler(data, textStatus, jqXHR) { alert("successHandler " + "textstatus:" + textStatus + "data: " + data); }, error: function errorHandler(xhr, ajaxOptions, thrownError) { alert('Request failed: ' + xhr.status + '\n' + thrownError + '\n' + xhr.responseText); } }); }

通过下面的REST API获取__metadata信息.


最好的问候,

Lee


这篇关于Drupal日历使用JSON填充的SharePoint Online日历的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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