REST
10 TopicsGetting News articles using REST API
Hello, We have a site for newsroom, where we are displaying all news articles. I need to create a rest API to read this information and display it on our REACT based app. I am unable to get hold of a URL that would provider me with this Information. I have tried following URLS but I am not getting the desired results https://<tenant>.sharepoint.com/sites/iNewsroom/_api/Web/Lists/getByTitle('Site%20Pages')/items?$select=* https://intermountainhealth.sharepoint.com/_api/search/query?querytext=%27IsDocument:True%20AND%20FileExtension:aspx%20AND%20PromotedState:2%27 https://<tenant>.sharepoint.com/search/_api/search/query?querytext=%27IsDocument:True%20AND%20FileExtension:aspx%20AND%20PromotedState:2%27\ Is there any other URL I can try to get the information? The newsroom site has a few sitep746Views0likes0CommentsCascading dropdown using on quick edit mode?
Hi, Is it possible for cascade dropdown to work on quick edit mode? I have asked around how to make it work and this guide was give to me - https://www.c-sharpcorner.com/blogs/cascading-dropdownlist-in-sharepoint?fbclid=IwAR3zoSBZRiIr1gg6lNBPEmNdj3buiqeRmtQ13feE2t4dnp_JPpmFeCfJM4w The problem is every time I paste the given code on a script editor webpart it would show as it is and cascade would not work Any advise to lead me to the right direction, please? Thanks2.8KViews0likes4CommentsUpdate Group SharePoint Custom Field Collums after Fileupload with REST Graph API
Hi, I've made an upload with Graph with the following JS code: async function uploadSingleFileMetaToSharepoint(file, name, metaData, groupId, graphAccessToken) { //console.log(file, name, metaData, groupId); //TODO get Filepath from config of App let pathToFiles = 'General' let apiurl = msgraph + `/groups/${groupId}/drive/root:/${pathToFiles}/${name}:/content`; if (debug) { console.log("uploading File: ", file); console.log(`API-URL: ${apiurl}`); } let header = { 'Authorization': graphAccessToken, } let body = file; //TODO catch errors let result = await fetch(apiurl, { "method": 'PUT', "headers": header, "body": body }); if (!result.ok) { console.error("upload file to sharepoint failed"); return } let res = await result.json(); //console.log(res); if (res === undefined || res.id === undefined) {console.error("Die DAtei wurde nicht hochgeladen"); return;} /... } which is working fine. But now i'm struggling to fill the values of the collumns from sharepoint : Does anybody know how to approach this?620Views0likes0CommentsAuditing external REST access to SharePoint Online folder
Hi I've set up SharePoint Online so that an external app can scrape content from a document library using XML rather than JSON. Question I've got is there anyway I can monitor when they make Get requests to the folder so I can audit times / dates when they scrape the content from the document library out of the box using logs for example? Thanks Chris720Views0likes0CommentsDeleting an existing file with same name and updating the new file using rest
Hi all, I am following this tutorial: https://docs.microsoft.com/en-us/sharepoint/dev/sp-add-ins/upload-a-file-by-using-the-rest-api-and-jquery for uploading file from my page to sharepoint using rest. I need to reupload the file into this library with the same name but it should replace the previous version of the file with the new version, How can I change the implementation and achieve that. Please help.1.5KViews0likes0CommentsUnable to update InformationRightsManagement using REST (sharepoint-online)
The following request returns status 204, indicating it was a success but the informationrights settings hasn't become updated when I take a look the IRM-settings in the web gui for the list. The property `IrmEnabled` seems to have been updated on the list but not the informationRightsManagementSettings!? var resp = await MakeJsonRequestAsync(new { __metadata = new Metadata() { type = "SP.List" }, IrmEnabled = true, IrmReject = true, IrmExpire = true, InformationRightsManagementSettings = new { __metadata = new Metadata() { type = "SP.InformationRightsManagementSettings" }, AllowPrint = true, AllowScript = false, AllowWriteCopy = false, DisableDocumentBrowserView = false, DocumentAccessExpireDays = 90, DocumentLibraryProtectionExpireDate = DateTime.Now.AddMonths(6), EnableDocumentAccessExpire = false, EnableDocumentBrowserPublishingView = false, EnableGroupProtection = false, EnableLicenseCacheExpire = false, GroupName = "", LicenseCacheExpireDays = 31, PolicyDescription = "testpolicy", PolicyTitle = "Victors Test Policy" } }, "/_api/web/lists(guid'" + listId.ToString() + "')/", newSiteUrl, accessToken, HttpMethod.Post, new Dictionary<string, string>() { {"X-Http-Method", "MERGE"}, { "If-Match", "*" } }); I have also tried to make a POST directly to `/_api/web/lists(guid'" + listId + "')/informationRightsManagementSettings` but it ends up in status 400 no matter what I do. Any help is greatly appreciated!Solved1.9KViews0likes4Comments_spPageContextInfo is undefined
I have a very simple REST call to get all of the items in a list(Announcements) but when I run this Mikael's script editor web part I get this error _spPageContextInfo' is not defined. where _spPageContextInfo is the current url of the page I am in). What am I doing wrong (I am using modern pages) ? $.ajax({ url: _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/getbytitle('Announcements')/items", method: "GET", headers: { "Accept": "application/json; odata=verbose" }, success: function(data) { console.log(data.d.results); }, error: function(data) { alert(JSON.stringify(error)); } });Solved23KViews0likes3CommentsSite themes via Rest.
I tried following at https://docs.microsoft.com/en-us/sharepoint/dev/declarative-customization/site-theming/sharepoint-site-theming-rest-api I keep getting the following response: <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Error</title> </head> <body> <pre>Cannot POST /_api/thememanager/AddTenantTheme</pre> </body> </html>1.9KViews0likes3CommentsIs there some REST Query builder tool?
We are using SharePoint 2016. I am using sometimes REST urls in javascript logic. For example: Get all list items from document library "Documents" where column "Modified" is equal as current date AND column "Created" is less than as current date. Is there some tool where I can connect to my sitecollection, see all my lists, and can configure in the GUI a query by list columns which shows me the REST url?1KViews0likes0Comments