web API calls that only logged-in admin users can make | Brian Connolly | 2014-07-09 12:30 |
Status: Closed | ||
Hello, I am sorry to say we do not have a list of URL-accessible API calls. The ensureLogin API is designed for use with the JavaScript API and is probably not the best API to use with python. There are some APIs that can only be used by logged in users or users with administrator privilege, but ensureLogin is not one of those. As you probably know LabKey does have a Python client API (see https://www.labkey.org/wiki/home/Documentation/page.view?name=python). The python client API is definitely not as fully featured as the JAVA or JavaScript APIs but it does cover a number of the basic use cases. You can download the Python API by 1. Goto http://labkey.com/download-labkey-server 2. Click on the All Downloads tab 3. Download the zip file labed "Python Client API Library (.zip)" In addition, I have posted other sample python code, that might be of interest, at https://www.labkey.org/announcements/home/Developer/Forum/thread.view?entityId=6f6578c7-c8e6-1031-8ca1-6432661d362c&_docid=thread%3A6f6578c7-c8e6-1031-8ca1-6432661d362c As an example, inside the python client API we execute a request by doing something like # Create a password manager passmanager = urllib2.HTTPPasswordMgrWithDefaultRealm() # Add login info to the password manager passmanager.add_password(None, mymachine, myusername, mypassword) # Create the AuthHandler authhandler = urllib2.HTTPBasicAuthHandler(passmanager) # Create opener opener = urllib2.build_opener(authhandler) # Use the opener to fetch a URL request myrequest = urllib2.Request(myurl, mypostdata, {'Content-Type': 'application/json'}) response = opener.open(myrequest) I hope this helps you move forward. If I have not managed to answer your questions, please describe what you are trying to do in your python script as that will help me better understand your scenario. Thanks, Brian |
||