CSWeb is the preeminent CSPro synchronization option. It is a web server running the CSPro
synchronization service and is best suited for censuses and large surveys. CSWeb can be run on any web server with PHP and MySQL. It can be hosted on a headquarters computer, a hosted website, or a cloud-based virtual server. Configuring and maintaining a CSWeb server requires experience with web server
administration and cybersecurity. Users without these skills should consider using
Dropbox or
FTP instead.
In addition to using CSWeb as a synchronization service, directly accessing data stored on CSWeb is possible using the
CSWeb data source.
The resource of a CSWeb
connection string is the server URL. The username and password can also be specified in the connection string. If the username and password are not specified, the user will be prompted to enter them the first time the connection is made.
These are options that can be specified in the connection string. Note that values must be
properly encoded based on the way that the connection string is defined (as a string, as a
JSON object, or as a
CSPro URI).
| Property Name and Values | Description |
| |
| "username" | The user's username. This is only used if a password is also provided. |
| |
| "password" | The user's password. Hardcoding passwords in applications is not recommended. This is only used if a username is also provided. |
The following are examples of how to create connections to CSWeb:
// CSPro will prompt for the username and password
syncconnect("https://example.org/csweb/api");
// the credentials are specified using percent-encoding
// to properly account for any special characters
syncconnect(maketext(
"https://example.org/csweb/api|username=%s&password=%s",
encode(PercentEncoding, "jackw"),
encode(PercentEncoding, "MyPa$$w0rd!")
));
When connecting to CSWeb, an access token is generated that provides access to the server for some amount of time without needing to always provide a username and password. This token is stored in your operating system's secure storage. You can use the
Manage Credentials dialog to manually clear this credential.