API: Visitor Listener - Multiple Visitors in one notification and Multiple Ids for Visitors over multiple days
Due to the way visitors are created in Condeco there is a visitor id / record created for everyday a visitor is visiting. This means any action will send multiple Ids in a single notification. Equally if a meeting is created and multiple visitors are created in that meeting, a notification is sent for multiple visitor ids for multiple visitors.
In most use cases of the visitor listener I would imagine the applications they are posting to are doing some sort of deduplication of this data as they will only need one Id per visitor to retrieve their information. As there is no way from the visitor notification to determine if the ids are for multiple days of one visitor or many visitors of one meeting a workaround need to be put in place. This is to loop through the IDs getting the visitors name by the getVisitorsbyID endpoint and then checking if the current name is the same as the previous name. As names can be nonunique this is not a perfect solution. This solution also massively increases the API calls required
This could be solved in a few ways:
Firstly the listener could only post one notification per visitor. This would keep the idea of multiple ids for one visitor over multiple days however it would create a notification per each visitor created via the create meeting form
If the above is not a potential solution a id could be added for each visitor so that they can be deduplicated based on this e.g:
Multiple Visitors -
[{'VisitorId': 1460985, 'Action': 1, 'VisitorNotifId': 0}, {'VisitorId': 1460986, 'Action': 1, 'VisitorNotifId': 1}, {'VisitorId': 1460987, 'Action': 1, 'VisitorNotifId': 2}]
One Visitor over Multiple Days -
[{'VisitorId': 1460985, 'Action': 1, 'VisitorNotifId': 0}, {'VisitorId': 1460986, 'Action': 1, 'VisitorNotifId': 0}, {'VisitorId': 1460987, 'Action': 1, 'VisitorNotifId': 0}]
-
Ross Wilkinson commented
The third paragraph should read : 'If the above is not a potential solution a id could be added for each visitor notification so that they can be deduplicated based on this e.g:'