Search code examples
ibm-cloudpresenceinsights

How can I determine what type of location event I receive from my subscription?


I am using IBM Presence Insights to track locations of my users and send them location based alerts. I know that I can set up a Subscription to POST to an endpoint that I control to receive location based events (enter/exit/dwell.) I also see that I can set a subscription to only respond to certain types of events. However, I want my subscription to send a POST for every type of event, and then filter these events on my backend.

How can I determine if a subscription event is an enter/exit/dwell event?


Solution

  • The body sent in the post to your web hook url will contain a property "activity" in it. This will be one of the following strings:

    • 'enter'
    • 'exit'
    • 'dwell'