URL overview
The MobileSyncWebService supports the following URLs.
Note Fixed names are in camel case, parameters are in uppercase, and optional parameters are in square brackets.
See
See also
/Logon URL
Description
Obtains a session token for use in subsequent requests.
Get Request
The client must supply an UNICOM Intelligence Interviewer - Server Admin user name and password (select Basic authentication). The client must supply an Authorization header variable. The variable’s value consists of the word Basic followed by a space and then the Base64 encoded user name and password (in the form <username>:<password>). The client must also supply a Device-Id header variable that can be used to uniquely identify the device. The header variable can either be the ANDROID_ID or another application created GUID that is created the first time the application is installed and used. The header variable is used to track the number of unique devices that use the synchronization service. For more information regarding ANDROID_ID, see the Android developer Settings.Secure documentation:
Get Response
When the user name and password are correct, the HTTP response is empty and produces a 200: OK status code. When the user name or password are not correct, a 401: Unauthorized status is returned. A successful response also contains a Session-Token header variable. The variable is a GUID that is generated by theSyncWebServiceV2 and tracked by the MobileSyncWebService. All subsequent requests to the web service require that the session token is included in the header.
See also
/Projects URL
Description
Retrieves a list of project names that are currently assigned to the interviewer.
Get Request
/SPSSMR/MobileSync/Projects
The request must include the Session-Token header variable.
Get Response
Example response:
<Projects>
<Project Name="Museums" />
<Project Name="ShortDrinks" />
</Projects>
For more information, see the Projects XML (see
XML schema definitions).
See also
/Projects/PROJECT URL
Description
Retrieves project information.
Get Request
/SPSSMR/MobileSync/Projects/Museum
Get Response
The response includes the project's Version, Language, Context, LabelType, and Routing information. It also includes attributes that indicate if sample or quota are used. The Context collection contains contexts that can be used as the Label, CustomProperty, or both.
When a project includes sample or quota, the sample and quota URLs must always be called. Because is not possible to ascertain from the Projects XML that sample or quota updates are available, they must be assumed to always be required.
Example response:
<Project Name="sampletest" Label="Sample test"
UseQuota="false" UseSample="true">
<Settings ActiveVersion="LATEST" />
<Versions>
<Version Name="1" />
</Versions>
<Questions>
<Languages>
<Language Name="ENU" Default="true" />
</Languages>
<Contexts>
<Context Name="Analysis" />
<Context Name="Question" Default="true" />
<Context Name="QC" />
<Context Name="Paper" />
<Context Name="CARDCOL" />
</Contexts>
<LabelTypes>
<LabelType Name="Label" Default="true" />
<LabelType Name="INSTRUCTION" />
</LabelTypes>
</Questions>
<Routings>
<Routing Name="Paper" Default="true" />
</Routings>
</Project>
See also
/Projects/PROJECT/Questions/ [VERSION]/[LANGUAGE]/[LABELCONTEXT]/ [LABELTYPE]/[CUSTOMPROPERTIESCONTEXT] URL
Description
Retrieves the Question XML for the specified version and LCL (Language, LabelContext, LabelType). Multiple values can be provided in a comma separated list.
When the CustomPropertiesContext is specified, the Question and Category nodes include all properties in the specified context. CustomProperties are useful for third parties when passing information to the mobile application. All parameters are optional. When parameters are not specified, the latest version and default LCL are used. Question is the default Context, regardless of the MDM document's default value).
When CustomPropertiesContext is not specified, no custom properties are returned. An optional parameter can only be specified if all preceding parameters in the URL are specified. For example, to specify a language, the required version must also be specified. The "-" special value can be used in place of the Version, Language, Context, or LabelType to indicate the value has not been specified, and the latest version or default LCL must be used.Version can contain a colon (for example, 1:2). The colon is translated to a period (for example, 1.2) in the ProjectInfo XML and must be specified as a period in the URL.
Get Request
The caller can include If-Modified-Since in the header to request only updated files.
Example URLs:
/SPSSMR/MobileSync/Projects/Museum/Questions
/SPSSMR/MobileSync/Projects/Museum/Questions/4
/SPSSMR/MobileSync/Projects/Museum/Questions/-/en-US
/SPSSMR/MobileSync/Projects/Museum/Questions/-/en-US,fr-FR
Get Response
The Question XML is returned, or an HTTP 304 message if the file was not modified. Example response:
<Questions Project="sampletest" Version="1" Language="ENU"
Context="Question" LabelType="Label"
CustomPropertiesContext="Question,QC">
<Question QuestionFullName="Quest2" QuestionDataType="Long">
<Label Text="Question 2" />
<Validation RangeExpression="[0..255]"
MinValue="0" MaxValue="255" />
</Question>
<Question QuestionFullName="Quest3" QuestionDataType="Text">
<Label Text="Question 3" />
<Validation RangeExpression="[1..]" MinValue="1" />
</Question>
</Questions>
See also
/Projects/PROJECT/Routing/ [VERSION]/[ROUTINGCONTEXT] URL
Description
Retrieves the Routing XML for the specified version and routing context. The version and routing context are optional, but when they are not specified, the latest version and default routing are used. An optional parameter can only be specified if all preceding parameters in the URL are specified. For example, to specify a routing context, the required version must also be specified. A - (hyphen) an be used in place of the Version, Language, Context, or LabelType to indicate the value has not been specified, and the latest version or default LCL must be used.
Versions use the M:N format (for example, 1:2). The colon character is not valid on the URL. Therefore, a version of 1:2 must be formatted as 1.2 in the URL.
Get Request
The caller can include If-Modified-Since in the header to request only updated files.
Example URLs:
/SPSSMR/MobileSync/Projects/Museum/Routing
/SPSSMR/MobileSync/Projects/Museum/Routing/4
/SPSSMR/MobileSync/Projects/Museum/Routing/-/Mobile
Get Response
The Routing XML is returned, or an HTTP 304 message if the file was not modified.
Example response:
<Routing Project="sampletest" Version="1"
RoutingContext="Paper">
<Ask Name="Respondent" Question="Respondent" />
<Ask Name="Quest1" Question="Quest1" />
<Ask Name="Quest2" Question="Quest2" />
<Ask Name="Quest3" Question="Quest3" />
</Routing>
See also
/Projects/PROJECT/Quotas URL
Description
When the project includes quota, the URL retrieves the quota descriptions and targets.
Get Request
Example URL:
/SPSSMR/MobileSync/Projects/Museum/Quotas
Get Response
Example response:
<Quota>
<QuotaCell QuotaID="1" Name="Top.(0.Total).(0.R1)"
MatrixName="quota_total" MatrixID="1" Metadata=""
PendMode="Normal" Flag="Counter" PendLimit="-1"
Target="100" PendCount="0" CompleteCount="1"
PreviousCompleteCount="1" RollbackCount="1">
<Expression>
<Text>Total.HasAnswer({R1})</Text>
<Opcodes>
<Opcode Code="PushCategorical">
<Operand>r1</Operand>
</Opcode>
<Opcode Code="Function">
<Operand>HasAnswer</Operand>
<Operand>1</Operand>
<Operand>Total</Operand>
</Opcode>
</Opcodes>
</Expression>
</QuotaCell>
</Quota>
See also
/Projects/PROJECT/SampleData URL
Description
When the project includes sample data, the URL retrieves the sample record definition and sample records that are assigned to the logged in interviewer. Records are returned regardless of which Queue they are in. Associated case data might exist when an interview is transferred between interviewers. The case data's response XML is included in the URL response. If the client has existing sample data, the client should include information about the existing sample. Including the information ensures that only changes are retrieved.
The sample management script and call outcomes are not included. It is expected that the mobile application will hard-code rules, or download any rules as a resource file. Call outcomes are described in
Call outcomes, and can be hard-coded. When modifiable call outcomes are required, the MobileSyncWebService can be modified to include URLs that convert and download the metadata files. Other settings, such as the fields that display in UNICOM Intelligence Interviewer - Offline for Windows, are also not included.
Get Request
Example URL:
/SPSSMR/MobileSync/Projects/Museum/SampleData
Example XML:
<SampleData>
<SampleRecords>
<SampleRecord ID="ID10" ReturnTime="2014-10-17T07:36:13Z" HasCaseData="true" Unassigned="false" />
<SampleRecord ID="ID11" ReturnTime="2014-10-17T07:36:27Z" HasCaseData="true" Unassigned="false" />
</SampleRecords>
</SampleData>
Get Response
Example response:
<SampleData>
<SampleFields>
<SampleField Name="Queue" DataType="Text" />
<SampleField Name="Active" DataType="Boolean" />
<SampleField Name="Test" DataType="Boolean" />
<SampleField Name="CallOutcome" DataType="Text" />
<SampleField Name="ActivityStartTime" DataType="Date" />
<SampleField Name="UserId" DataType="Text" />
...
</SampleFields>
<SampleHistoryFields>
<SampleField Name="UserId" DataType="Text" />
<SampleField Name="SampleId" DataType="Text" />
<SampleField Name="CallOutcome" DataType="Text" />
<SampleField Name="InterviewMode" DataType="Text" />
</SampleHistoryFields>
<SampleRecords>
<SampleRecord ID="ID10" ReturnTime="2016-10-17T07:36:13Z" CheckSum="aaaabbbbccccdddd" IsUnassigned="false">
<SampleFields>
<SampleField Name="Queue" DataType="Text">
COMPLETED
</SampleField>
<SampleField Name="Active" DataType="Boolean">
False
</SampleField>
<SampleField Name="Test" DataType="Boolean">
False
</SampleField>
<SampleField Name="CallOutcome" DataType="Text">
EarlyComplete
</SampleField>
<SampleField Name="ActivityStartTime" DataType="Date">2016-09-07T09:43:49Z
</SampleField>
<SampleField Name="UserId" DataType="Text">
pan
</SampleField>
...
</SampleFields>
<Response ID="ID10">
<Variable FullName="DataCollection.Status" DataType="Categorical" Value="{completed,signal}" />
<Variable FullName="DataCollection.StartTime" DataType="Date" Value="2014-10-17T07:36:04Z" />
<Variable FullName="DataCollection.FinishTime" DataType="Date" Value="2014-10-17T07:36:13Z" />
<Variable FullName="STRATA" DataType="Text" Value="10" />
<Variable FullName="AGENT" DataType="Categorical" Value="{r10}" />
<Variable FullName="FirstInterview" DataType="Categorical" Value="{yes}" />
<Variable FullName="randomSelect" DataType="Categorical" Value="{branda,brandb}" />
<Variable FullName="BrandRating" DataType="Categorical" Value="{poor}" />
</Response>
</SampleRecord>
<SampleRecord ID="ID11" ReturnTime="2014-10-17T07:36:27Z" CheckSum="1111222233334444" IsUnassigned="false" />
</SampleRecords>
</SampleData>
See also
/Projects/PROJECT/Resources URL
Description
Retrieves files that are associated with the project (for example, HTML templates, CSS files, images, audio files, and video files). Each file is retrieved individually with a more specific URL.
Files that are used internally by MobileSyncWebService, such as
<Project>.mdd, the related DDF file, and other files, are not listed in the returned Resources XML (see
XML schema definitions).
The third party mobile application does not have to download all resources. The mobile application can download only the resources in a particular directory that are related to the application. For example, the third party mobile application SUPERMOBILE can request that authors place their files in a directory named SUPERMOBILE. Authors download files from only the SUPERMOBILE directory. Use the MobileSync web.config setting ProjectResourcesExcludeList to define which resources to download. The default setting stops the mobile application from downloading *.mdd files, and other files that are not related to the survey formatting.
Get Request
Example URL:
/SPSSMR/MobileSync/Projects/Museum/Resources
The following URL retrieves the DefaultLayout.htm file:
/SPSSMR/MobileSync/Projects/Museum/Resources/DefaultLayout.htm
The following URL retrieves the contents of the DefaultLayout.htm_Files directory:
/SPSSMR/MobileSync/Projects/Museum/Resources/DefaultLayout.htm_Files
Get Response
Resources XML includes the Name and LastModified time (in UTC) for each directory and file. Example responses:
<Resources>
<File Name="DefaultLayout.htm" LastModified="2013-04-12T09:01:32Z" />
<Directory Name="DefaultLayout.htm_Files" LastModified="2013-04-12T09:01:32Z" />
</Resources>
Use the following URL to retrieve the DefaultLayout.htm file:
/SPSSMR/MobileSync/Projects/Museum/Resources/DefaultLayout.htm
Use the following URL to retrieve the contents of the DefaultLayout.htm_Files directory:
/SPSSMR/MobileSync/Projects/Museum/Resources/DefaultLayout.htm_Files
<Resources>
<File Name="default.css" LastModified="2013-04-12T09:01:32Z" />
<File Name="default.js" LastModified="2013-04-12T09:01:33Z" />
<Directory Name="images" LastModified="2013-04-12T09:01:33Z" />
</Resources>
See also
/Projects/PROJECT/Resources/[DIRECTORY]/[FILE] URL
Description
Retrieves files that are associated with the project (for example, HTML templates, CSS files, images, audio files, and video files). Each file is retrieved individually with a more specific URL.
HTTP responses that contain file data also include a Last-Modified header variable. The client can use the variable to set the file-time when the file is written. The file-time avoids issues with inaccuracies in the client system clock, time-zones, and when the client later sends the time back to the server in the If-Modified-Since header variable.
The caller can compare a file's LastModified time, with the saved file's last modified time, to determine if it is necessary to request the file.
Get Request
The caller can include If-Modified-Since in the header to request only updated files. Example URLs:
/SPSSMR/MobileSync/Projects/Museum/Resources/DefaultLayout.htm
/SPSSMR/MobileSync/Projects/Museum/Resources/DefaultLayout.htm_Files
/SPSSMR/MobileSync/Projects/Museum/Resources/DefaultLayout.htm_Files/default.css
Get Response
The file is returned, or an HTTP 304 message if the file was not modified.
See also
/Projects/PROJECT/RespondentData URL
Description
Submit an XML file that contains all respondent data for the project, including case data responses, sample record updates, sample history records, quota updates, and quota transaction records. The respondent data is uploaded in one large XML file: see
Uploading respondent data.
For performance reasons, the client application should archive the request body (into a ZIP file) and specify Content-Encoding: zip in the header.
Get Request
Example URL:
/SPSSMR/MobileSync/Projects/Museum/RespondentData
Get Response
HTTP 200 message if the upload is successful.
See also
/Projects/PROJECT/RespondentFiles/FILE URL
Description
Submits audio, image, and other files that are related to the respondent data. File naming conventions associate the files with the respondents.
▪Interview recording: c-<respondent_id>-<interviewer_id>-<part_number>.wma
▪Question recording: q-<respondent_id>-<question_full_name>.wma
▪Images: p-<respondent_id>-<question_full_name>.jpg
The LastModifiedTime must be included in the URL.
For performance reasons, the client application should archive the request body (into a ZIP file) and specify Content-Encoding: zip in the header.
Get Request
Example URL:
/SPSSMR/MobileSync/Projects/Museum/RespondentFiles/c-RespId1-InterviewerId1-1.wma
/SPSSMR/MobileSync/Projects/Museum/RespondentFiles/q-RespId1-Gender.wma
Get Response
None
See also
/Resources/[DIRECTORY]/[FILE] URL
Description
Retrieves shared content and works similarly to the /Projects/PROJECT/Resources URL. The /Resources URL returns only sub-directory and file names for the top-level SharedContent directory. The sub-directory contents, and the actual files, can be retrieved using the appropriate lower level URL.
HTTP responses that contain file data also include a Last-Modified header variable. The client can use the variable to set the file-time when the file is written. The file-time avoids issues with inaccuracies in the client system clock, time-zones, and when the client later sends the time back to the server in the If-Modified-Since header variable.
The SharedContent directory is often very large after installation (for example, 4591 files in 827 directories). The client can retrieve the SharedContent directory structure and download only the required artifacts. For example, an application named SUPERMOBILE might download only the SUPERMOBILE sub-directory.
Get Request
Example URL:
/SPSSMR/MobileSync/Resources
Get Response
Example response:
<Resources>
<File Name="authenticate.htm" LastModified="2013-04-12T09:01:32Z" />
<File Name="authfailed.htm" LastModified="2013-04-12T09:01:32Z" />
<Directory Name="Dojo" LastModified="2013-04-12T09:01:32Z" />
</Resources>
See also
/Logs/[SUBDIRECTORY] URL
Description
Used by the client to submit non-project specific data to the server. Zipped files can be POSTed to the URL and are extracted to a sub-directory under the main UNICOM Intelligence logs directory. When a subdirectory is not specified, logs are unzipped into a default logs directory. When a subdirectory is specified, logs are extracted to <LogsDirectory>/SUBDIRECTORY. The SUBDIRECTORY name is limited to alphanumeric characters, - (hyphen), and _ (underscore) characters.
For performance reasons, the client application should archive the request body (into a Zip file) and specify Content-Encoding: zip in the header.
Get Request
Example URLs:
/SPSSMR/MobileSync/Logs/MallKioskApp
/SPSSMR/MobileSync/Logs/Jonathans-PC
/SPSSMR/MobileSync/Logs/DD69D6A9-03DE-47F0-8A74-0ECC0B2A212C
Get Response
The response is always empty with a 200: OK message, or 400: Bad Request message (when the ZIP file is invalid).
See also
/Logoff URL
Description
Invalidates the session token. After the Logoff method is called, the session token is no longer valid and Logon must again be requested in order to generate a new session token.
Get Request
–
Get Response
–
See also
/Version URL
Description
Requests the MobileSyncWebService API version information. Version information is useful for determining when new features are available.
Get Request
Example URL:
/SPSSMR/MobileSync/Version
Get Response
Example response:
<string>7.0.1.0 </string>
See also