survos / platform-api-r

Sample programs demonstrating calls to the API
0 stars 0 forks source link

Initial Examples of API Login and Use #2

Open phillc73 opened 9 years ago

phillc73 commented 9 years ago

The package "survos" now installs as an R package.

The package "devtools" must be installed first.

Please use the following to install the package:

devtools::install_github("survos/ApiDemos")

The DESCRIPTION file contains library requirements and installation will check for this automatically. They are:

RCurl (>= 1.95-4.7)
jsonlite (>= 0.9.17)
curl (>= 0.9.3)

I needed to comment out all other code in other files, e.g. mcsd.R, for the build to work. Please keep this in mind if pushing changes to non-package files to the repository (or move them to a different repository, or move this package to a different repository).

Once installed, the following R script logs in and returns data from the "jobs" endpoint:


library("survos")

loginSurvos(username = "YourUserNameHere", password = "YourPasswordHere", style = "POST")

jobsFrame <- jobs(projectCode = "nyu_demo", page = "1")

All the jobs data can now be accessed through the variable "jobsFrame".

tacman commented 9 years ago

It sounds like we to rename this repo and remove those other scripts. What should we rename it to? SurvosApi? SurvosApi.R?

kcivey commented 9 years ago

I think we're moving toward lowercase names for the repos. It should be something like -api-r, where is whatever we're deciding to call what's now called Survos/Survos.