rfortherestofus / omni

RMarkdown template, ggplot2 theme, and table function for OMNI Institute
https://rfortherestofus.github.io/omni/
Other
21 stars 5 forks source link

First use option for omni::qualtrics_connect() ? #54

Closed OskaratOmni closed 9 months ago

OskaratOmni commented 11 months ago

Hey @tvroylandt and @dgkeyes I have a maybe crazy or bad idea for an option to add to qualtrics_connect() - please tell me what you think in terms of if it is worth implementing. I just set someone up to run pull a survey using qualtrics_connect(). They got an error right away because I'd forgotten to have them run ` qualtrics_register(organization_name = "OMNI", api_key = "EHfE9J9VEaCyeoGhfm6Npm3IkZ4iJmuVoAUl4h4b", base_url = "omniinstitute.co1.qualtrics.com")

` What do you think about adding an argument to qualtrics_connect() that is something like first_use = FALSE as default. If someone is doing this for the first time we change that to TRUE and it runs that qualtrics_register() code in the background? good idea or a bad idea?

I'm just trying to simplify a little bit and limit the number of things that a first user (beginning R person at OMNI) would have to know and understand to download a survey.

Do you see a downside to this? One is that when the api expires we basically have to update the package and have everyone update it again... I'm not sure how big of a deterrent that should be.

thanks!

tvroylandt commented 11 months ago

Oh that's a good idea ! I'll change that

OskaratOmni commented 10 months ago

Hey @tvroylandt , has this been pushed yet? I don't see it. Not a rush - I was just having a look and will alert the team when its there.

tvroylandt commented 10 months ago

Not yet. I was planning to do it tomorrow

OskaratOmni commented 10 months ago

No problem Thomas, thanks!

tvroylandt commented 10 months ago

Ok, I just added it.

It should auto-detect if you have the required key/url in the R environ and connect with them (if provided).

OskaratOmni commented 10 months ago

Thanks @tvroylandt , Can you please say a little more about how that will work?

The help file for qualtrics_connect() says "Connect to Qualtrics - need to have API key register before" Should that be updated?

If the api key expires, what is the easiest way to update it?

tvroylandt commented 10 months ago

@OskaratOmni I updated the function so that it can handle the "expired API key" case : https://github.com/rfortherestofus/omni/commit/14fd542333f30980762bc83069b982fd3e6b4182

To be simple : if you provide nothing but key and url are registrered and valid, this will just connect. Otherwise this will fail. And in that case you should provide new key/url (valid obviously) and this will connect again.

I tried to test all cases but I'm unsure I did so feel free to tell me if something failed somewhere.

tvroylandt commented 9 months ago

@OskaratOmni just a quick update on this one, is everything ok ?

OskaratOmni commented 9 months ago

Yes! seems to be working quite well, thank you.