Welcome to my blog, stay tunned :
Home | Blogs | Stephane Eyskens's blog

Demo SharePoint-Hosted App showing how to use the REST API (CRUD, micro-blogging, following content, people, search)

Hi,

Update : I've published this App to the online SharePoint Store which facilitate its installation. The App is available here http://office.microsoft.com/en-us/store/rest-api-demo-WA104068939.aspx?q.... However, since the SharePoint Store doesn't permit Tenant Full Control permissions, the App capabilities are a little bit reduced compared to the one published on CodePlex

As you might have noticed, I've posted quite a lot of blog posts regarding REST, OData & SharePoint and this, for a few years now! Since the REST API has been strongly extended in 2013, I've decided to build a demo SharePoint-Hosted App that you can deploy on a Office 365 environment or onpremise. This application is currentlhy handling quite a lot of operations:


List Items
Adding list items
Adding documents
Editing list items
Deleting list items
Performing simple queries with _api & _vti_bin/listdata.svc
Performing queries with joins with _api & _vti_bin/listdata.svc

Lists
Creating new lists
Adding fields to lists
Deleting fields from lists
Deleting lists

Users & Groups
Creating security groups
Listing security groups
Listing users
Listing security groups of a given user
Getting the associated member group
Getting the associated visitor group
Getting the associated owner group

Search
Performing basic search queries
Performing advanced search queries with KQL
Performing queries targeting the People result source
Performing queries including Refiners
Performing POST queries

Sites
Creating sites
Deleting sites
Listing available web templates
Listing custom list templates
Listing fields
Listing content types
Listing folders
Listing web features
Listing site collection features
Listing web event receivers
Listing site collection event receivers
Listing the user recycle bin
Listing the site collection recycle bin

User Profiles
Getting my profile properties
Getting someone else's properties
Follow/Stop follow a site
Follow/Stop follow a document
Follow/Stop follow a tag
Getting followed content
Getting followers
Getting followers including properties
Getting followees
Getting followees including properties
Getting my news feed
Getting my timeline feed
Create a microblog
Create a microblog with mentions
Create a microblog with hashtags
Delete a microblog
Like a microblog
Lock a microblog
Unlock a microblog
UnLike a microblog
Get the likers of a microblog
Reply to a microblog

Events
Logging events

The App shows you the generated AJAX query whenever it is contacting SharePoint. By looking at the source code, you will also see how to parse the results but basically, you can easily see from the UI what are the URI to target and what is the data to be transmitted along with the query.
The App is available on CodePlex at the following URL https://sptoolbasket2013.codeplex.com/releases. Feel free to download it and to add suggestions. It's a first version and I'll probably extend it when time permits.


Happy Coding!

Comments

Hello, thanks for the article

Do you have example, to stop and follow a user instead of document, site, tag....

Is it possible in Hosted app without giving tenant write access?

thanks
-P

Follow a user

Hi,

I should have included that in the App but you can find the doc here:

https://msdn.microsoft.com/en-US/library/office/dn194080.aspx

Regarding the Tenant access permissions, I needed to access the Social API.

Best Regards

Thanks

Thanks for sharing, Stephane!

App

You're welcome! Don't hesitate to spread the word :)