Auto Sync

autoSync(p_companyID, p_locationId, p_userId)

 

You can use this endpoint to trigger an EasySecure sync, instantly. Requires EasyConnect or a publicly accessible APIServer2, version 1.12 or higher.

Parameters

Name Type Required Description
p_companyID string Yes The security code you have been provided with, string (32)
p_locationId string Yes The location's id for which you want the sync to be executed for. All the EasySecure syncs are based and require a location id
p_userId string Yes The user's EasySecure id, if you want to sync only one user. If you want a total sync for the location, use 0 here

Return values

ERROR_NO_SECURITY_HASH - p_companyId is not provided

ERROR_UNKNOWN_SECURITY_HASH - there is no company found based on the p_companyId provided

NO LOCATIONID PROVIDED - there is no p_locationId provided

NO LOCATION FOUND BASED ON THE ID PROVIDED - there is no location in the EasySecure based on the p_locationId provided

NO USER FOUND BASED ON THE ID PROVIDED - in case there was a p_userId provided, different than 0, but there is no user in the EasySecure based on this id

CURL_ERROR_NO_X - where X is the PHP curl error received when calling the save() method from the AutoSyncController of EasyConnect/APIServer2

NOT OK, NOT JSON X - where X is the message received back from EasyConnect/APIServer2, which is not JSON formatted as we would expect

Sample

<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:uen="uen:esws">
<soapenv:Header/>
<soapenv:Body>
<uen:Esws.autoSyc soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<p_companyID xsi:type="xsd:string">^4p;tU0Q+#dEIhTWkuj5FnLD^aKWqVu0</p_companyID>
<p_userId xsi:type="xsd:string">5</p_userId>
<p_locationId xsi:type="xsd:string">1</p_locationId>
</uen:Esws.autoSyc>
</soapenv:Body>
</soapenv:Envelope>

Response

<SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" 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:Body>
<ns1:Esws.getautoSycResponse xmlns:ns1="uen:esws">
<return xsi:type="xsd:string">qw17M5WpCCGl6DVTEexI3zXYndMRkxccYRHgon30dcFQ1KlLjkFvRtHv1f5gzv7j</return>
</ns1:Esws.getautoSycResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>