Syntax

REST API Endpoint:

https://SharePointSiteURL/_api/web?$select=AllowRssFeeds

REST API endpoint to use in Add_ins:

<appweburl>/_api/SP.AppContextSite(@target)/web?$select=AllowRssFeeds&@target=<hostweburl>
Embed Code Snippet:

The following code snippet can be embedded in SharePoint page or in content editor web part as a script. This exampleis used to get the allowed rss feed's property of a SharePoint website.
  1. <script type="text/javascript" src="/SiteAssets/Scripts/jquery.min.js"></script>
  2. <script type="text/javascript">
  3. $.ajax({
  4. url: _spPageContextInfo.webAbsoluteUrl+"/_api/web?$select=allowrssfeeds", //THE ENDPOINT
  5. method: "GET",
  6. headers: { "Accept": "application/json; odata=verbose" },
  7. success: function (data) {
  8. //RESULTS HERE!!
  9. console.log(data.d.AllowRssFeeds)
  10. if(data.d.AllowRssFeeds)
  11. alert('Rss feeds enabled on this site.');
  12. else
  13. alert('Rss feeds disabled on this site.');
  14. }
  15. });
  16. </script>
Add-in Code Snippet:

The following code snippet is used in SharePoint Add-in to get the allow rss feed property of a SharePoint web.

  1. // Load the js files and continue to the successHandler
  2. $.getScript(scriptbase + "SP.RequestExecutor.js", execCrossDomainRequest);

  3. // Function to prepare and issue the request to get
  4. // SharePoint data
  5. function execCrossDomainRequest() {
  6. // Initialize the RequestExecutor with the add-in web URL.
  7. var executor = new SP.RequestExecutor(appweburl);
  8. // Issue the call against the add-in web.
  9. // To get the AllowRssFeeds property using REST we can hit the endpoint:
  10. // appweburl/_api/web?select=AllowRssFeeds&@target=hostweburl
  11. // The response formats the data in the JSON format.
  12. executor.executeAsync(
  13. {
  14. url: appweburl + "/_api/SP.AppContextSite(@target)/web?$select=AllowRssFeeds&@target='" + hostweburl + "'",
  15. method: "GET",
  16. headers: {
  17. "Accept": "application/json; odata=verbose"
  18. },
  19. success: successHandler,
  20. error: errorHandler
  21. }
  22. );
  23. }
  24. // Function to handle the success event.
  25. // Prints the host web's title to the page.
  26. function successHandler(data) {
  27. var jsonObject = JSON.parse(data.body)
  28. //jsonObject.d.AllowRssFeeds returns true if enabled otherwise it returns false
  29. console.log('Rss feeeds Enabled on this site: ' + jsonObject.d.AllowRssFeeds);
  30. if(jsonObject.d.AllowRssFeeds)
  31. $('#message').html('Rss feeds enabled on this site.');
  32. else
  33. $('#message').html('Rss feeds disabled on this site.');
  34. }
  35. function errorHandler(data, errorCode, errorMessage) {
  36. console.log("Could not complete cross-domain call: " + errorMessage);
  37. }