Save data in a form

Make a POST request to save form data for a defined visit in a study.

Note:

  • To run these Oracle Clinical One Platform API calls, you need to include an authentication token. For instructions on how to generate your authentication token, see Get a token for authentication and Use the token to make an API request.
  • For every API call make sure you construct the URL using the correct server URL and path parameters values.
For the following API calls, you need the studyName, studyID, studyVersion and mode, as well as the subjectId, eventId, formId, itemId 's and siteId. These values are retrieved as part of a prerequisite or a previous task, see Retrieve study information.

Step 1: Create the request payload file

This file contains the input data you want to save to the form. The form needs to be predefined with these particular questions (each associated to a given itemId) in order to save data to the form. The data elements reference the group of questions within that form and include the itemId of the question and the value for the answer to save.

In this example, we are considering a simple demography form that asks for the gender and race of the subject, using codelist values as answers.

Create a JSON file called saveform.json and copy the following:

Note:

Replace each of these values with those relevant to you. You can include more or less items and different type of answers, according to the form you are saving data into.
{  "context":
    {  "studyName": "TestStudy",
        "studyVersion": "1.0.0.1",
        "siteId": "84EE8610B5E6466D9B7B64FE99F6606A",
        "subjectId": "52682768FEF54E9FAD8BEA630448B5EE",
        "eventId": "750739AD259347C8A37612A8D37538A4",
        "formId": "7C68D67B1E154B9596181323B97160A6",
        "eventInstanceNum": null  },
    "dataElements": [
    {  "itemId": "9FD1445119FA449A80D8256EAEFC7F43",
        "value": "1"    },
    {    "itemId": "6F33DEF4378E45AEACFFA72A45E0AC05",
        "value": "3" } }

Step 2: Save form data using payload file

Run the following cURL call to save multiple data elements into a form for a subject and visit:

curl -X POST "https://tenant.clinicalone.oraclecloud.com/ec-dc-svc/rest/v11.0/studies/{studyId}/{mode}/dataelements" -d "@saveform.json"

When saving data to a form, the payload always follows this format. However, the data elements may appear differently depending on your form design. To learn more about what to include in your payload, see the How to use web browser developer tools section in Troubleshoot.

For more information on how to build the payload and other parameters, see Create multiple data elements for a subject.

Tip:

There are many different Clinical One APIs that could help you complete a particular task. Browse for these and other related APIs under the Tasks section of this guide. If you see any deprecated endpoint, look for its newest version.