The locking of entries and cases is implemented via the following endpoint.
=> POST /investigation/:id/lock-items
{
"cases": [
{ "identifier": ":hexCaseAIdentifier" },
{ "identifier": ":hexCaseBIdentifier" }
],
"responses": [
{ "identifier": ":hexResponseAIdentifier" },
{. "identifier": ":hexResponseBIdentifier" }
],
"status": "locked"
}
<= 204 No Content
The endpoint is analog to the one used to archive items. At least one of the cases
or responses
payload attribute must be sent, otherwise the server will send a 400 Bad Request
response. To unlock items, the status
attribute of the payload must be equal to unlocked
.
Locking a resource will appear in the activity log of the study and will prevent any modification to the resource until it is unlocked.
As long as a user is able to view a resource, they will be able to lock it and unlock it.
The locking status of a response will be included when requesting GET /investigation/:id/responses
and GET /response/:id
. The same will happen for cases, i.e. a locking attribute will be returned when requesting GET /investigation/:id/cases
.
=> GET /investigation/:id/responses
<= 200 OK
{
"investigation":"investigation/a97e4ae9fcd2a805",
"responses":[
{
"uri":"response/c82123845da5c82123795207d274c7a7",
"identifier":"c82123845da5c82123795207d274c7a7",
"b64Identifier":"AXpc3Zb+AXpc0otgC83Hpw==",
"creation":"2021-06-30T12:21:03.870Z",
"case":"4ecda92a10f84d53",
"responder":"4265e329cd1541ec",
"name":"Diego Menchaca",
"avatar":"/mediab64/avatar/dc1946ae2cabfe04c5bda569182ba8ce",
"items":{
"2608d4":"1",
"040f34":"100",
"eff0e3":"5",
"6bd3f0":"256",
"5a61d4":"",
"0577fa":"1623939300"
},
"reasons":{
"2608d4":0,
"040f34":0,
"eff0e3":0,
"6bd3f0":0,
"5a61d4":0,
"0577fa":0
},
"survey":"0c47679f962d0bcd",
"lockedAt":"2021-06-30T12:21:03.870Z",
"revisionUNIX":1625055731,
"revisionIdentifier":"0000017a5cde9d38"
},
{
"uri":"response/6f4bcb0cce336f4bcaa3f931799e6ed1",
"identifier":"6f4bcb0cce336f4bcaa3f931799e6ed1",
"b64Identifier":"AXpdO2BiAXpc0otgC81u0Q==",
"creation":"2021-06-30T14:03:30.274Z",
"case":"4ecda92a10f84d53",
"responder":"4265e329cd1541ec",
"name":"Diego Menchaca",
"avatar":"/mediab64/avatar/dc1946ae2cabfe04c5bda569182ba8ce",
"items":{
"2608d4":"",
"040f34":"",
"eff0e3":"",
"6bd3f0":"",
"5a61d4":"",
"0577fa":"1625061780"
},
"reasons":{
"2608d4":0,
"040f34":0,
"eff0e3":0,
"6bd3f0":0,
"5a61d4":0,
"0577fa":0
},
"survey":"0c47679f962d0bcd",
"status":"active",
"revisionUNIX":1625061810,
"revisionIdentifier":"0000017a5d3b6062"
}
]
}
=> GET /investigation/:id/cases
<= 200 OK
{
"uri":"investigation/a97e4ae9fcd2a805",
"cases":[
{
"identifier":"4ecda92a10f84d53",
"uri":"case/4ecda92a10f84d53",
"creation":"2021-06-30T12:14:42.085Z",
"label":"dfsfas",
"hidden":false,
"revisionIdentifier":"0000017a5cd7d2f0",
"editedAt":1625055286,
"creatorIdentifier":"4265e329cd1541ec",
"creatorNames":"Diego Menchaca",
"creatorAvatar":"/media/avatar/dc1946ae2cabfe04c5bda569182ba8ce",
"lockedAt": "2021-06-30T12:21:03.870Z"
},
{
"identifier":"10096b65cb1b0f8f",
"uri":"case/10096b65cb1b0f8f",
"creation":"2021-06-30T12:13:34.732Z",
"label":"Hello",
"hidden":false,
"revisionIdentifier":"0000017a5cd6d508",
"editedAt":1625055221,
"creatorIdentifier":"4265e329cd1541ec",
"creatorNames":"Diego Menchaca",
"creatorAvatar":"/media/avatar/dc1946ae2cabfe04c5bda569182ba8ce",
"status": "active"
}
]
}
=> GET /response/:id
<= 200 OK
{
"uri":"/response/7841f255e9717841d3990227829477c7",
"survey":"/survey/0c47679f962d0bcd",
"responder":"/user/4265e329cd1541ec",
"case":"case/4ecda92a10f84d53",
"items":{
"eff0e3":"",
"2608d4":"",
"c6f58d":"",
"5a61d4":"",
"6bd3f0":"",
"040f34":"",
"75c6b3":"0",
"c17286":"0",
"0577fa":""
},
"reasons":{
"eff0e3":0,
"2608d4":0,
"c6f58d":0,
"5a61d4":0,
"6bd3f0":0,
"040f34":0,
"75c6b3":0,
"c17286":0,
"0577fa":0
},
"revisionDate":1625570632,
"lockedAt": "2021-06-30T12:21:03.870Z"
}