Closed mhwangbo11 closed 2 years ago
Hi @mhwangbo11! All credit goes to @sfirke and his team for creating such a great package.
There are no YouTube video tutorials for setting up your OAuth/API Token in your .rprofile
, but I'd be happy to help you troubleshoot, or put together a step-by-step post.
Is there anything in particular that you're getting caught up with at the moment?
Hi @mattroumaya Thanks again for your support! Here's where I am stuck. I use R Markdown HTML to code all our files, and I think I'm stuck with OAuth/API token set up section.
The error pops out Step 3 in below codes:
Error code: Error in browse_surveys(10) : could not find function "browse_surveys"
I am assuming either Authentication process is not quite working or something is not quite right with my packages? What are your thoughts?
Here's how I wrote my code so far:
r format(Sys.time(), '%B %d, %Y')
"
output:knitr::opts_chunk$set(echo = TRUE)
library(devtools)
# After you call out devtools devtools::install_github("tntp/surveymonkey") on your console
## Common issue i.e. Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) : namespace βcliβ 2.0.0 is already loaded, but >= 2.0.2 is required
### Common issue2 can be addressed by install.packages("cli") first before calling out devtools. Also make sure you have the most up-to-date Rtools4.
usethis::edit_r_profile()
# Updated my OAuth SurveyMonkey by pasting `options(sm_oauth_token= "myAPI")`
## Then turn off/restarted R Studio
getOption("sm_oauth_token") # This worked
surveys <- browse_surveys(200) # see your most recent 200 surveys
Min
Hi @mhwangbo11 - I think you just need to load the surveymonkey
package.
For Step 1 above, include:
library(surveymonkey)
It's working and one more error code pop up:
Error in browse_surveys(10) : Unauthorized (HTTP 401).
Thanks again @mattroumaya! Min
When you log in to your SurveyMonkey app, does it say deployed? I have seen that cause a 401 error before.
Since a 401 error doesn't give us much to work with, I'm not too sure what else could be going on without barraging you with questions, so I'll hope that you just need to deploy the app and then it works! π
Thanks again! @mattroumaya I found the issue! I think our org plan for API access is disabled (we'll need to purchase Premier account - it looks like we have a Team Advantage plan). Well thanks again at least this is a good start to figure out some more work in the future :)
Ah yes, unfortunately you do need to have a Premier plan π. Glad you were able to figure out what went wrong, though!
@mhwangbo11 - I did some investigating recently and it looks like limited API access is now available across all plans. If you have the chance to check it out at any point in the future, please feel free to report back and update if things are working for you!
Greetings! Thanks for the amazing work/documentations. Do you happen to have a Youtube video tutorial on OAuth and how to navigate SurveyMonkey surveys? Thanks again for your amazing work!