{"id":42044188,"url":"https://github.com/lsgs/redcap-locking-api","last_synced_at":"2026-01-26T06:05:43.114Z","repository":{"id":53567676,"uuid":"150502626","full_name":"lsgs/redcap-locking-api","owner":"lsgs","description":"Extends the REDCap API to facilitate locking and unlocking of instruments for a record.","archived":false,"fork":false,"pushed_at":"2023-10-30T03:41:07.000Z","size":109,"stargazers_count":14,"open_issues_count":0,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2023-10-30T04:37:08.576Z","etag":null,"topics":["mcri","murdoch-childrens","redcap","redcap-api","redcap-external-module","redcap-repo"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lsgs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-09-26T23:42:13.000Z","updated_at":"2023-09-19T05:16:30.000Z","dependencies_parsed_at":"2023-02-09T18:46:19.191Z","dependency_job_id":null,"html_url":"https://github.com/lsgs/redcap-locking-api","commit_stats":null,"previous_names":[],"tags_count":6,"template":null,"template_full_name":null,"purl":"pkg:github/lsgs/redcap-locking-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lsgs%2Fredcap-locking-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lsgs%2Fredcap-locking-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lsgs%2Fredcap-locking-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lsgs%2Fredcap-locking-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lsgs","download_url":"https://codeload.github.com/lsgs/redcap-locking-api/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lsgs%2Fredcap-locking-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28768053,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-26T03:54:34.369Z","status":"ssl_error","status_checked_at":"2026-01-26T03:54:33.031Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["mcri","murdoch-childrens","redcap","redcap-api","redcap-external-module","redcap-repo"],"created_at":"2026-01-26T06:05:42.283Z","updated_at":"2026-01-26T06:05:43.109Z","avatar_url":"https://github.com/lsgs.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"********************************************************************************\n# Locking API\n\nLuke Stevens, Murdoch Children's Research Institute https://www.mcri.edu.au\n\n********************************************************************************\n## Summary\n\nRead lock status, lock and unlock entire records or their data entry forms via API calls. \n\nPost api token and `record[,event][,instrument][,instance][,arm]` to your regular system API endpoint, using the following query string: \n\n```http\n?NOAUTH\u0026type=module\u0026prefix=locking_api\u0026page=\u003caction page\u003e\n```\n\n`\u003caction page\u003e` must be one of:\n* **status**: Obtain current lock state of the `record[,event][,instrument][,instance][,arm]`\n* **lock**:   Lock the `record[,event][,instrument][,instance][,arm]`\n* **unlock**: Unlock the `record[,event][,instrument][,instance][,arm]`\n\nNote it is not possible to lock a form on data level that has not yet had any data entry.\n\n## Example \n#### Data Level\n```bash\ncurl -d \"token=ABCDEF0123456789ABCDEF0123456789\u0026returnFormat=json\u0026record=1001\u0026event=event_1_arm_1\u0026instrument=medication\u0026instance=4\"\n    \"https://redcap.ourplace.edu/api/?NOAUTH\u0026type=module\u0026prefix=locking_api\u0026page=status\"\n```\n#### Record Level\n```bash\ncurl -d \"token=ABCDEF0123456789ABCDEF0123456789\u0026returnFormat=json\u0026record=1001\u0026arm=1\u0026lock_record_level=true\"\n    \"https://redcap.ourplace.edu/api/?NOAUTH\u0026type=module\u0026prefix=locking_api\u0026page=status\"\n```\n\n## Return Format (optional)\nReturn Format options are the usual csv, json or xml (default).\n\n## Lock Record Level (optional)\nLocks the entire record if set to true.\n\n## Format (optional and limited)\nJSON format allows to submit multiple records at once. Currently only supported in lock on record level.\n\n## Record/Event/Instrument/Instance/Arm Specification\n\n* **record**: Required. \n* **event**: A valid unique name or event id for the project (if longitudinal).\n* **instrument**: A valid form name for the project, as per data dictionary.\n* **instance**: Instance number for repeating event or instrument.\n* **arm**: Arm number for projects with multiple arms (if Lock Record Level is used). Defaults to 1.\n\nParameters `arm` and `event` will be ignored if the project is not longitudinal.\n\nIf an instance value \u003e=2 is submitted for a non-repeating event/instrument then an error will be returned.\n\nParameter `arm` will be ignored if Lock Record Level is false.\n\n### Examples\n#### Data Level\n* Screening form in Event 1 for record 1001 (instance not required as not a repeating form):\n    ```http\n    record=1001\u0026event=event_1_arm_1\u0026instrument=screening\n    ```\n\n* First instance of repeating Concomitant Medication form in Event 1 for record 1001:\n    ```http\n    record=1001\u0026event=event_1_arm_1\u0026instrument=concomitant_medication\u0026instance=1\n    ```\n\n* All instances (if any) of repeating Concomitant Medication form in Event 1 for record 1001: \n    ```http\n    record=1001\u0026event=event_1_arm_1\u0026instrument=concomitant_medication\n    ```\n\n* All forms in Event 1 for record 1001 (note the instrument \u0026 instance parameters are empty): \n    ```http\n    record=1001\u0026event=event_1_arm_1 OR record=1001\u0026event=event_1_arm_1\u0026instrument=\u0026instance=\n    ```\n\n* Visit Admin forms across all events for record 1001: \n    ```http\n    record=1001\u0026event=\u0026instrument=visit_admin\n    ```\n\n* Error - record required: \n    ```http\n    record=\u0026event=\u0026instrument=visit_admin\n    ```\n\n* Error - not a repeating event: \n    ```http\n    record=1001\u0026event=event_1_arm_1\u0026instrument=\u0026instance=2\n    ```\n\n* Error - JSON format not supported on data level:\n    ```http\n    record=1001\u0026event=event_1_arm_1\u0026format=json\n    ```\n\n#### Record Level\n* Get record level lock status for record 1001:\n    ```http\n    page=status\u0026record=1001\u0026lock_record_level=true\n    ```\n* Set record level lock for record 1001:\n    ```http\n    page=lock\u0026record=1001\u0026lock_record_level=1\n    ```\n* Unlock record with ID 2432:\n    ```http\n    page=unlock\u0026record=1001\u0026lock_record_level=true\n    ```\n* Lock multiple records 1001, 1002, 1003 using JSON format:\n    ```http\n    page=lock\u0026lock_record_level=true\u0026format=json\n    ```\n    ```json\n    record: [1001, 1002, 1003]\n    ```\n\n\n## Returned Data\n#### Lock Data Level\nAll API calls (*i.e.*, status, lock, unlock) return a set of the event/instrument/instance combinations for the record/event/instrument/instance requested. For each combination the lock status is returned as follows:\n\n* **1**: Locked\n* **0**: Not locked (but form data exists)\n* **\u0026lt;empty\u0026gt;**: No data exists for form\n\nNote that this enables you to determine whether data has ever been entered for an instrument, which is not possible using the regular 'Export Records' or 'Export Reports' API methods. ;-) \n\n#### Lock Record Level\nAll API calls (*i.e.*, status, lock, unlock) return the record level status for the records/arm requested in a specified format.\n\n### CSV Example\n\ninput: `record=1001\u0026instrument=visit_admin`\n\noutput:\n```csv\nrecord,redcap_event_name,instrument,instance,lock_status,username,timestamp\n1001,visit_1_arm_1,visit_admin,1,1,luke.stevens,2018-12-31 23:59:59\n1001,visit_2_arm_1,visit_admin,1,0,,\n1001,visit_3_arm_1,visit_admin,1,,,\n```\n\n## Contributor(s)\nEkin Tertemiz, Swiss Tropical and Public Health Institute\n\n********************************************************************************","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flsgs%2Fredcap-locking-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flsgs%2Fredcap-locking-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flsgs%2Fredcap-locking-api/lists"}