Lockitron Community

Events Endpoint

#1

It would be really useful if the Lockitron API supplied an activity endpoint which lists recently performed actions for a specific lock (locked, unlocked, by whom, when, how, etc.)

In fact the Lock and Unlock API calls already return a single activity resource. The new endpoint should just return a list of those resources in reverse-chronological order.

/v1/locks/<lock_id>/activity

[{
    "id": "5bfe94e6-f9ae-4cde-873d-6aa423b31052",
    "lock_name": "Virtual Lockitron",
    "lock_id": "2b973b23-f50e-49d7-9ba5-ab8dd1e8e78b",
    "key_id": "12f92f65-92c5-4073-9ee1-148ca72fcdd3",
    "outcome": false,
    "human_outcome": "notice",
    "type": 4,
    "human_type": "lock-updated-unlocked",
    "performed_at": 1380074337.62581,
    "user": {
      "id": "afb03990-6c95-11e1-95f9-4040401f6100",
      "email": "example@example.com",
      "phone": "+15555555555",
      "human_phone": "(555) 555-5555",
      "first_name": "Example",
      "last_name": "User",
      "full_name": "Example User",
      "best_name": "Example User",
      "activated": true
    }
}, {
...
}, {
...
}]

It would be really useful for notifications, audits, and things like that.

Thanks,
Mike

1 Like

#2

Hi Mike - we’re working on web hooks for activities so that you should be able to get notified immediately when something happens. We will also supply a limited number of activities through the v2 API (which is still pending release).

0 Likes