REST
22 Topics_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)); } });Solved22KViews0likes3CommentsCascading 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.7KViews0likes4CommentsWhat You Didn't Learn In School- getting started series with Git, GitHub, Powershell, Bash and WSL2
So MIT launched the The Missing Semester of Your CS Education · the missing semester of your cs education (mit.edu) so we had the inspiration to develop the Microsoft Learn What you didn't learn in school collection2KViews0likes1CommentVisual Studio 2019 extension for building REST APIs exposing IoT Hub features
Hi all, If you need to write REST APIs (.Net Core) to expose or complete IoT Hub APIs or create a facade, this extension will help you to save a few minutes. It creates a ready to use solution in a few seconds and allows you to focus on important code (business logic, etc). The created API includes other features like: - API versioning - Automatic OpenAPI generation (versioned according to API versions) - separated layers - minimalistic solution with required dependencies only The only thing you need to do is to set the IoT Hub connection in the configuration file (appsettings.json). More details here.1.9KViews1like3CommentsUnable 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.8KViews0likes4CommentsSite 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.8KViews0likes3CommentsUnable to attach binary files for Azure DevOps REST API
I was trying to upload binary files using Azure DevOps REST API service. reference: https://docs.microsoft.com/en-us/rest/api/azure/devops/wit/attachments/create?view=azure-devops-rest-6.0#upload-a-binary-file I was trying to upload "ATTACHMENT_TEST.zip" ref : https://drive.google.com/file/d/15Y3IS0BWoCaMo7kjt6t1ZCdHNH_PGT65/view?usp=sharing Converted ATTACHMENT_TEST.zip to base64 UEsDBBQAAAAAALZIcVSXxhNiBAAAAAQAAAAIAAAAVEVTVC50eHRTSUREUEsBAhQAFAAAAAAAtkhxVJfGE2IEAAAABAAAAAgAAAAAAAAAAQAgAAAAAAAAAFRFU1QudHh0UEsFBgAAAAABAAEANgAAACoAAAAAAA== Tried to add base64 as json in payload. The URL produced by the output is giving me invalid zip Code import requests import json url = "https://dev.azure.com/{Organization}/{ProjectName}/_apis/wit/attachments?uploadType=Simple&api-version=6.0&fileName=app.zip" payload = json.dumps("[UEsDBBQAAAAAALZIcVSXxhNiBAAAAAQAAAAIAAAAVEVTVC50eHRTSUREUEsBAhQAFAAAAAAAtkhxVJfGE2IEAAAABAAAAAgAAAAAAAAAAQAgAAAAAAAAAFRFU1QudHh0UEsFBgAAAAABAAEANgAAACoAAAAAAA==]") headers = { 'Content-Type': 'application/json', 'Authorization': 'Basic $AuthKey', 'Cookie': 'VstsSession=%7B%22PersistentSessionId%22%3A%22fe6c3302-6671-4bfc-9cbe-0d33f145a31f%22%2C%22PendingAuthenticationSessionId%22%3A%2200000000-0000-0000-0000-000000000000%22%2C%22CurrentAuthenticationSessionId%22%3A%2200000000-0000-0000-0000-000000000000%22%2C%22SignInState%22%3A%7B%7D%7D' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text)1.6KViews0likes0Comments