We are currently working on the forum. For the short-term, all forum content will be in read-only format. We apologize for the interruption and look forward to collaborating with you shortly. All the best in your research!

Webservice to retrieve CRF data? (version 3.14)



  • RaviVRaviV Posts: 30
    Got it, thanks a lot Tomas.
  • RaviVRaviV Posts: 30
    edited January 2020
    Hi Tomas,

    Regarding ...
    You basically have to emulate the GUI like access to OC and that triggers on server site spring authentication. This normally results to session ID that can be also stored in cookie so that it can be kept on client side and used as authentication token for every following request to OC.

    Do you have any sample code for that? I have been trying various options from postman, making post call to http://host:8080/OpenClinica/j_spring_security_check with the j_username, j_password and submit: Login as Parameters. But not successful.

  • toskriptoskrip Posts: 279 ✭✭✭
    one approach with curl you can find in that other post, otherwise with python request library it is straightforward as well:
    method = "S_DEFAULTS1/SS_01/*/*"
    dataFormat = "json"
    ocUrl = "http://localhost:8080/OpenClinica/"
    s = requests.Session()
    loginCredentials = {"j_username": "root", "j_password": "12345678"}
    r = s.post(ocUrl + "j_spring_security_check", loginCredentials)
    r = s.get(ocUrl + "rest/clinicaldata/" + dataFormat + "/view/" + method)
  • RaviVRaviV Posts: 30
    Thanks Tomas ... this is very helpful.
Sign In or Register to comment.