Lockitron Community

API 500 Server Error

#1

Testing out the API for locking / unlocking a virtual lock, using the access_token method (non oAuth), and instead of getting a JSON array back, I get a 500 server error if I issue a lock or unlock command for a lock that is already in the same state I am trying to set.

That is, if the lock is locked, and I unlock (or vice versa), all is fine, but if it is locked, and I try and lock again (I don’t necessarily know the current state, nor think it should be necessary to check), or vice versa, the server returns a 500 error.

0 Likes

#2

I will look at this. Thanks for the heads up!

0 Likes

#3

Ah, yes, this was a bug. Commands that were not resulting in a state change were reporting 500’s. Should be fixed now.

0 Likes

#4

Awesome. Thanks. Working now as expected.

1 Like

#5

The Lock and unlock API calls are returning 500 for me again. Can you take a look?

0 Likes

#6

It worked for a short time but now it appears to return the lockitron homepage instead of any json data.

0 Likes

#7

Yep, 500 here as well. But now, it’s a 500 in all cases, can’t issue any command successfully.

0 Likes

#8

Hey Guys,
Sorry about this, we’re on it. It looks like a non-simple fix that occurred with same changes to our V2 API - updates to come.

0 Likes

#9

Any updates on this? It is still broken.

0 Likes

#10

So this has been around for months, I’ve never seen it behave otherwise. It’s actually semi-useful since there isn’t a great way to get the current state of a specific lock, you can use this to see what state it was in.

0 Likes

#11

@kurtisnelson This is no longer just the bug where it returns 500 when you try to lock an already locked lock. Now, it returns 500 on both unlock or lock no matter what the current state of the lock is. This is not useful for checking the state of a lock. Plus, why can’t you just use https://api.lockitron.com/v1/locks to get the state of a lock?

0 Likes

#12

FWIW, though a 500 error is returned in all cases, in testing, the lock (virtual) is still locking / unlocking correctly (per the app).

0 Likes

#13

@john - yeah I noticed that too. I would just prefer not to ship an app with the error handling disabled :wink:

0 Likes

#14

Heads up, just jumped into my code this morning to check on the status, and all appears to be in working order for me as of now, 100%.

0 Likes