SwitchBotAPI icon indicating copy to clipboard operation
SwitchBotAPI copied to clipboard

Lock Pro: Add request ID field to commands

Open dds82 opened this issue 1 year ago • 0 comments

Current Situation

The Lock Pro requires a web hook to receive success or failure notifications when I use the API to create or delete keys. However, there is currently no way to link a request to a response, so if I have multiple requests outstanding, when I get a webhook callback, I have no way to know which request the response was for.

Or, as is often the case and I don't get a webhook callback at all, I would like to be able to set up a timeout (in my code) for my requests. But without a request ID, I can't tell which request is the one that timed out.

Proposed Change

The createKey and deleteKey commands should accept an additional field: "requestID". This should be a string with a maximum length of 36 characters (to accommodate a standard UUID). This field may be optional in order to preserve backwards compatibility with existing integrations.

If the request specified a requestID, the response that gets sent to the webhook for that request should include the same requestID in an additional field.

Additional Context

N/A

dds82 avatar Jun 03 '24 16:06 dds82