-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy path5_Export_Metadata.do
More file actions
36 lines (26 loc) · 893 Bytes
/
5_Export_Metadata.do
File metadata and controls
36 lines (26 loc) · 893 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/**
Using the REDCap API with Stata
Luke Stevens, Murdoch Childrens Research Institute
20-Jun-2017
5. Export_Metadata.do
Illustrating metadata (data dictionary) download - not just records.
--form fields=varname // download varname metadata (only)
--form fields[]=varname1 // download varname1 ...
--form fields[]=varname2 // ...and varname2 metadata
--form forms=formname // download all variables of formname
--form forms[]=formname1 // download all variables of formname1 ...
--form forms[]=formname2 // ...and all from formname2
*/
version 12
set more off
clear
local token "<insert your token here>"
local outfile "exported_metadata.csv"
shell c:\curl\curl.exe ///
--output `outfile' ///
--form token=`token' ///
--form content=metadata ///
--form format=csv ///
"https://redcap.mcri.edu.au/api/"
import delimited `outfile'
br