Versions Compared

Key

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

...

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 above code, ‘POST’ and ‘Content-Type’ will remain fixed.

Code that will vary

Server credentials: Username and password

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

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

  • Protocol: Decides language used for communication between the client and the server.

  • Hostname: Server placement.

  • Port number: It’s a communication endpoint. It's optional. When not specified, the protocol defined standard port is used. For https, it is 443. For http, it is 80. Optional; default 443 for HTTPS; 80 for HTTP

  • Path: Decides the location of the resource. When not specified, it is /

After invoking auth API, you will receive a token, as shown below.

Info

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

...