Baguage / pyqualtrics

Unofficial python SDK for Qualtrics API
Apache License 2.0
33 stars 6 forks source link

Add support for python 3.5 #19

Open Baguage opened 8 years ago

johndavidsimmons commented 7 years ago

I've been writing some Python 3 with V3 of the API. Is there any particular place you are looking to start adding Python 3 integration?

Baguage commented 7 years ago

I did it on a branch, but haven't merged into master yet. Will try it tonight, and if all tests are passing I will release a new version today or tomorrow.

Baguage commented 7 years ago

Ok, it took a little bit longer than I planned, but I finally push v0.6.6 with Python 3.5 support. Let me know if it works for you!

johndavidsimmons commented 7 years ago

Good stuff! I would love to contribute if there is anything you need help with

Baguage commented 7 years ago

I would appreciate adding more API v3 calls (https://api.qualtrics.com/) - some of them are already supported in v2, but it would be good to have them anyway before v2 is phased out.

johndavidsimmons commented 7 years ago

How were you thinking of implementing the 3.0 calls? Integrating them into the current request function or making a separate one?

Baguage commented 7 years ago

I was thinking about using separate "request3" function I created for CreateResponseExport call. Not sure if is going to work for all v3 calls, but I think it will be better to keep them separate from v2 - API versions are VERY different

johndavidsimmons commented 7 years ago

Yeah the whole datacenter ID thing is confusing to me.

johndavidsimmons commented 7 years ago

https://github.com/johndavidsimmons/pyqualtrics/tree/v3

I made a V3 branch with a function called request3. I added the datacenter_id to arg to be part of the Qualtrics class, but you can still make calls without it. I just used the simple call Get Organization as a starting point. There is a unittest also. Let me know what you think.

graycarper commented 6 years ago

Hi, Baguage and John! I'm a long-time user of pyqualtrics and the automations it's allowed me to create has vastly improved my life. Thank you!

I just attempted to run some of those automations, and I hit a problem that I think may relate to this open issue. (If not, or if you think this isn't the appropriate spot for our conversation, I'll create a new issue.) It first appeared when I tried to authenticate with...

qualtrics = Qualtrics(QUALTRICS_USER, QUALTRICS_TOKEN)

This is the JSON that returned...

{u'Meta': {u'Status': u'Error', u'RequestType': u'getPanel', u'ErrorMessage': u'Invalid token', u'QualtricsErrorCode': u'ESRV60', u'ErrorCode': 401, u'Debug': u''}, u'Result': None}

But my token was fine (I was using it elsewhere), so I thought maybe it had something to do with the API version. Sure enough, my authentication succeeded when I used this...

qualtrics = Qualtrics(QUALTRICS_USER, QUALTRICS_TOKEN, "3")

It failed shortly after that, though, when I called qualtrics.getPanel. Here's the JSON that returned...

{u'Meta': {u'Status': u'Error', u'RequestType': u'getPanel', u'ErrorMessage': u'Invalid request. Missing or invalid parameter Version.', u'QualtricsErrorCode': u'ESRV35|Version', u'ErrorCode': 400, u'Debug': u''}, u'Result': None}

I see that getPanel was deprecated when the v3 API was released, and though I haven't seen absolute confirmation of this, it looks like the 2.5 API has now been retired completely.

Have you experienced the same problem? Do you have any suggestions on updating my scripts for the v3 API? (I primarily use getPanel, addRecipient, and removeRecipient.)

Thanks again!

Baguage commented 6 years ago

Hi John, it is great to hear from you!

The API v2.5 is deprecated and not recommended for new projects, but Qualtrics support (a while back) promised to keep it running and said there were no plans to shut it down completely.
I have an instance of a web portal that uses a current version of pyqualtrics and it seems to be working just fine. I just tried the getPanel and it seems to work for me as well. It might be just a quirk in Qualtrics API.

If you still having this issue, I think it is a good idea to ping Qualtrics support - they are very helpful. You can get the URL for your getPanel call from qualtrics.last_url after you call qualtrics.getPanel() if they ask. Let me know if you need any help with that!

If you feel like adding v3 version of getPanel, I'd be glad to merge your pull request.

graycarper commented 6 years ago

Hi! Thanks so much for your quick response!

You were absolutely right: It turned out to be a transient quirk. From Friday through Sunday I couldn't run any of my scripts, but today they all work fine. I'm so sorry for the false alarm!

-Gray