• <GetStart>
  • CSPro User's Guide
    • The CSPro System
    • Data Dictionary Module
    • The CSPro Language
    • Data Entry Module
    • Batch Editing Applications
    • Tabulation Applications
    • Data Sources
    • Synchronization
      • Services
        • Overview
        • Synchronization Connection String
        • CSWeb
        • Bluetooth
        • Dropbox
        • FTP
        • Local Files
        • Syncable Name
      • Messages
    • CSPro Statements and Functions
    • Text Templates
    • Templated Reporting System
    • HTML, Markdown, and JavaScript Integration
    • Action Invoker
    • Appendix
  • <CSEntry>
  • <CSBatch>
  • <CSTab>
  • <DataManager>
  • <TextView>
  • <TblView>
  • <CSFreq>
  • <CSDeploy>
  • <CSPack>
  • <CSDiff>
  • <CSConcat>
  • <Excel2CSPro>
  • <CSExport>
  • <CSIndex>
  • <CSReFmt>
  • <CSSort>
  • <ParadataConcat>
  • <ParadataViewer>
  • <CSCode>
  • <CSDocument>
  • <CSView>
  • <CSWeb>

CSWeb Synchronization Service

Overview
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.
CSWeb Connection
A connection to CSWeb occurs as a result of a syncconnect function call, or as part of a CSPro operation such as a Simple Synchronization or an application deployment.
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 ValuesDescription
 
"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!")
));
Credential Storage
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.
See also: Synchronization Services, Synchronization Overview, Introduction to CSWeb