EvTrack supports integration with external APIs via the Automation Module.
Step 1:
Add New Automation Entity
Step 2:
Browse to the new entity, click on the Actions tab and click on the “Add” button:
Step 3:
Configure the REST API Call parameters.
Please make sure that the correct Media Type is configured to match the Body Payload
Example JSON Payload with Template Placeholders
<#setting time_zone='GMT'>
{
"licensePlate": "${credential.uniqueIdentifier}",
"cameraId": "${accessControlPoint.id}",
"timestamp": "${createdTime?number_to_datetime?string["dd.MM.yyyy HH:mm"]}",
"location": "Main Rd Exit"
}
Internally EvTrack utilises Apache Freemarker Templating engine to process the URL and BODY parameters. Please see Annex A: Available Variables
${createdTime} is defined as Unix timestamp and can be transformed with Freemarker Date functions by casting (${createdTime?number_to_datetime) it to a Date object.
https://freemarker.apache.org/docs/ref_builtins_date.html
Once casted any of the Date functions can be used, ie:
${createdTime?number_to_datetime?string["dd.MM.yyyy HH:mm"]}
Step 4:
Browse to the new entity, click on the Events tab and click on the “Add” button.
Step 5:
Select the Event Type, Source Entity and Action:
Step 6:
Confirmed or Troubleshoot the integration via the System Settings > System Logs
Automation Event | AE | Access_Control_Point_Read | Access_Control_Point_Access_Granted | Access_Control_Point_Access_Denied |
---|---|---|---|---|
long | createdTime | X | X | X |
String | eventClassName | X | X | X |
Integer | tenantId | X | X | X |
String | credential.uniqueIdentifier | X | X | X |
Date | credential.activeDate | X | X | X |
Date | credential.expiryDate | X | X | X |
Integer | credential.pin | X | X | X |
Integer | credential.useLimit | X | X | X |
Integer | accessControlPoint.id | X | X | X |
String | accessControlPoint.name | X | X | X |
{
"contact": [
{
"fullname": "${(visitEvent.visitor.firstName)!""} ${(visitEvent.visitor.lastName)!""}",
"contact number": "${(visitEvent.visitor.mobileNumber)!""}",
"email": "${(visitEvent.visitor.email)!""}",
<#if visitEvent.reason??>
"purposeofentry": "${(visitEvent.reason.reason)!""}",
</#if>
<#list visitEvent.agreementContracts as agreementContract>
<#if agreementContract.agreementHeading?lower_case?contains("contact")>
"covidcontact": "${agreementContract.responseValue}",
</#if>
<#if agreementContract.agreementHeading?lower_case?contains("symptoms")>
"symptoms": "${agreementContract.responseValue}",
</#if>
</#list>
<#list visitEvent.customFields as customField>
<#if customField.label?lower_case?contains("visiting")>
"visitingparty": "${customField.value}",
</#if>
</#list>
"temperature": "${(visitEvent.temperature)!"0.00"}"
}
]
}