Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Info

Page Under Development

This page provides the APIs call explains how to find the API calls time for the OpenClinica; by calling these APIs, you can find out how much time the these API call takes calls take for a any specific study. Follow the below steps to run the APIs.

What is the need behind running these APIs?

When the 'OpenClinica Study Data Importer' job takes more time (20-30 minutes) than an expected threshold, it becomes difficult to test the configuration every time and run the job to sync in the data.

In this case, you can cross-check the time taken by the job to complete by running these APIs using a terminal outside the OpenSpecimen.

Steps to run the APIs

  1. Invoke API to get the token on the terminal.

Expand
titleClick to expand

Code Block
curl -X POST \
--data '{"username": "demo_username", "password": "demo_password"}' \
-H "Content-Type: application/json" \
https://qlhc2.build.openclinica.io/user-service/api/oauth/token

In the above code, the ‘POST’ and ‘Content-Type’ will remain fixed.

Code that will change is

Server credentials: Username and password

Server URL: https://qlhc2.build.openclinica.io will be your OpenClinica server URL

Once you run the above code, you will receive a token as shown in the below image.

...

Info

...

Every time, you will get a new token when you run the auth API.

https://qlhc2.build.openclinica.io: This URL comprises 4 parts: protocol, hostname, port, and the path.

  • The protocol decides what language should be used for communication between the 2 parties. The parties here are the client and server.

  • The hostname decides where the server is placed.

  • The port number is optional. When not specified, the protocol defined standard port is used. For https, it is 443. For http, it is 80.

  • The path decides the location of the resource on the host. When not specified, it is /

2. Invoke data API to get the study data

Expand
titleClick to expand

Code Block
curl -X GET -H "Accept: application/xml" \
-H "Authorization: Bearer #1step_token" \
"https://qlhc2.openclinica.io/OpenClinica/pages/auth/api/clinicaldata/S_ISPY(TEST)/*/*/*?includeAudits=y&includeDNs=n&includeMedtadata=y&showArchived=n"

In the above code, the 'GET' and 'Authorization' will remain fixed.

Code that will change is

Token: #1step_token Use the token from #1 step

Server URL: https://qlhc2.build.openclinica.io will be OpenClinica server URL

Study OID: S_ISPY(TEST) will be the study OID from the OpenClinica.#1step_token Use the token from #1 step.

...

After running the data API, you will know how much time it takes to invoke the study data.

...

Once you get the APIs' exact time, you can inform the OpenClinica team (client) to resolve the issue.

What is the need behind running these APIs?

When the ‘OpenClinica Study Data Importer’ job takes more time (20-30 minutes) than an expected threshold, it becomes difficult to test the configuration every time and run the job to sync in the data.

In this case, you can cross-check the time taken by the job to complete by running these APIs using a terminal outside the OpenSpecimen.