getSyncLog

Retrieves the log of changes made to data objects (Products, Customers, etc) on the system

Description

This method allows for the intelligent synchronization of data between the gateway and the developer's software.

See also getSyncLogCurrentPosition

Syntax

synclog getSyncLog ( ueSecurityToken, ObjectName, FromPosition)

Arguments

Type Name Description
ueSecurityToken Token Merchant security token: used to identify merchant and retrieve the custom fields.
string ObjectName The name of object being synced (leave blank to look at all objects).
integer FromPosition Specifies the log position to start from.

Return Value

Name Description
SyncLog Returns as array of SyncLog objects.

Exceptions

The following exceptions (errors) are applicable to this method.

Code Message Advice
41004 Unknown object The specified ObjectName was not recognized. ObjectName must either be left blank (for all objects) or must correspond to a valid object (ie Product, Customer, etc).

Examples

VB

    Dim ObjectName As String
            ObjectName = "Product"
            Dim FromPosition As String

            Dim log() As newtek.SyncLog
            log = client.getSyncLog(token, ObjectName, FromPosition)
            MsgBox(log.Length)    

.NET C

               string ObjectName = "Product";
                string FromPosition = "0";

                try
                {
                    newtek.SyncLog[] log = client.getSyncLog(token, ObjectName, FromPosition);
                    MessageBox.Show(string.Concat(log.Length));

                }
                catch (Exception err)
                {
                    MessageBox.Show(err.Message);
                }

XML

Request:

    <?xml version="1.0" encoding="UTF-8"?>
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:ns1="urn:newtek" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
    SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
     <SOAP-ENV:Body>
      <ns1:getSyncLog>
       <Token xsi:type="ns1:ueSecurityToken">
    <ClientIP xsi:type="xsd:string">192.168.0.1</ClientIP>
    <PinHash xsi:type="ns1:ueHash">
    <HashValue xsi:type="xsd:string">11ac55b0a0b59f8f028dbf85bc32266fa973dd0e</HashValue>
    <Seed xsi:type="xsd:string">12678150211876663375</Seed>
    <Type xsi:type="xsd:string">sha1</Type>
    </PinHash>
    <SourceKey xsi:type="xsd:string">HB4P7C4K2w2ZCQQQXRqrxDj6agrS2NIT</SourceKey>
    </Token>
       <ObjectName xsi:type="xsd:string">
        Product
       </ObjectName>
       <FromPosition xsi:type="xsd:integer">
        181
       </FromPosition>
      </ns1:getSyncLog>
     </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>

Response:

    <?xml version="1.0" encoding="UTF-8"?>
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
     xmlns:ns1="urn:newtek" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
     <SOAP-ENV:Body>
      <ns1:getSyncLogResponse>
       <getSyncLogReturn SOAP-ENC:arrayType="ns1:SyncLog[1]" xsi:type="ns1:SyncLogArray">
        <item xsi:type="ns1:SyncLog">
         <SyncPosition xsi:type="xsd:integer">
          181
         </SyncPosition>
         <ObjectName xsi:type="xsd:string">
          Product
         </ObjectName>
         <RefNum xsi:type="xsd:string">
          9011780645
         </RefNum>
         <ChangeDate xsi:type="xsd:dateTime">
          2010-03-23T09:01:40
         </ChangeDate>
         <Action xsi:type="xsd:string">
          Update
         </Action>
        </item>
       </getSyncLogReturn>
      </ns1:getSyncLogResponse>
     </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>