Posts

Showing posts with the label REST API

Get All Lists with REST API and AngularJS

Image
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.1/angular.min.js"></script>  <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.min.js"></script>        <script>          var myAngApp = angular.module('SPAngGetLists', []);          myAngApp.controller('SPAngGetListsController', function ($scope, $http) {              $http({                  method: 'GET',                  url: _spPageContextInfo.webAbsoluteUrl + "/_api/web/Lists?$orderby=Title",                  headers: { "Accept": "application/json;odata=verbose" }  ...

Get all sites with REST API and AngularJS

<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.1/angular.min.js"></script>  <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.min.js"></script>        <script>          var myAngApp = angular.module('SPAngGetWeb', []);          myAngApp.controller('SPAngGetWebController', function ($scope, $http) {              $http({                  method: 'GET',                  url: _spPageContextInfo.webAbsoluteUrl + "/_api/web/webs?$orderby=Title",                  headers: { "Accept": "application/json;odata=verbose" }    ...

List of All Site Templates with REST API and AngularJS

Here is the code which can show you how to display all site templates / custom templates with use of REST API & AngularJS in SharePoint : <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.1/angular.min.js"></script>  <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.min.js"></script>        <script>          var myAngApp = angular.module('SPAngGetSiteTemplate', []);          myAngApp.controller('SPAngGetSiteTemplateController', function ($scope, $http) {              $http({                  method: 'GET',                  url: _spPageContextInfo.webAbsoluteUrl + "/_api/web/getavailablewebtemplates(103...

Access List properties with REST APIs

Syntax to use REST API for List:                 <sharepoint web url>/_api//web/lists/GetByTitle('List Title')/<property name> Properties which can be retrieved: S. No Property Type 1 AllowContentTypes Boolean 2 BaseTemplate Int32 3 BaseType Int32 4 BrowserFileHandling Int32 5 ContentTypes SP.ContentTypeCollection 6 ContentTypesEnabled Boolean 7 Created DateTime 8 DataSource SP.ListDataSource 9 DefaultContentApprovalWorkflowId GUID 10 DefaultDisplayFormUrl String 11 DefaultEditFormUrl String 12 DefaultNewFormUrl String 13 Defa...