mattroumaya / surveymonkey

Access your SurveyMonkey data directly from R!
https://mattroumaya.github.io/surveymonkey/
Other
42 stars 10 forks source link

Recipient Information #80

Closed de3ert closed 2 years ago

de3ert commented 2 years ago

After entering recipients <- get_recipients(888888888) (where 888888888 is the collector id) the following error is returned: "Error in get_recipients(888888888) : Not Found (HTTP 404)." Any advice on how I might avoid the error? I had already retrieved the survey data and placed it into a data frame. Thank you!

mattroumaya commented 2 years ago

Hi @de3ert, I think the issue is in the documentation for get_recipients(), and I'll be sure to correct this soon.

There are actually separate IDs for survey_id and collector_id, so you'd need to run something like the following:

# Get collector data for the survey you need
collectors <- surveymonkey::get_collectors(888888888)

# Use the id from collectors to get all recipients from that collector
recipients <- surveymonkey::get_recipients(123456789)

I hope this is helpful! I'll update the documentation accordingly with a pull request.

It also looks like some fields aren't being parsed, such as survey_response_status and mail_status. Let me know if this is something you'd need, and I'll work on including it in the returned tibble.

de3ert commented 2 years ago

Thank you! To clarify, I first ran collectors <- get_collectors( ) with the survey ID and then ran recipients <- get_recipients( ) with the collector ID that I retrieved from the object collectors.

mattroumaya commented 2 years ago

Looks like this was already documented, but agree that it can be confusing!