This is a proposed optional extension to the core OpenRosa standards for OpenRosa-compliant servers to provide client settings. This is in response to ongoing user requests to configure a fleet of ODK clients remotely and an alternative to the rejected matchExactly
proposal.
The only component of this extension is a /client-settings
endpoint. A GET
request to this endpoint with OpenRosa headers results in a response with OpenRosa response headers and a JSON body. It does not use the (edit: not relevant)OpenRosaResponse
XML envelope.
The response body is JSON. There are at most two top-level objects with keys "general"
and "admin"
. Each of these objects has a set of optional properties.
{
"general" : {
"protocol": {"odk_default", "google_sheets", "other"},
...
},
"admin" : {
"admin_password": Boolean,
...
},
}
The general
and admin
split is because Collect lets users set an admin password and disable some subset of functionality. Having two separate objects makes it possible to use the same key for the actual setting and whether or not it should be enabled. This also matches the structure of the existing Collect settings QR code. Clients could choose to support some subset of the optional settings keys.
I’ll create a thread to standardize settings keys and values since that feels like a separate discussion from how the data would be exchanged.
Similar to the formList
endpoint, the standard would leave it up to servers how to generate this settings file. For example, it may be up to a user to log into the server and select from a series of named configurations or a project administrator may impose a configuration on all users collecting data for that project. This will depend on the design of the server. CC @Ukang_a_Dickson
The standard would leave it up to clients when (if ever) to actually fetch those settings. This is not a trivial question for Collect to answer since it is never guaranteed to be online.
My current thinking is that in Collect, when any change is made to server URL or credentials, a settings fetch attempt would be made. If that attempt failed because of no connectivity, Collect would try again the next time it got connectivity. It would also try to fetch settings every time a form list request was made. The Last-Modified
and If-Modified-Since
headers would be used to avoid unnecessary transfers.
I’m looking forward to seeing what others think, particularly @Xiphware and @tomsmyth who provided valuable feedback on the previous related proposal. Some guiding questions:
- Should OpenRosa headers be used?
- Are we ok with a JSON response
and ditching the OpenRosaResponse XML envelope(edit: the envelope is only relevant for transactional APIs)? - Is
client-settings
a reasonable name?