This service allows a file of subject data to be imported into a project. This is the same functionality as the Import Data page in Studytrax.
Roles Required: Project Management
Determine service endpoint for Post
Validate file and return statistics of the changes the the import would have made:
https://xxx.studytrax.com/api/v1/customers/yyy/projects/zzz/subjects/import?analysisOnly=true
Import the file:
https://xxx.studytrax.com/api/v1/customers/yyy/projects/zzz/subjects/import
Customize the URL
Change "xxx" to the prefix of the server you are targeting (e.g., "my" if target is https://my.studytrax.com)
Change "yyy" to the Customer ID
Change "zzz" with the Project ID
Enter the URL into the request URL field
Add an Authentication token to the header (from the previous Authentication steps)
Select Body
Select the form-data option to allow both the file and JSON to be sent
Add the file to the body as File Content
In Postman, to add a file in the body section, hover over the field for Key
A drop down will become visible
Select File in the drop down
Click Select Files and select the data file to import
Add the JSON with the import options to the request body
Enter the JSON in the Value field
The options are the same as those on the subject data import page in the Studytrax application
Example options JSON: {"addMedicationsToProject": false, "allowSubjectsToExist": false, "changeReason": "test reason", "includeDuplicateSubjectMedications": false, "performDetailedValidation": false, "treatBlankAsDelete": false}
In Postman, the content type needs to be application/json
If the Content Type column is not displayed, click … and check the box for Content Type
Start typing in the Content Type field and select application/json
Post the request by clicking Send
The result returned will be JSON that contains any errors or warnings and the statistics for the records modified, or, if the query string “analysisOnly=true” was added to the URL, the statistics represents records that would have been modified