This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function approveItem(listId,itemId,comment,success,error) { | |
var context = SP.ClientContext.get_current(); | |
var list = context.get_web().get_lists().getById(listId); | |
var item = list.getItemById(itemId); | |
item.set_item('_ModerationStatus',0); | |
item.set_item('_ModerationComments',comment); | |
item.update(); | |
context.executeQueryAsync( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Client") | |
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Client.Runtime") | |
. ".\Invoke-RestSPO.ps1" | |
<# | |
.SYNOPSIS | |
Retieve Folder | |
.DESCRIPTION | |
Read Folder operation via SharePoint 2013 REST API | |
url: http://site url/_api/web/GetFolderByServerRelativeUrl('/Shared Documents') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Client") | |
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Client.Runtime") | |
. ".\Invoke-RestSPO.ps1" | |
<# | |
.SYNOPSIS | |
Retieve Files in Folder | |
.DESCRIPTION | |
Read Files operation via SharePoint 2013 REST API | |
url: http://site url/_api/web/GetFolderByServerRelativeUrl('/Folder Name')/Files |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Net; | |
using Newtonsoft.Json; | |
using Newtonsoft.Json.Linq; | |
namespace SPORestClient | |
{ | |
/// <summary> | |
/// Client for performing CRUD operations against List resource in SharePoint Online (SPO) | |
/// </summary> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Linq; | |
using Microsoft.SharePoint; | |
namespace SharePoint | |
{ | |
internal static class SPFolderExtensions | |
{ | |
/// <summary> | |
/// Ensure SPFolder |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.Synopsis | |
Sends an HTTP or HTTPS request to a SharePoint 2010 REST-compliant web service. | |
.DESCRIPTION | |
This function sends an HTTP or HTTPS request to a Representational State | |
Transfer (REST)-compliant ("RESTful") SharePoint Online web service. | |
.EXAMPLE | |
Invoke-SPRestMethod -Url "https://contoso.sharepoint.com/_vti_bin/ListData.svc/Projects" | |
#> | |
Function Invoke-SPRestRequest() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getListProperties(listTitle, OnSuccess,OnError) { | |
var context = SP.ClientContext.get_current(); | |
var web = context.get_web(); | |
var list = web.get_lists().getByTitle(listTitle); | |
context.load(web); | |
context.load(list,'SchemaXml'); | |
context.executeQueryAsync(function(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getJson(url) | |
{ | |
return $.ajax({ | |
url: url, | |
type: "GET", | |
contentType: "application/json;odata=verbose", | |
headers: { | |
"Accept": "application/json;odata=verbose" | |
} | |
}); |