Skip to main content
Notice removed Draw attention by Steph Locke
Bounty Ended with SPArcheon - on strike's answer chosen by Steph Locke
Tweeted twitter.com/#!/StackSharePoint/status/588626221937885184
Made it clearer that a plain english version of answer could be provided
Source Link
Steph Locke
  • 83
  • 1
  • 1
  • 7

Consume SharePoint online lists in R using REST API (in R)

I would like to be able to query lists that are on my sharepoint online site via R.

I'm having difficulties ascertaining the right method for authenticating my requests. These requests would be primarily ad-hoc, and not some form of dedicated app.

I've seen a number of other SO posts re: authentication but few relate to non-app and non-c# scenarios.

Available documentation

Technology I'm going to be working with

  • R
  • HEADLESS ubuntu 12LTS server
  • API package: httr

Task

Get some sort of authentication token, on the fly, for accessing list data via the REST API based on my user's access rights.

Sample code

What is the authentication method and what are the steps & permissions are needed to authenticate a call to the sharepoint online REST API?

library(httr)
basicauth <- authenticate("username", "password")
bearertokenexample <- add_headers(Authorization=paste("Bearer",[NEEDED AUTH TOKEN], sep=" "))
data <- GET("https://example.sharepoint.com/_vti_bin/listdata.svc/Glossary",bearertokenexample )

content(data)

e.g.

  1. Go to x and do y
  2. Put value z into your app
  3. Set up values a, b, z for auth
  4. Generate signature c

Consume SharePoint online lists in R using REST API

I would like to be able to query lists that are on my sharepoint online site via R.

I'm having difficulties ascertaining the right method for authenticating my requests. These requests would be primarily ad-hoc, and not some form of dedicated app.

I've seen a number of other SO posts re: authentication but few relate to non-app and non-c# scenarios.

Available documentation

Technology

  • R
  • ubuntu 12LTS server
  • API package: httr

Task

Get some sort of authentication token, on the fly, for accessing list data via the REST API based on my user's access rights.

Sample code

library(httr)
basicauth <- authenticate("username", "password")
bearertokenexample <- add_headers(Authorization=paste("Bearer",[NEEDED AUTH TOKEN], sep=" "))
data <- GET("https://example.sharepoint.com/_vti_bin/listdata.svc/Glossary",bearertokenexample )

content(data)

Consume SharePoint online lists using REST API (in R)

I would like to be able to query lists that are on my sharepoint online site via R.

I'm having difficulties ascertaining the right method for authenticating my requests. These requests would be primarily ad-hoc, and not some form of dedicated app.

I've seen a number of other SO posts re: authentication but few relate to non-app and non-c# scenarios.

Available documentation

Technology I'm going to be working with

  • R
  • HEADLESS ubuntu 12LTS server
  • API package: httr

Task

Get some sort of authentication token, on the fly, for accessing list data via the REST API based on my user's access rights.

What is the authentication method and what are the steps & permissions are needed to authenticate a call to the sharepoint online REST API?

e.g.

  1. Go to x and do y
  2. Put value z into your app
  3. Set up values a, b, z for auth
  4. Generate signature c
Notice added Draw attention by Steph Locke
Bounty Started worth 100 reputation by Steph Locke
Source Link
Steph Locke
  • 83
  • 1
  • 1
  • 7

Consume SharePoint online lists in R using REST API

I would like to be able to query lists that are on my sharepoint online site via R.

I'm having difficulties ascertaining the right method for authenticating my requests. These requests would be primarily ad-hoc, and not some form of dedicated app.

I've seen a number of other SO posts re: authentication but few relate to non-app and non-c# scenarios.

Available documentation

Technology

  • R
  • ubuntu 12LTS server
  • API package: httr

Task

Get some sort of authentication token, on the fly, for accessing list data via the REST API based on my user's access rights.

Sample code

library(httr)
basicauth <- authenticate("username", "password")
bearertokenexample <- add_headers(Authorization=paste("Bearer",[NEEDED AUTH TOKEN], sep=" "))
data <- GET("https://example.sharepoint.com/_vti_bin/listdata.svc/Glossary",bearertokenexample )

content(data)