We hope you'll join us for our 4/23 webinar on using data tables to apply reference ranges and AE codes in OC4. For more information and to register, visit https://register.gotowebinar.com/register/2882170018956684555

Webservice to retrieve CRF data? (version 3.14)



  • RaviVRaviV Posts: 30
    Got it, thanks a lot Tomas.
  • RaviVRaviV Posts: 30
    edited January 20
    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.