Skip to content

Extends the REDCap API to facilitate locking and unlocking of instruments for a record.

License

Notifications You must be signed in to change notification settings

lsgs/redcap-locking-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


Locking API

Luke Stevens, Murdoch Children's Research Institute https://www.mcri.edu.au


Summary

Read lock status, lock and unlock entire records or their data entry forms via API calls.

Post api token and record[,event][,instrument][,instance][,arm] to your regular system API endpoint, using the following query string:

?NOAUTH&type=module&prefix=locking_api&page=<action page>

<action page> must be one of:

  • status: Obtain current lock state of the record[,event][,instrument][,instance][,arm]
  • lock: Lock the record[,event][,instrument][,instance][,arm]
  • unlock: Unlock the record[,event][,instrument][,instance][,arm]

Note it is not possible to lock a form on data level that has not yet had any data entry.

Example

Data Level

curl -d "token=ABCDEF0123456789ABCDEF0123456789&returnFormat=json&record=1001&event=event_1_arm_1&instrument=medication&instance=4"
    "https://redcap.ourplace.edu/api/?NOAUTH&type=module&prefix=locking_api&page=status"

Record Level

curl -d "token=ABCDEF0123456789ABCDEF0123456789&returnFormat=json&record=1001&arm=1&lock_record_level=true"
    "https://redcap.ourplace.edu/api/?NOAUTH&type=module&prefix=locking_api&page=status"

Return Format (optional)

Return Format options are the usual csv, json or xml (default).

Lock Record Level (optional)

Locks the entire record if set to true.

Format (optional and limited)

JSON format allows to submit multiple records at once. Currently only supported in lock on record level.

Record/Event/Instrument/Instance/Arm Specification