Skip to content

Instantly share code, notes, and snippets.

@ypcode
Last active December 29, 2017 19:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ypcode/d8ee1daa466c787ff701dc4b4206b656 to your computer and use it in GitHub Desktop.
Save ypcode/d8ee1daa466c787ff701dc4b4206b656 to your computer and use it in GitHub Desktop.
using OfficeDevPnP.Core.WebAPI;
//...
[SharePointContextFilter]
public ActionResult Register()
{
try
{
// Register the BusinessDocuments API
WebAPIHelper.RegisterWebAPIService(this.HttpContext, "/api/BusinessDocuments");
return Json(new { message = "Web API registered" });
}
catch (Exception ex)
{
return Json(ex);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment