我正在尝试为共享点列表创建一个网络挂钩。不幸的是,唯一的方法是通过调用 API。因此,我调用 API 来创建自己的 Web 挂钩,连接到我的共享点站点中的自定义列表。
我在我的共享点网站中打开了 Chrome 中的开发工具,并使用了以下代码:
fetch("https://my-org.sharepoint.com/sites/my-site/_api/web/lists('list-id')/subscriptions", {
"headers": {
"accept": "application/json",
"content-type": "application/json",
},
"body": "{\"resource\":\"https://my-org.sharepoint.com/sites/my-site/_api/web/lists('list-id')\",\"notificationUrl\":\"http://my-ngrok-id.ngrok.io\",\"expirationDateTime\":\"2021-11-03T21:54:41.000\"}",
"method": "POST",
});
Run Code Online (Sandbox Code Playgroud)
但它给出了一个403
错误:
{
"odata.error": {
"code": "-2130575251, Microsoft.SharePoint.SPException",
"message": {
"lang": "en-US",
"value": "The security validation for this page is invalid and might be corrupted. Please use your web browser's Back button to try your operation again."
}
}
}
Run Code Online (Sandbox Code Playgroud) 在sharepoint托管元数据中,我发现很少有关于使用javascript CSOM管理术语的文档.我可以直接在术语集下创建一个分类术语但我想在另一个术语下创建一个术语作为子项,就像在术语库窗口中一样.
function createTerm(){
//Current Context
var context = SP.ClientContext.get_current();
//Current Taxonomy Session
var taxSession = SP.Taxonomy.TaxonomySession.getTaxonomySession(context);
//Term Stores
var termStores = taxSession.get_termStores();
//Term Store under which to create the term.
var termStore = termStores.getByName("Taxonomy_Dmxzz8tIBzk8wNVKQpJ+xA==");
//Term Set under which to create the term.
var termSet = termStore.getTermSet("b49f64b3-4722-4336-9a5c-56c326b344d4");
//Name of the term, LCID and a new GUID for the term.
var newTerm = termSet.createTerm("India", 1033, "b49f64b3-4722-4336-9a5c-56c326b344a9");
//newTerm.set_isAvailableForTagging(true);
context.load(newTerm);
context.executeQueryAsync(function(){
alert("Term Created: " + newTerm.get_name());
},function(sender,args){
console.log(args.get_message());
});
}
Run Code Online (Sandbox Code Playgroud) 我正在尝试使用以下代码使用Web服务将文件添加到Sharepoint Office365上的文档库中.
public void SaveFileToSharePoint(string fileName)
{
try
{
var copyService = new Copy { Url = "https://mydomain.com/_vti_bin/copy.asmx", Credentials = new NetworkCredential("username", "password", "domain") };
var destURL = "https://mydomain.com/Shared%20Documents/" + Path.GetFileName(fileName);
string[] destinationUrl = { destURL };
CopyResult[] cResultArray;
var fFiledInfo = new FieldInformation { DisplayName = "Description", Type = FieldType.Text, Value = Path.GetFileName(fileName) };
FieldInformation[] fFiledInfoArray = {fFiledInfo};
var copyresult = copyService.CopyIntoItems(destURL, destinationUrl, fFiledInfoArray, File.ReadAllBytes(fileName), out cResultArray);
var b = copyresult;
}
catch (Exception ex)
{
}
}
Run Code Online (Sandbox Code Playgroud)
我收到错误"Object …
我试图授予在SharePoint 2013中使用ClientContext的用户权限。我所做的所有操作与Microsoft网站http://msdn.microsoft.com/zh-cn/library/microsoft.sharepoint.client中的操作完全相同。角色定义绑定集合.add.aspx
但是最后,这部分代码始终返回异常“无法添加具有空角色定义绑定集合的角色分配”:
RoleAssignment oRoleAssignment = w.RoleAssignments.Add(oUser, roleDefBinding);
clientContext.ExecuteQuery();
Run Code Online (Sandbox Code Playgroud)
我搜索了网络,发现与其他一些用户类似的问题,但没有任何答复。有任何想法吗?
我的代码:
clientContext.Load(w.RoleDefinitions);
clientContext.ExecuteQuery();
var role = w.RoleDefinitions.Where(r => r.Name == roleName);
if (role.Count() > 0)
{
RoleDefinition roleMSP = role.First();
clientContext.Load(w.SiteUsers);
clientContext.ExecuteQuery();
var user = w.SiteUsers.Where(u=> u.LoginName == "c:0+.w|s-1-5-21-3493872076-3631449775-1555872641-1347");
if (user.Count() > 0)
{
// Create a new RoleDefinitionBindingCollection object.
RoleDefinitionBindingCollection roleDefBinding = new RoleDefinitionBindingCollection(clientContext);
roleDefBinding.Add(roleMSP);
User oUser = user.First() as User;
clientContext.Load(w.RoleAssignments);
clientContext.ExecuteQuery();
RoleAssignment oRoleAssignment = w.RoleAssignments.Add(oUser, roleDefBinding);
clientContext.ExecuteQuery();//Here I get an exception
}
}
Run Code Online (Sandbox Code Playgroud) 我有一个文档库SP 2013,想要从所有文件夹和子文件夹中获取所有文档.我不想要任何文件夹,但我想从每个文件夹中获取所有文件.
使用SP 2010 U2U CAML Builder,我做了以下查询:
<query>
<QueryOptions>
<ViewAttributes Scope="Recursive" />
</QueryOptions>
</query>
Run Code Online (Sandbox Code Playgroud)
此查询适用于SP 2010中的库,但它不适用于SP 2013
以下是从SP 2013库中获取数据的代码
CAMLQuery = "<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'>\
<soapenv:Body>\
<GetListItems xmlns='http://schemas.microsoft.com/sharepoint/soap/'>\
<listName>My Document Library</listName>\
<query>\
<QueryOptions>\
<ViewAttributes Scope="Recursive" />\
</QueryOptions> \
</query>\
</GetListItems>\
</soapenv:Body>\
</soapenv:Envelope>";
$.ajax({
url: "https://<server>/teams/<siteName>/_vti_bin/lists.asmx",
type: "POST",
dataType: "xml",
data: CAMLQuery,
complete: getGrid,
contentType: "text/xml; charset=\"utf-8\""
});
Run Code Online (Sandbox Code Playgroud)
getGrid是完成时的回调函数
请帮我解决一下这个.
我已经在vmware9.0.1上安装了sharepoint2013,并且我已经上传了一些示例文档.使用ruby我想与sharepoint2013中的thoese文档进行交互.我在谷歌遇到过很多链接,但我没有得到任何绝对的答案.任何人都可以建议我如何通过它.谢谢你提前.
假设我有2个列表:团队和员工.每个团队都有许多员工:
Teams
ID
Name
Employees
ID
Name
TeamID (foreign key of Teams)
Run Code Online (Sandbox Code Playgroud)
是否可以在SharePoint JSOM中编写查询,以便我可以沿着以下行执行某些操作(在查询执行/加载之后):
var employeesListItems = teamListItem.get_item("Employees")
Run Code Online (Sandbox Code Playgroud)
SharePoint对象模型是否以任何方式支持此功能?
澄清:我的意图是尽可能多地重用ClientObject.我知道我可以查询所有员工和所有团队,为每个团队创建一组自定义对象,然后迭代员工并将他们推送到相关Team对象的"Employees"字段.我想避免这样做.
sharepoint sharepoint-2010 sharepoint-clientobject sharepoint-2013
我开始在Xamarin-IOS中创建一个应用程序,我需要在Sharepoint站点中进行身份验证.我正在使用(https://xyz-public.sharepoint.com/_layouts/15/authenticate.aspx?Source=/)
用于身份验证目的的链接.在此期间它要求MS Forefront威胁管理网关进行身份验证所以我的疑问是,有没有办法在应用程序中对我的共享点站点进行身份验证而不使用(Forefront威胁管理门方式) Sharepoint REST API服务.
根据要求,我无法使用Web浏览器进行身份验证过程.
我在共享点认证方面没有太多专业知识.所以请帮助我.我并不期待完整的端到端答案,而是请指导我从我的目的开始实施.
注意:该应用程序在企业环境中运行.
我需要在sharepoint 2013中更新FieldUserValue字段.我只获得了一个电子邮件地址数据.我不能使用EnsureUser,因为它只接受logonName.我使用FromUser方法,但它给我一个错误,上面写着"用户不存在或不是唯一的"
FieldUserValue user = FieldUserValue.FromUser(email);
Run Code Online (Sandbox Code Playgroud)
当我尝试使用我的电子邮件地址时,它工作,但当我在我的数据中使用电子邮件地址时,它会导致错误.我该如何解决这个问题?
我想将Azure Active Directory设置为SharePoint 2013 Foundation的身份提供程序.我从作为另一个基础架构(我公司的基础架构)一部分的帐户激活了Azure试用版.那么我现在拥有的:
因此,在使用Microsoft Azure Active Directory进行SharePoint 2013身份验证的文章后,我收到错误消息
PS C:\Users\tu1> New-MsolServicePrincipal -ServicePrincipalNames @("https://my-ad-name.accesscontrol.windo
ws.net/") -DisplayName "Test ACS Namespace" -Addresses $replyUrl
The following symmetric key was created as one was not supplied m2XQJAeUKEQztjn/sEDJwy8TbG8jPxpw6cemkm8Fnkw=
New-MsolServicePrincipal : Access Denied. You do not have permissions to call this cmdlet.
At line:1 char:1
+ New-MsolServicePrincipal -ServicePrincipalNames @("https://my-ad-name.accesscon ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (:) [New-MsolServicePrincipal], MicrosoftOnlineException
+ FullyQualifiedErrorId : …
Run Code Online (Sandbox Code Playgroud) accesscontrolservice azure azure-powershell sharepoint-2013 azure-active-directory
sharepoint-2013 ×10
sharepoint ×5
c# ×2
csom ×2
azure ×1
caml ×1
javascript ×1
recursion ×1
ruby ×1
taxonomy ×1
vmware ×1
web-services ×1
webhooks ×1
xamarin ×1