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.


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

If sync is OK we return a string of 64 characters - like from the sample 5qWFY1oyOn0pCZ4nOrnW0PCAE9ITYc538FuUn4a9NuvA4yK2XwixIs6wnxCrTY1R, which you will be able to use to retrieve sync status using the call getSyncStatus()

If the p_userId is not provided, then every user is taken into account and the sync becomes full


<soapenv:Envelope xmlns:xsi="" xmlns:xsd="" xmlns:soapenv="" xmlns:uen="uen:esws">
<uen:Esws.autoSyc soapenv:encodingStyle="">
<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>


<SOAP-ENV:Envelope SOAP-ENV:encodingStyle="" xmlns:SOAP-ENV="" xmlns:xsd="" xmlns:xsi="" xmlns:SOAP-ENC="">
<ns1:Esws.getautoSycResponse xmlns:ns1="uen:esws">
<return xsi:type="xsd:string">qw17M5WpCCGl6DVTEexI3zXYndMRkxccYRHgon30dcFQ1KlLjkFvRtHv1f5gzv7j</return>