OfficeCore OfficeTrack API Reference
OfficeCore OfficeTrack API Reference
Copyright Notice
Copyright © 2012 OfficeCore.
All rights reserved.
Any technical documentation that is made available by OfficeCore is the copyrighted work of OfficeCore and
is owned by OfficeCore.
NO WARRENTY. The technical documentation is being delivered to you AS-IS, and OfficeCore makes no
warranty as to its accuracy or use. Any use of the technical documentation or the information contained
therein is at the risk of the user.
Documentation may include technical or other inaccuracies or typographical errors. OfficeCore reserves the
right to make changes without prior notice.
No part of this publication may be copied without the express written permission of OfficeCore.
Trademarks
OfficeCore, the OfficeCore logo, SMSCenter are trademarks of OfficeCore.
Microsoft, Windows, Office, Outlook, Excel, Office logo and Windows logo are registered trademarks of
Microsoft Corporation.
Other brands and product names mentioned in this manual may be trademarks or registered trademarks of
their respective companies and are hereby acknowledged.
3
Document Changes
Web Services
The web server exposes a few Web Services to in order to receive data from external sources, as well as to
allow external applications to query the server. Some of these Web Services require the use of Web Service
Extensions (WSE) for enhanced security.
Below is a list of all the Web Services exposed by the server and a general description of each Web Service.
A more detailed explanation about each Web Service is given below.
To improve usability and compatibility with other development languages, all of the Web Methods in these
web services accept only a single parameter "Request" which holds a XML document that represents the
request from the web method.
7
The web method accepts a single parameter request which needs to be a XML document in this format
<ImproveAddressRequest xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<UserName></UserName>
<Password></Password>
<City></City>
<Street></Street>
</ImproveAddressRequest>
ResultDataset This parameter holds the suggestions for addresses found by the server. The
parameter holds a dataset made of two fields City and Street.
8
The web method accepts a single parameter request which needs to be a XML document in this format
<FindAddressCoordinatesRequest xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<UserName></UserName>
<Password></Password>
<City></City>
<Street></Street>
<HouseNumber></HouseNumber>
</FindAddressCoordinatesRequest>
Parameter Description
Result Code The result of the Address search. The code can be one of the following:
NoMatchFound – Address not found
FullRequestFound– Exact match found for City, Street and House Number. The
coordinate results hold the exact location of the requested address.
PartialRequestFound– The address was partially found. The coordinate results
holds the boundaries of the found object.
InvalidUsernameOrPassword – The supplied username and password are not valid
UnknownErrorOccurred – An unknown error occurred
InvalidRequest – The request XML could not be parsed
E East coordinate. The value of this parameter can change according to the Result
Code. See the result codes for more details.
N North coordinate. The value of this parameter can change according to the Result
Code. See the result codes for more details.
S South coordinate. The value of this parameter can change according to the Result
Code. See the result codes for more details.
W West coordinate. The value of this parameter can change according to the Result
Code. See the result codes for more details.
9
The web method does not validate the Employee Numbers if they were supplied. The server will ignore
entries for invalid employee numbers. You can use the VerifyEmployeeNumbers web method to validate the
employee numbers before calling this web method.
If you are sending Input values, you must filter them to avoid sending duplicate data to the server. Only
send an input value when it's changed.
The web method accepts a single parameter request which needs to be a XML document in this format
<AddETSRequest xmlns:xsd = "http://www.w3.org/2001/XMLSchema" xmlns:xsi =
"http://www.w3.org/2001/XMLSchema-instance" >
<UserName></UserName>
<Password></Password>
<ReportingEmployeeMSISDN></ReportingEmployeeMSISDN>
<EntryType></EntryType>
<TimeStampMinuteDiff></TimeStampMinuteDiff>
<Description></Description>
<EntrySource></EntrySource>
<EmployeeNumbers>
<string></string>
<string></string>
</EmployeeNumbers>
<LocationSamplingMethod></LocationSamplingMethod>
<Location>
<East></East>
<North></North>
<Address></Address>
<CoordinateIsInWgs84></CoordinateIsInWgs84>
<Speed></Speed>
<Heading></Heading>
</Location>
<Inputs>
<InputValue>
<InputType></InputType>
<ConvertedMessageType></ConvertedMessageType>
<Value></Value>
<ValueConverted></ValueConverted>
<CalculatedValue></CalculatedValue>
</InputValue>
</Inputs>
</AddETSRequest>
The web method accepts a single parameter request which needs to be a XML document in this format
<ValidateEmployeeNumbersRequest xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<UserName>y</UserName>
<Password>x</Password>
<ReportingEmployeeMSISDN>x</ReportingEmployeeMSISDN>
<EmployeeNumbers>
<string></string>
<string></string>
</EmployeeNumbers>
</ValidateEmployeeNumbersRequest>
Parameter Description
Result The result of the verification process. The code can be one of the following:
OK – Employee numbers validated. See the EmployeeNumberValid parameter for
results
InvalidEmployeeMSISDN - The reporting employee mobile number is invalid
MSISDNIsNotAssociatedWithEmployee - The reporting employee mobile is not
associated with an employee
InvalidUserNameOrPasswordOrIPAddress – The supplied username and
password are not valid
UnknownErrorOccurred – An unknown error occurred
InvalidRequest – The request XML could not be parsed
EmployeeNumberValid An array of Booleans specifying for each provided Employee Number if it exists or
not on the server. The order of the Booleans is the same order of the provided
employee numbers.
14
The web method accepts a single parameter request which needs to be a XML document in this format
<SendSMSToEmployeeRequest xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<UserName></UserName>
<Password></Password>
<EmployeeNumber></EmployeeNumber>
<SMSType> </SMSType>
<Data></Data>
<BillingType></BillingType>
</SendSMSToEmployeeRequest>
The web method accepts a single parameter request which needs to be a XML document in this format
<CreateOrUpdateTaskRequest xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<UserName></UserName>
<Password></Password>
<Operation></Operation>
<TaskNumber></TaskNumber>
<CustomerNumber></CustomerNumber>
<EmployeeNumber></EmployeeNumber>
<DueDateAsSecondsFromEpoch></DueDateAsSecondsFromEpoch>
<Duration></Duration>
<TaskName></TaskName>
<Description></Description>
<Status></Status>
<CoordinationPhone></CoordinationPhone>
<CoordinationPhone2></CoordinationPhone2>
<ContactName></ContactName>
<TaskCategoryCode></TaskCategoryCode>
<CustomerName></CustomerName>
<Location>
<East></East>
<North></North>
<Address></Address>
<CoordinateIsInWgs84></CoordinateIsInWgs84>
</Location>
<Data1></Data1>
…
<Data20></Data20>
<HiddenData1></HiddenData1>
<ExternalCreationDateAsSecondsFromEpoch></ExternalCreationDateAsSecondsFromEpoch >
<Options></Options>
<AdditionalInfoXml></AdditionalInfoXml>
<LimitCatalogCategoriesSelectionToCodes></LimitCatalogCategoriesSelectionToCodes>
<LimitCatalogItemsSelectionToCatalogNumbers></LimitCatalogItemsSelectionToCatalogNumbers>
</CreateOrUpdateTaskRequest>
Parameter Data Type Description
UserName String A valid username for using this web
(Required) method
Password String A valid password for using this web
(Required) method
Operation Enumerator The operation the server is required to
(Required) do. Available options are:
Create – The server is required to create
a task
Update – The server is required to
update a task with the same Task
Number
AutoSelect – The server will check if the
task number provided exists. If the task
number exists then the server will update
the task if the task number does not exist
the server will create a task with the
provided task number.
TaskNumber Int64 The number of the Task
(Required)
CustomerNumber String The number of the customer in the
(Optional) server
EmployeeNumber String The number of the employee that will be
16
The web method accepts a single parameter request which needs to be a XML document in this format
<GetEmployeeListRequest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<UserName>x</UserName>
<Password>y</Password>
<StatusMask>Enabled Disabled Deleted</StatusMask>
</GetEmployeeListRequest>
Parameter Description
Result The result of the verification process. The code can be one of the following:
OK – Employee numbers validated. See the EmployeeNumberValid parameter for
results
InvalidUserNameOrPasswordOrIPAddress – The supplied username and
password are not valid
UnknownErrorOccurred – An unknown error occurred
InvalidRequest – The request XML could not be parsed
The web method accepts a single parameter request which needs to be a XML document in this format
<ImportEmployeesRequest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<UserName>x</UserName>
<Password>y</Password>
<Data></Data>
<DataFormat>Xls</DataFormat>
<FirstRowHasColumnNames>true</FirstRowHasColumnNames>
<ColumnMapping><Mapping MobileNumber="MobileNumberColumn" /></ColumnMapping>
<UnlistedEmployeeHandling><Handling Method="Disable" Group="" /></UnlistedEmployeeHandling>
</ImportEmployeesRequest>
When using Csv, if the file is not in Utf8 use Ansi. In this
case the file should be in the server's default ANSI code
page.
FirstRowHasColumnNames Boolean If set to true, the ColumnMapping tag should hold
(Required) mapping to names appearing on the first row. If set to
false, the ColumnMapping tag should hold mapping to
column numbers (the first column is 0)
ColumnMapping XML String Maps the columns of the file to properties of the
(Required) employee. The mapping is an XML string with a single tag
"Mapping". Each mapping is expressed as an attribute.
MobileNumber - optional
EmployeeNumber - required
FirstName - required
LastName - optional
WorkPhone - optional
HomePhone - optional
Address - optional
Mobile - optional
Remarks - optional
GroupName – optional
UniqueID – optional
Email – optional
MaxDiscount – optional. Note: 2.5% should be expressed
as 2.5
ManagingEmployeeNumber – optional. If set make sure
the manager employee record appears before any records
of employees he manages.
20
UnlistedEmployeeHandling XML String Defines what to do with employees already on the server
(Optional) that have not been listed in the import file.
Parameter Description
Result The result of the import process. The code can be one of the following:
OK – Employees imported successfully.
InvalidUserNameOrPasswordOrIPAddress – The supplied username and
password are not valid
UnknownErrorOccurred – An unknown error occurred
InvalidRequest – The request XML could not be parsed
InvalidDataFile – the data file could not be opened
InvalidColumnMapping – the mapping XML is not valid
SomeRowsSkipped – some of the imported rows were skipped because of missing
required data
21
The web method accepts a single parameter request which needs to be a XML document in this format
<GetMobileDeviceCurrentLocationRequest xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<MSISDN></MSISDN>
<AutoSampleThreshold></AutoSampleThreshold>
<CoordSystem></CoordSystem>
</GetMobileDeviceCurrentLocationRequest>
Parameter Description
Result The result of the call to the web method. The code can be one of the following:
OK – Result is returned
OKMobileDeviceQueuedForSampling – Result is returned but the result
timestamp is greater than the maximal age so the device is queued for location
sampling
MobileDevicePositionIsUnknownQueuedForSampling – The server does not
have a valid location for the mobile device. The mobile device is queued for
sampling
MobileDevicePositionIsUnknown – The server does not have a valid location for
the mobile device
InvalidMSISDN – The requested MSISDN is invalid
InvalidUserNameOrPasswordOrIPAddress – The supplied username and
password are not valid
UnknownErrorOccurred – An unknown error occurred
InvalidRequest – The request XML could not be parsed
TimeStampAge The age in seconds of the TimeStamp (can be used by any web method clients
who do not support parsing the TimeStamp parameter)
The web method accepts a single parameter request which needs to be a XML document in this format
<GetMobileDeviceHistoricLocationRequest xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<MSISDN></MSISDN>
<FromDate></FromDate>
<ToDate></ToDate>
<ClosestToDate></ClosestToDate>
<CoordSystem></CoordSystem>
</GetMobileDeviceHistoricLocationRequest>
The web method accepts a single parameter request which needs to be a XML document in this format
<GetVehicleHistoricInputsRequest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<FromDate></FromDate>
<ToDate></ToDate>
<InputTypes>
<UnitInputTypes>AlarmCounter</UnitInputTypes>
<UnitInputTypes>Odometer</UnitInputTypes>
</InputTypes>
</GetVehicleHistoricInputsRequest>
Parameter Data Type Description
FromDate Int64 (Required) The minimal date expressed as the difference in
seconds from the request time (DateTime.Now in
.NET)
ToDate Int64 (Required) The maximal date expressed as the difference in
seconds from the request time (DateTime.Now in
.NET)
InputTypes Array (Required) An array of the types of inputs required by the remote
system. For the current list of available values
contact technical support.
The web method will return this object (the element Inputs contain an array of the element
VehicleHistoricInput)
<VehicleHistoricInputsResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Result>OK</Result>
<Inputs>
<VehicleHistoricInput>
<EntryType>MS_OdometerValue</EntryType>
<TimeStamp>2009-07-29T11:24:24.177</TimeStamp>
<SensorValue>123456</SensorValue>
<VIN>79-258-61</VIN>
<VehicleGUID>f1ea135a-4320-48d6-9f1c-370ed7423334</VehicleGUID>
<CalculatedValue xsi:nil="true" />
</VehicleHistoricInput>
<VehicleHistoricInput>
<EntryType>MS_OdometerValue</EntryType>
<TimeStamp>2009-03-10T14:55:00</TimeStamp>
<SensorValue>86.5</SensorValue>
<VIN>20-234-82</VIN>
<Address>Main Street</Address>
<VehicleGUID>118d9589-7bf3-4d00-91dc-7cbdb05eaea2</VehicleGUID>
<CalculatedValue xsi:nil="true" />
</VehicleHistoricInput>
</Inputs>
</VehicleHistoicInputsResponse>
25
Parameter Description
Result The result of the call to the web method. The code can be one of the following:
OK – Result is returned
InvalidUserNameOrPasswordOrIPAddress – The supplied username and
password are not valid
UnknownErrorOccurred – An unknown error occurred
InvalidRequest – The request XML could not be parsed
EntryType The entry type for the specified input
TimeStamp Timestamp of the input
SensorValue The value of the input
VIN The Vehicle Identification Number (VIN) of the vehicle associated with this input
entry
VehicleGuid For internal use
CalcualtedValue If the input is a complex input, this value will hold an additional value associated
with the input
26
The web method accepts a single parameter request which needs to be a XML document in this format
<ImportCatalogRequest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<UserName>x</UserName>
<Password>y</Password>
<Data></Data>
<DataFormat>Xls</DataFormat>
<FirstRowHasColumnNames>true</FirstRowHasColumnNames>
<ColumnMapping><Mapping CategoryName="CategoryNameColumn" /></ColumnMapping>
</ImportCatalogRequest>
When using Csv, if the file is not in Utf8 use Ansi. In this
case the file should be in the server's default ANSI code
page.
FirstRowHasColumnNames Boolean If set to true, the ColumnMapping tag should hold
(Required) mapping to names appearing on the first row. If set to
false, the ColumnMapping tag should hold mapping to
column numbers (the first column is 0)
ColumnMapping XML String Maps the columns of the file to properties of the catalog.
(Required) The mapping is an XML string with a single tag "Mapping".
Each mapping is expressed as an attribute.
CategoryName - required
CategoryCode - optional
ItemName - required
ItemCatalogNumber - required
Description - optional
Notes - optional
Price - optional
UnitsInStock - optional
MaxDiscount – optional. Note: 2.5% should be expressed
as 2.5
MustBeBilled – optional. Indicates for items if they must
be billed (Value 1 on the column1) or the employee can
select whether they are billed (any other value).
RequiresSN – optional. Indicates for items if they require a
Parameter Description
Result The result of the import process. The code can be one of the following:
OK – catalog imported successfully.
InvalidUserNameOrPasswordOrIPAddress – The supplied username and
password are not valid
UnknownErrorOccurred – An unknown error occurred
InvalidRequest – The request XML could not be parsed
InvalidDataFile – the data file could not be opened
InvalidColumnMapping – the mapping XML is not valid
SomeRowsSkipped – some of the imported rows were skipped because of missing
required data
28
The web method accepts a single parameter request which needs to be a XML document in this format
<ImportEmployeeCatalogRequest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<UserName>x</UserName>
<Password>y</Password>
<Data></Data>
<DataFormat>Xls</DataFormat>
<FirstRowHasColumnNames>true</FirstRowHasColumnNames>
<ColumnMapping><Mapping EmployeeNumber="EmployeeNumberColumn" /></ColumnMapping>
</ImportEmployeeCatalogRequest>
When using Csv, if the file is not in Utf8 use Ansi. In this
case the file should be in the server's default ANSI code
page.
FirstRowHasColumnNames Boolean If set to true, the ColumnMapping tag should hold
(Required) mapping to names appearing on the first row. If set to
false, the ColumnMapping tag should hold mapping to
column numbers (the first column is 0)
ColumnMapping XML String Maps the columns of the file to properties of the catalog.
(Required) The mapping is an XML string with a single tag "Mapping".
Each mapping is expressed as an attribute.
EmployeeNumber - required
ItemCatalogNumber - required
UnitsInStock – optional. Will be set to 0 if missing
SN – optional. If set, indicates a column that holds the
serial numbers the employee has for the specific catalog
item. The value of the field should be comma delimited
Parameter Description
Result The result of the import process. The code can be one of the following:
OK – employee catalog imported successfully.
InvalidUserNameOrPasswordOrIPAddress – The supplied username and
password are not valid
UnknownErrorOccurred – An unknown error occurred
InvalidRequest – The request XML could not be parsed
InvalidDataFile – the data file could not be opened
29
1. Add a reference to the WSE 3 assembly DLL (if you installed WSE to the default location then the
DLL is located at C:\Program Files\Microsoft WSE\v3.0\Microsoft.Web.Services3.dll)
2. Add a web reference to the web service
3. Change the web service auto generated class inherits line to inherit from the WSE classes.
Inherits Microsoft.Web.Services3.WebServicesClientProtocol
4. Add the following imports to your code
Imports Microsoft.Web.Services3.Security
Imports Microsoft.Web.Services3.Security.Tokens
Imports Microsoft.Web.Services3.Design
Add this code to call the web method
' Create an instance of the Web service proxy
Dim serviceProxy As New WS.MobileLocations
' This is the security token which will be used by the service proxy
Dim assertion As UsernameOverTransportAssertion = New
UsernameOverTransportAssertion()
assertion.UsernameTokenProvider = New UsernameTokenProvider("User",
"Password")
serviceProxy.SetPolicy(New Policy(assertion))
The server supports two methods of sending the notification to the customer: GET and POST. The differences
between the methods are:
GET POST
The customer can specify the The server always sends the same
names of the parameters sent and XML to the client. The XML cannot
which parameters to send be customized.
The notification will not contain The notification will contain files
files and/or catalog items and/or catalog items as part of
the XML
Server Response
Regardless of the method of sending (GET or POST), The customers web page that receives the notification,
must respond with a text that contains the string "_OK_" (without the quotes). If the response of the server
does not contain this string the server will consider the delivery a failure and will queue it up for retry.
GET Tokens
The available tokens are:
Token Description Default Entry Task
Made By Record
Employee Change
{EVT} The reason this notification was sent. See
event types table for possible values
{ET} The employee time sheet entry type. See
entry types table for possible values
{DESC} The description of the entry
{ADDR} The address the employee was at when
creating the entry. The address is available
only if the employee created the entry using
his mobile device
{LOC_X} The X coordinate the employee was at when
creating the entry.
{LOC_Y} The Y coordinate the employee was at when
creating the entry.
{LOC_ACC} The Accuracy of the location. Can be one of
the following:
NotSet
GPS
CellDerived
SameCell
CellAntenna
{LOC_PN} The phone number of the mobile device with
which the location information was obtained.
(can be used to identify the mobile that
reported on other employees)
{EN} The employee number the notification is about
32
<Entry>
<EventType></EventType>
<EntryType></EntryType>
<EntryDateFromEpoch></EntryDateFromEpoch>
<EntryDate></EntryDate>
<Data Type=""></Data>
<EntryTemplate>
<EntryLocation>
<Employee>
<ReportedByEmployee>
<Task>
<Files>
<File>
<File>
</Files>
<CatalogItems>
<Item>
<Item>
</CatalogItems>
<PreviousRelatedEntries>
<Entry>
<Entry>
</PreviousRelatedEntries>
</Entry>
3 Optional XML tags will only be included if they have data. Non-Optional XML tags will only be included
where the tag is relevant (e.g. EntryType will not be included in a tasks notification)
4 On ETS entries the task tag will only be sent if the ETS entry is about a task
34
Or
Event Types
Value Description
1 The notification is sent because a new entry was created
2 The notification is sent because an entry was updated
4 The notification is sent because a new task was created on the server
8 The notification is sent because a task was updated on the server
Entry Types
Value Entry Type For The Remote Updates Web Description
Service
3 MS_LocationResponse Location entry
4 Manager Query
8 Application on the mobile device is off
21 MS_PunchIn Sign In
22 MS_PunchOut Sign Out
23 MS_StartTask Start Task
24 MS_EndTask End Task
25 MS_ConfirmTask Confirm Task
26 MS_CloseTask Close Task
29 MS_TaskNotDone Task Not Done
93 MS_TurnMobileAppOn Turn mobile device application on
94 MS_TurnMobileAppOff Turn mobile device application off
97 Turn mobile device application privacy off
98 Turn mobile device application privacy on
99 MS_EmergencyResponse Emergency
100 MS_Vacation Vacation
101 MS_MilitaryReserveDuty Military Reserve Duty
102 MS_Sickness Sickness
103 MS_Free Free
104 MS_Busy Busy
105 MS_OnCall On Call
106 MS_AmountSold Amount Sold
107 MS_Training Training
Task Statuses
Value Description
1 New Task
2 Notification Sent
4 Acknowledged
8 In Progress
32 Closed
64 Canceled
128 Not Done
39