Click here to Skip to main content
15,901,035 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
Hello people!
I'm developing an app for windows phone 8.1 .
I want to read and write data to and from Microsoft SharePoint.
I'm using REST API and my problem is I have no idea how to get the access token needed in order to gain access to SharePoint.
This is what I have so far:
C#
HttpWebRequest spRequest = (HttpWebRequest)WebRequest.Create(jsonRequest);
spRequest.Method = "GET";
spRequest.Accept = "application/json; odata=verbose";
//spRequest.Headers["Authorization"] = "Bearer" + accessToken;
HttpWebResponse endpointResponse = (HttpWebResponse)await spRequest.GetResponseAsync();
Stream dataStream = null;
StreamReader reader = null;
string responseFromServer = null;
dataStream = endpointResponse.GetResponseStream();
reader = new StreamReader(dataStream);
responseFromServer = reader.ReadToEnd();


Maybe my approach is all wrong.
I'll appreciate any insights, please help I spent a week on google trying to figure out how to do it.
Thanks.
Posted
Comments
virusstorm 30-Jun-15 11:48am    
SharePoint is a very large application, what data are you trying to read and write? Also, what version of SharePoint are you using? This is very important as not all editions of SharePoint support REST services.
[no name] 1-Jul-15 1:48am    
I need to upload/download a picture with some data about it.
I should connect to sharepoint online.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900