Skip to main content

Posts

Showing posts with the label REST

Show modified by author and date in all pages in O365 SharePoint site

Show modified by author and date in all pages in O365 SharePoint site using below script, $(document).ready(function() { GetEditorAndDate(); });  // end document-ready function GetEditorAndDate() { var relativePageURL = _spPageContextInfo.serverRequestPath; var siteURL = _spPageContextInfo.webAbsoluteUrl; var profileUrl = "https://myorg.sharepoint.com/sites/devsite/"; var query = siteURL + "/_api/web/getfilebyserverrelativeurl('/"+ relativePageURL +"')?$select=TimeLastModified,ModifiedBy/Title,ModifiedBy/LoginName&$expand=ModifiedBy"; var call = $.ajax({ url: query, type: "GET", dataType: "json", headers: { Accept: "application/json;odata=verbose" }     }); call.done( (function (data, textStatus, err){  rawModifedBy = data.d.ModifiedBy.Title  prettiedModifiedBy = rawModifedBy.split(', ')[1]+' '+ rawModifedBy.split(', ')[0]  rawModi...

Nice Articles for REST in SharePoint using Open Data(OData)

Following are the great resources I found useful for REST in SharePoint, Excerpts are, In practice, many firewalls and other network intermediaries block HTTP verbs other than GET and POST. To work around this issue, WCF Data Services (and the OData standard) support a technique known as "verb tunneling." In this technique, PUT, DELETE, and MERGE requests are submitted as a POST request, and an X-HTTP-Method header specifies the actual verb that the recipient should apply to the request. The SharePoint REST interface is based on the REST-based Open Data protocol (OData) for Web-based data services, which extends the Atom and AtomPub syndication formats to exchange XML data over HTTP. Because OData is a platform-independent open standard, the SharePoint REST interface is a great way to access SharePoint list data from platforms on which the CSOM may be unavailable to you, such as from non-Windows–based operating systems. However, the REST interface only provi...