MattTW / BlinkMonitorProtocol

Unofficial documentation for the Blink Wire-Free HD Home Monitoring & Alert System
427 stars 79 forks source link

{"message":"An app update is required"} -- Happening again... #41

Closed sutekh137 closed 4 years ago

sutekh137 commented 4 years ago

Just an hour ago or so, my Blink integration (C#/.NET, but using the ideas implemented here) began returning "An app update is required."

I believe the last time this happened they had changed their endpoints. The base url I am using is "/api/v3/login" one. This is not a PIN issue, as authenticating did not even get a client response other than the error.

Any idea on how to get this working again?

ccatanaoan commented 4 years ago

Try api/v4/account/login. They changed some of the end points today.

sutekh137 commented 4 years ago

Hm, good idea... Tried it and am now getting a "Not Found" response.

What is the best way to guess at end-point changes?

MattTW commented 4 years ago

Hi guys - it looks like the v4 API base and login URL is still valid. See the following I just reran traced call which does produce the expected login response from Blink, put your email/pwd in for login and see if you can get it to work:

curl 'https://rest-prod.immedia-semi.com/api/v4/account/login' \ -X POST \ -H 'Host: rest-prod.immedia-semi.com' \ -H 'Content-Type: application/json' \ -H 'Accept: /' \ -H 'LOCALE: en_US' \ -H 'Accept-Language: en-US' \ -d '{"password":"","email":""}'

sutekh137 commented 4 years ago

Hi guys - it looks like the v4 API base and login URL is still valid. See the following I just reran traced call which does produce the expected login response from Blink, put your email/pwd in for login and see if you can get it to work:

curl 'https://rest-prod.immedia-semi.com/api/v4/account/login' -X POST -H 'Host: rest-prod.immedia-semi.com' -H 'Content-Type: application/json' -H 'Accept: /' -H 'LOCALE: en_US' -H 'Accept-Language: en-US' -d '{"password":"","email":""}'

@MattTW, authentication now works. I tried "v4" but not with the "account" in front of "login".

However, I then also changed the videos endpoint to"/api/v4/videos/", but I get a "Not Found" error. What is the endpoint for querying videos in v4? The v2 endpoint no longer worked either.

Thanks for all your help!

MattTW commented 4 years ago

As I watch a trace as I am clicking around the current iPhone app, the URL prefix changes between v1, v2, v3, v4 depending on the specific API call being made - I suppose based on how often they have made breaking changes to the REST call and have created a new version.

Somebody else had contributed the video stuff, I hadn't initially documented that, but when I view a clip in the app for example, the URL is https://rest-prod.immedia-semi.com/api/v2/accounts/<account id>/media/clip/<clip id>.mp4

This repo's doc is long overdue for an update, sorry. Probably for a specific call, try at least the same URL updating the version number by one to see if they introduced a new version, but there might also be breaking changes to the inputs along with it...

In general to trace this stuff, see my response at the end of #34 with a little detail of how I trace the calls with Proxyman. Maybe if I get a few hours this weekend I will overhaul these docs with what I can see and test.

dpmurphy commented 4 years ago

This repo was updated recently and it has the new v4 api urls....Might save some time

https://github.com/nayrk/Blink

I tested and it does seem to work.

yphoenix commented 4 years ago

Looks like the region information in the response has changed for the authentication and now looks like this:

{ 
    account: { ... },
    client: { ... },
    authtoken: { ... }
    region: 
    { 
        tier: 'prod', 
        description: 'United States', 
        code: 'us' 
    },
    ...
}
MattTW commented 4 years ago

I updated the BlinkVideoDownloader.py sample code with the necessary current API call updates to get it running again. (Still python 2.x). Getting the region tier has changed as @yphoenix indicated.

In general, the API doc we have here is getting quite out of date and due for a full re-review and refresh to get it current.