DeviceInterface


Click here for a complete list of operations.

SendMessages

Used to send punch data into our services. Each punch is a "message". DeviceID and DeviceSecret are credentials that identify your device to our system (like a login and password). MessageNumber should be a monotonically increasing serial number for each message you send us, we'll ignore any message if we've received one with an equal or higher number. SiteNumber identifies the client and can be obtained via the GetDeviceConfig call. Employee identifies the employee. PunchType is a number: 1 for in, 2 for out. Times are formatted as strings to avoid issues with automatic conversions between different local time zones - please send dates and times in YYYY-MM-DD HH:MM:SS format. Variables is how you send us additional information, such as the responses to prompts (we accept I,J,K,X,Y,Z for variable names for the TimeWorks system, and any valid alphanumeric symbol name (underscores allowed, no spaces please, no leading digits please) as variables in the TimeWorksPlus system.

Test

The test form is only available for requests from the local machine.

SOAP 1.1

The following is a sample SOAP 1.1 request and response. The placeholders shown need to be replaced with actual values.

POST /scci/xml/DeviceInterface.asmx HTTP/1.1
Host: www.payrollservers.us
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://mc2cs.com/sc/SendMessages"

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <SendMessages xmlns="http://mc2cs.com/sc">
      <DeviceID>int</DeviceID>
      <DeviceSecret>string</DeviceSecret>
      <Messages>
        <DeviceMessage>
          <Employee>string</Employee>
          <LocalTime>string</LocalTime>
          <MessageNumber>int</MessageNumber>
          <PunchType>int</PunchType>
          <SiteNumber>int</SiteNumber>
          <UTC>string</UTC>
          <Variables>
            <NameValue xsi:nil="true" />
            <NameValue xsi:nil="true" />
          </Variables>
        </DeviceMessage>
        <DeviceMessage>
          <Employee>string</Employee>
          <LocalTime>string</LocalTime>
          <MessageNumber>int</MessageNumber>
          <PunchType>int</PunchType>
          <SiteNumber>int</SiteNumber>
          <UTC>string</UTC>
          <Variables>
            <NameValue xsi:nil="true" />
            <NameValue xsi:nil="true" />
          </Variables>
        </DeviceMessage>
      </Messages>
    </SendMessages>
  </soap:Body>
</soap:Envelope>
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <SendMessagesResponse xmlns="http://mc2cs.com/sc">
      <SendMessagesResult>string</SendMessagesResult>
    </SendMessagesResponse>
  </soap:Body>
</soap:Envelope>

SOAP 1.2

The following is a sample SOAP 1.2 request and response. The placeholders shown need to be replaced with actual values.

POST /scci/xml/DeviceInterface.asmx HTTP/1.1
Host: www.payrollservers.us
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Body>
    <SendMessages xmlns="http://mc2cs.com/sc">
      <DeviceID>int</DeviceID>
      <DeviceSecret>string</DeviceSecret>
      <Messages>
        <DeviceMessage>
          <Employee>string</Employee>
          <LocalTime>string</LocalTime>
          <MessageNumber>int</MessageNumber>
          <PunchType>int</PunchType>
          <SiteNumber>int</SiteNumber>
          <UTC>string</UTC>
          <Variables>
            <NameValue xsi:nil="true" />
            <NameValue xsi:nil="true" />
          </Variables>
        </DeviceMessage>
        <DeviceMessage>
          <Employee>string</Employee>
          <LocalTime>string</LocalTime>
          <MessageNumber>int</MessageNumber>
          <PunchType>int</PunchType>
          <SiteNumber>int</SiteNumber>
          <UTC>string</UTC>
          <Variables>
            <NameValue xsi:nil="true" />
            <NameValue xsi:nil="true" />
          </Variables>
        </DeviceMessage>
      </Messages>
    </SendMessages>
  </soap12:Body>
</soap12:Envelope>
HTTP/1.1 200 OK
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Body>
    <SendMessagesResponse xmlns="http://mc2cs.com/sc">
      <SendMessagesResult>string</SendMessagesResult>
    </SendMessagesResponse>
  </soap12:Body>
</soap12:Envelope>