This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // POST request Call | |
| function RestRequest(url, params) { | |
| var req = new XMLHttpRequest(); | |
| return new Promise(function(resolve, reject) { | |
| req.onreadystatechange = function() { | |
| if (req.readyState != 4) // Loaded | |
| return; | |
| if (req.status >= 200 && req.status < 300) { | |
| resolve(req); | |
| } else { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // POST request Call | |
| function RestRequest(url, params) { | |
| var req = new XMLHttpRequest(); | |
| return new Promise(function(resolve, reject) { | |
| req.onreadystatechange = function() { | |
| if (req.readyState != 4) // Loaded | |
| return; | |
| if (req.status >= 200 && req.status < 300) { | |
| resolve(req); | |
| } else { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* **** RUN THIS SNIPPET in Browser Developer Console to see the output **** */ | |
| // POST request Call | |
| function RestRequest(url, params) { | |
| var req = new XMLHttpRequest(); | |
| return new Promise(function(resolve, reject) { | |
| req.onreadystatechange = function() { | |
| if (req.readyState != 4) // Loaded | |
| return; | |
| if (req.status >= 200 && req.status < 300) { | |
| resolve(req); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "d": { | |
| "__metadata": { | |
| "id": "https://<tenant>.sharepoint.com/sites/ktskumar/_api/FontPackages/GetById('ea101761-bc64-4f8e-96f5-163c605a6041')", | |
| "uri": "https://<tenant>.sharepoint.com/sites/ktskumar/_api/FontPackages/GetById('ea101761-bc64-4f8e-96f5-163c605a6041')", | |
| "type": "SP.FontPackage" | |
| }, | |
| "ID": "ea101761-bc64-4f8e-96f5-163c605a6041", | |
| "IsHidden": false, | |
| "IsValid": true, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "d": { | |
| "Apply": null | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "d": { | |
| "results": [ | |
| { | |
| "__metadata": { | |
| "id": "https://<tenant>.sharepoint.com/sites/ktskumar/_api/SP.FontPackagefff39b0b-8476-4564-a678-9daac8ef29ba", | |
| "uri": "https://<tenant>.sharepoint.com/sites/ktskumar/_api/SP.FontPackagefff39b0b-8476-4564-a678-9daac8ef29ba", | |
| "type": "SP.FontPackage" | |
| }, | |
| "ID": "ea101761-bc64-4f8e-96f5-163c605a6041", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "d": { | |
| "results": [ | |
| { | |
| "__metadata": { | |
| "id": "https://<tenant>.sharepoint.com/sites/ktskumar/_api/SP.FontPackage1708d258-0e7b-40ad-831d-53e374293ee1", | |
| "uri": "https://<tenant>.sharepoint.com/sites/ktskumar/_api/SP.FontPackage1708d258-0e7b-40ad-831d-53e374293ee1", | |
| "type": "SP.FontPackage" | |
| }, | |
| "ID": "1e7a7803-045d-44df-9c7a-d2f2f8562e51", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //getRequest method reference | |
| //https://gist.github.com/ktskumar/a9e9df497673e9fd26ead8532b9ff425 | |
| //Returns the current user information | |
| getRequest("https://domain.sharepoint.com/sites/name/_api/web/currentuser").then(function(output){ | |
| console.log(JSON.parse(output.response)); | |
| }); | |
| //Returned Properties | |
| //Email, Expiration, Id, IsEmailAuthenticatonGuestUser, IsHiddenInUI, IsShareByEmailGuestUser, IsSiteAdmin, LoginName, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Update the WriteSecurity to change the item level permissions | |
| //Set the Edit property to Create items and edit items that were created by the user | |
| // 1 - Create and edit all items | |
| // 2 - Create items and edit items that were created by the user | |
| // 3 - None | |
| import { sp, Web } from "@pnp/sp/presets/all"; | |
| (async () => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Speaker Authenticator</title> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/recorderjs/0.1.0/recorder.js"></script> | |
| </head> | |
| <body> | |
| <div class="container"> | |
| <h1>Validate Speaker</h1> |
NewerOlder