arthur-shaw / susoapi

R interface for Survey Solutions' APIs
https://arthur-shaw.github.io/susoapi/
Other
9 stars 5 forks source link

How to export when you have no access to workspace primary #21

Closed atkilt closed 2 years ago

atkilt commented 2 years ago

Dear Shaw, Thank you for your contribution. I have one quick question. When I try to run your script

all_questionnaires <- get_questionnaires()

I got the following on the R console. I am not assigned as primary but I want to analyze the data in R. I can export it to SPSS and then read it in R but this is a routine I didn't want. I want to do it directly as you demonstrated.

User xxxx does not have access to workspace primary

arthur-shaw commented 2 years ago

Thanks for the question.

This message means that your user API does not have access to the workspace primary.

If you want your API user to have access, you need to log into your server as an admin user and grant access. See more here.

If you want to get questionnaires for a different workspace (to which your user has access), specify the workspace in the workspace argument. For example:

# get questionnaires from `test` workspace
qnrs <- susoapi::get_questionnaires(workspace = "test")

See the the function documentation here for a bit more detail.