Creating custom REST-service for SharePoint and publishing it to SharePoint On-Prem farm.
The solution is built using Visual Studio 2015 Office Developer Tools and designed to be deployed in SharePoint 2013 On-Premise. Also it's able to be deployed in SharePoint 2016 Server On-Premise.
This is farm solution and can not be deployed on SharePoint Online or convert to sandbox solution.
SharePoint allows you to publish your custom REST-service and access it using HTTP requests from youe apps (Url addresses with the prefix
_api). In addition, developers have the option to create your own REST services and publish them into SharePoint web applications.
These services are available via the HTTP requests of the form:
Access to your service's property CustomProperty:
Or custom method CustomMethod:
Published services can contain both properties and methods. Data can be presented in XML or JSON format. To retrieve data in JSON format just add the "Accept":"application/json;odata=verbose key-value pair in the request header.
Detailed description is available at my blog post (in Russian): http://blog.vitalyzhukov.ru/ru/sharepoint-custom-rest-api.aspx