SharePoint Rest Endpoint and Improvement in SharePoint 2013

Sunday, February 17, 2013

SharePoint 2013 comes again as a great development platform for Enterprise needs and Collaboration with the power of Social Features .In SharePoint 2010 Microsoft introduces Representational State Transfer (REST) service which they have improved  in SharePoint 2013 now REST Services  is fully comparable to the Client object models. Microsoft SharePoint 2013 client object models will have A corresponding REST endpoint. That developers can fully interact remotely with SharePoint data by using any technology that supports REST web requests which Use O Data Standard. The developer can perform all basic CURD (create, update, read, Delete) Operations by O Data Model. 

The Open Data Protocol (OData) is a web protocol for querying and updating data that provides a way to unlock your data and free it from silos that exist in applications today. OData does this by applying and building upon web technologies such as HTTP, Atom Publishing Protocol (AtomPub), and JSON to provide access to information from a variety of applications, services, and stores. (Source: Open Data Protocol site)

Access SharePoint 2013 REST ENDPOINT
In Teams to SharePoint 2013 REST ENDPOINT we use URL   http://site url/_api/web.  Previously in sharepoint2010 developers use So many clients. Svc difficult URL for rest service endpoint is still there SharePoint 2013 as well for backwards compatibility.

Easier Endpoint REST Service URLs
http://site url/_vit_bin/Client. Svc/web    (SharePoint2010)
Removing Client.SVC and make it easy To use it with the new url.
http://site url/_api/ http://site url/_api/web    (SharePoint2013)

To Use REST Service in SharePoint 2013 have made the HTTP request and serves the appropriate response in either Atom or JavaScript Object Notation (JSON) format. The client application must then parse that response. To Use SharePoint Client Object Model by Rest Service we Need entry Points where we can Access the namespace. Use the names of the APIs from the client object model separated by a forward slash (/). 

Client object model
REST equivalent

REST Services Access Points for SharePoint 2013
Access point
User Profile
http:// server/site/_api/SP.UserProfiles.PeopleManager
http:// server/site/_api/search
http:// server/site/_api/publishing

REST Service open new door and possibility for Developer to create and manage your app for SharePoint 2013 with new web standard like OAuth and OData. SharePoint 2013 Rest Service Also Support Cross Domain cross Domain Library  to Access SharePoint 2013 data from remote apps. By using Cross domain library now app can interact with multiple domains.
How to Read Data 

How to Add and Update SharePoint Entities by Using Rest Services

You can Perform create and update operation with SharePoint entities by constructing with RESTFULL HTTP REQUEST WITH ENDPOINTS.

How to Delete  SharePoint Entities
More Reference

thanks to Linkedin :) Most Viewed Profiles 2012

Tuesday, February 12, 2013

Check out my professional profile and connect with me on LinkedIn.

SharePoint 2013 Developers Meetup


Kindly feel free to contact me.

Enable Apps in SharePoint 2013

Monday, February 11, 2013

SharePoint 2013 Apps Model is very important developer. as SharePoint geek i find SharePoint app Model the most interesting learning topic in SharePoint 2013. to start development on SharePoint app model you have to configured app store and App  on your SharePoint machine.  default SharePoint management and  App Catalog,App Store is not enabled in SharePoint. to enable Apps on you development machine or Production server you have activated few Service Applications from CA and Powershell.

How to enable SharePoint 2013  App.

1 Goto  SharePoint 2013 Central Administrations.

2 Click on System Settings
3 under System Setting  Go to Manage services on server.
4 Server page find App Management Service Click on Start button and wait to ensure service will start.
5 Enable next Service on same page  Microsoft SharePoint Foundation Subscription Settings Service click on on Start.
By default SharePoint 2013 App Management Service  and  Microsoft SharePoint Foundation Subscription Proxy is not install on service.

Configure the Subscription Settings service application with PowerShell. 

Important for developers
If you will  try to deploy  a SharePoint-hosted apps on your SharePoint 2013 workstation with by default sharepoint 2013 installation visual studio will not  gives you error.

To Create SharePoint-hosted apps on your SharePoint 2013 installation, you must create an isolated domain on the developer workstation and configure the App Management  and Subscription Settings service applications.
  PowerShell To Create Isolated app domain.
 Ensure that the spadmin and sptimer services are running

 Write-Host "Ensure that the spadmin and sptimer services are running" -ForegroundColor Yellow
 net start spadminv4
 net start sptimerv4

  Create your isolated app domain by running the SharePoint Management Shell as an administrator and typing the following command.

 Write-Host "Create your isolated app domain by running the SharePoint Management Shell as an administrator and typing the following command." -ForegroundColor Yellow
 $appdomain = Read-Host "Your App Domain Name"
 Set-SPAppDomain $appdomain

 Or To Configure App Domain without power shell i find great article by MVP Mirjam's on her blog. Click here.

 Ensure that the SPSubscriptionSettingsService and AppManagementServiceInstance services are running.

 Write-Host "Ensure that the SPSubscriptionSettingsService and AppManagementServiceInstance services are running." -ForegroundColor Yellow
 Get-SPServiceInstance | where{$_.GetType().Name -eq "AppManagementServiceInstance" -or $_.GetType().Name -eq "SPSubscriptionSettingsServiceInstance"} | Start-SPServiceInstance

 Verify that the SPSubscriptionSettingsService and AppManagementServiceInstance services are running

 Write-Host "Verify that the SPSubscriptionSettingsService and AppManagementServiceInstance services are running." -ForegroundColor Yellow
 Get-SPServiceInstance | where{$_.GetType().Name -eq "AppManagementServiceInstance" -or $_.GetType().Name -eq "SPSubscriptionSettingsServiceInstance"}

 Specify an account, application pool, and database settings for the SPSubscriptionService and AppManagementServiceInstance services 
 Write-Host "Specify an account, application pool, and database settings for the SPSubscriptionService and AppManagementServiceInstance services." -ForegroundColor Pink
 $login = Read-Host "The login of a managed account"
 $account = Get-SPManagedAccount $login 
 $appPoolSubSvc = New-SPServiceApplicationPool -Name SettingsServiceAppPool -Account $account
 Write-Host "SettingsServiceAppPool created (1/6)" -ForegroundColor Green
 $appPoolAppSvc = New-SPServiceApplicationPool -Name AppServiceAppPool -Account $account
 Write-Host "AppServiceAppPool created (2/6)" -ForegroundColor Green
 $appSubSvc = New-SPSubscriptionSettingsServiceApplication –ApplicationPool $appPoolSubSvc –Name SettingsServiceApp –DatabaseName SettingsServiceDB 
 Write-Host "SubscriptionSettingsServiceApplication created (3/6)" -ForegroundColor Green
 $proxySubSvc = New-SPSubscriptionSettingsServiceApplicationProxy –ServiceApplication $appSubSvc
 Write-Host "SubscriptionSettingsServiceApplicationProxy created (4/6)" -ForegroundColor Green
 $appAppSvc = New-SPAppManagementServiceApplication -ApplicationPool $appPoolAppSvc -Name AppServiceApp -DatabaseName AppServiceDB
 Write-Host "AppManagementServiceApplication created (5/6)" -ForegroundColor Green
 $proxyAppSvc = New-SPAppManagementServiceApplicationProxy -ServiceApplication $appAppSvc
 Write-Host "AppManagementServiceApplicationProxy created (6/6)" -ForegroundColor Green

Specify your tenant name 
 Write-Host "Set AppSiteSubscriptionName to 'app'" -ForegroundColor Yellow
 Set-SPAppSiteSubscriptionName -Name "app" -Confirm:$false
 Write-Host "AppSiteSubscriptionName set" -ForegroundColor Green

 # Disable the loopbackcheck in the registry
 Write-Host "Disable the loopbackcheck in the registry" -ForegroundColor Yellow
 New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Lsa\" -Name "DisableLoopbackCheck" -PropertyType DWord -Value 1

 Write-Host "successfully Completed".

Download Complete PowerShell.

After that ensure that Service Application Proxy has been created and running file.

  1. Go to  SharePoint 2013 Central Administrations.
  2. Under Application Management Click on Manage service applications.
  3. Ensure  see both application with Proxy is running. 

Configure the app URLs to use.

  1. In Central Administration, click Apps.
  2. On the Apps page, click Configure App URLs.
  3. In the App domain box, type the isolated domain that you created for hosting apps.
  4. For example, or
  5. In the App prefix box, type a name to use for the URL prefix for apps.
  6. For example, you could use “apps” as the prefix so that you would see a URL for each app such as “”. The following illustration shows the Configure App URLs page after you have filled in the App domain and prefix.

Or you can Use PowerShell .


 #Set-SPAppSiteSubscriptionName -Name "app" -Confirm:$false
  Set-spappSiteSubscriptionName -Name "app"

Create an App Catalog site collection for a web application

Verify that the user account that is performing this procedure is a member of the Farm administrators group.

  1. 1 In Central Administration, on the Apps page, in the App Management section, click Manage App Catalog.
    If no App Catalog exists for the farm, the Web Application page opens, so you can select a web application.
  2. On the Web Application page, select the web application for which you want to create a catalog.
  3. In the App Catalog Site section, select Create a new app catalog site, and then click OK.
  4. On the Create App Catalog page, in the Title box, type a title for the App Catalog site.
  5. In the Description box, type the description for the site.
  6. In the URL box, fill in the URL to use for the site.
  7. In the Primary Site Collection Administrator section, in the User Name box, type the user who will manage the catalog.
  8. Only one user name can be entered. Security groups are not allowed.
  9. In the End Users section, in the Users/Groups box, type the names of the users or groups that you want to be able to browse the catalog.
  10. Added users or groups have read access to the App Catalog site. You can add multiple user names and security groups. Users must be added as End Users to be able to browse the App Catalog from their site collections.
  11. In the Select a quota template list box, select the quota template to use for the site.
  12. Click OK.

 Enjoy your Apps :)

By Usama Wahab Khan


"Early Experts" Challenge Certificate of Completion

Friday, February 8, 2013

Today i Recvied Email from Microsoft for Completing Early Expert Challenge and received a Certificate of Completion

"Congratulations! Share Your Success in the "Early Experts" Challenge!"

Great Presentions from SharePoint Jump Startup

Thursday, February 7, 2013

Building apps for SharePoint

SharePoint API and App Security

 Windows Azure & apps for Office and


SharePoint 2013 Best Practices: Service Accounts

Wednesday, February 6, 2013

Service Account Overview

  • SQL_Service, for the SQL Server service.
  • SQL_Admin, for the SQL Server administrator.
  • SP_Admin, for the SharePoint administrator and setup user.
  • SP_Farm, for the SharePoint farm service.
  • SP_WebApps, for the user-facing web application app pool.
  • SP_ServiceApps, for the service application app pool.
  • SP_Crawl, default content access account.
  • SP_UserSync, user profile synchronization account.
  • SP_EnterpriseAdmin, powerful account for handling all kinds of high privileg operations.
  • Farm administrators, normal admin user accounts are used as SharePoint Farm Administrators.


​​This account should be used for running SQL Server engine and SQL Server Agent. Create inside Service Manage Accounts Container inside AD to keep it controlled. Have the following characteristics:​
  • Belongs to the Users Domain Group.
  • ​​Use only for this two SQL services, if installed more (what you should do) keep the service accounts suggested by the installation program..


This account is needed for performing high privilege jobs and (such as installing fixes, upgrades, etc.). It needs to have the following permissions:
  • Either SQL Administrator or db_owner of all SharePoint databases.
  • Local administrator of each SharePoint server.
  • Member of Farm Administrators group.


Whats new for Developers Word Automation Services 2013

Word Automation Services was provided by Microsoft in SharePoint 2010 and Office 2010. To Automate MSWord Base Bulk file Operations on Server. Operations which include Converting Documents from two different formats like pdf, doc, docx. And update table of contents, importing  alternate format chunks.
The word automation service helps Developers to meet their business requirements for Server Side Automation of Microsoft word. In past Developers were used to Open XML Object Model to two Perform these kind of task which actually quite good but not highly scale able.
The Word Automation Service is Highly Optimized to perform huge Service Side Operations to provide significantly Great Performance for Solution. In SharePoint 2013 Microsoft improves allot in Word Automation Services major improvement are following.

Word Automation Services 2013 architecture:

On demand file operations
                                               In SharePoint 2013 now Developers can create on Demand file Operations on the server by using Word Automation Services. In Order to create on Demand file operations in SharePoint 2013 have to call request to Word Automation Services. These requests are based on the tradition Asynchronous Timer Job-based requests. Which are not based on SharePoint timer jobs.
You can make on demand file conversion requests for only one file at a time. Word Automation Services in Microsoft SharePoint 2013, have the added option to create a file conversion request that’s processed As soon as you submit it and the conversion is started immediately and does not depend on the SharePoint Timer Job.

Stream support

            Word Automation Services now support streams in SharePoint 2013. In Previous version of SharePoint 2010 Word Automation Services could convert only those files that were stored in SharePoint libraries. Now using Stream developer can store files outside of SharePoint.

Sample Code

//   ConversionJob  2010
            ConversionJob pdfJob = new ConversionJob("W A S");
            pdfJob.UserToken = myWebsite.CurrentUser.UserToken;
            pdfJob.AddFile(outputFilename, outputFilename.Replace(".docx", ".pdf"));
            //Will Start after Provking start Funcation

//On demand file operation

SyncConverter syncConv = new SyncConverter("W A S");
syncConv.Settings.OutputFormat = SaveFormat.PDF;
ConversionItemInfo convInfo = syncConv.Convert(inStream, outStream);