Posts

Showing posts from March, 2015

SharePoint Online (O365) OAuth Authentication | Authorizing REST API calls against SharePoint Online Site | Get Access token from SharePoint Online | Set up OAuth for SharePoint Online Office 365

Image
Here is my most awaited post on how to set up OAuth for SharePoint Online so that we can authorize REST API calls to the SharePoint site to retrieve data and manipulate the site data. The steps going to be easy and I will demonstrate along with screenshots and examples with the Google PostMan RESTClient . I have explained the steps below which follows the OAuth 2.0 protocol. All the steps are straight forward, but constructing the URLs are little tricky! Below are the detailed steps: 1.  Register an app in SharePoint ·          Navigate to https://your_site_name.com/_layouts/15/appregnew.aspx ·          Click Generate for Client Id and Client Secret. ·          Give a name for the app, fill in the app domain (ex: www.google.com , www.salesforce.com ). Enter the Redirect URL, important here is when entering redirect url, it should be https and this is the url, to which the site redirects once you authorize your app and get auth.code (which will be explained late

JQery helper methods

In this post I am gonna give you some of the JQuery helper methods which I am using in my application frequently. Below are some of them , with explanation: Usage: Copy all the codes given at the end of this post to a js  file and add a reference of it to your page. Or  Click here to download the file 1. Remove Special Characters from a string: var str="Hello%how%are$you"; str.removeSplChars(); output : Hellohowareyou 2. Trim from left: var str="%hello"; str.trimStart('%'); Output:  hello 3. Trim from right: var str="hello%"; str.trimEnd('%'); Output: hello 4. String Contains: var str="welcome to SPShell. The SharePoint blog"; str.contains("SharePoint"); Output: true 5. IsUndefined. var undefinedVar; IsUndefined(undefinedVar); Output: true 6. isIEBrowser  (check is browser is IE) isIEBrowser(); Output: false (my browser is chrome when I excecuted this code)  . 7. checkChrome c