Posts

Showing posts with the label REST

Store and retrieve attachment in Pouch DB using Angular/Ionic

Recently, I am exploring pouch db and how to cache a server document in PouchDB in ionic. The topic was addressed in bits and pieces across posts and forums. Below is the code sample which brings everything together. 

Pulling SharePoint Online List with Managed Metadata into Power BI

Image
Recently, I started to work with Power BI for one of my projects. I am impressed and presently supersized. Product is simple and powerful keeping up to its name.  But, its not free from bugs. Like Force.com I always wondered if SharePoint Online can be used as PaaS. One of the major backdrop for me was reporting until I explored Power BI. In this post I am going to cover a bug which will fail sync between  SharePoint Online List with Managed Metadata and Power BI.  Error:  Expression.Error: We cannot convert a value of type Record to type Table. Details: Value=Record  Type=Type You may encounter this issue in another form. If you try to expand taxonomy column, it will take forever.  Work Around:  In Power BI Desktop, instead of using "Sharepoint List" under "Get Data" use "OData" and supply REST API URL instead.  https://tenantname.sharepoint.com/sites/SiteName/_api/Web/Lists(guid'xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx')/It...

SPOnline Search REST API POST request

There is one thing about Sharepoint. It doesn't let you pass even if there is a slight formatting error in your request. And, most of the time error is not so appropriate or no error.  I faced the same situation when i tried to compose a POST request for SPOnline Search REST API. The query text was quite complex as I was trying to retrieve search results based on a managed property which is in turn is generated from managed metadata column. The key here is not introduce  + symbol in place of space as we would generally do in GET request.  Code Snippet

Sample code to upload a file to chatter feed using REST API

Image
Step 1: Download required files Download the following files from internet httpcomponents-client-4.2.3-bin.zip org.apache.commons.httpclient.jar From the files, I have added following JARS to my project in eclipse.    Screenshot from Ecclipse Step 2: Get Access Token Through Chrome Login to your Salesforce instance and navigate to Setup -> Create -> Apps.  Create a custom app and fill Client ID and CallBack URL (ex: http://www.google.com) in the following URL. Encode the CallBack URL before passing it as a parameter.  https:// <instance_name> .salesforce.com/services/oauth2/authorize?response_type=token&client_id= <Client_ID_Goes_Here> &redirect_uri= <CallBack_URL> Paste this URL in chrome In Developer Tool -> Network select "preserve log upon navigation" Load the page. We see below page. The page will take us to RemoteAccessAuthorizationPage.apexp which inturn will lea...