-
Notifications
You must be signed in to change notification settings - Fork 56
Description
I just got the alarm and tried to connect to that API.
I discovered some info about the API, but had problems getting the connection to work
It looks like the alarm is associated with a location_id, available in the latest API version
Sending a POST request to https://app.ring.com/api/v1/rs/connections with accountId: LOCATION_ID and an authorization header using the same oauth token used during the initial login returns an object with a server to connect to along with an auth code.
The alarm communication then occurs over a websocket, seemingly using socket.io. The websocket URL is:
wss://SERVERNAME/socket.io/?authcode=AUTHCODE&ack=false&EIO=3&transport=websocket where SERVERNAME and AUTHCODE come from the connections request
I tried connecting to the socket using the socket.io client, but the connection is closed after the initial frame is received. Following is the code I used to initiate the socket:
io.connect("wss://" + alarmConnection.server + "/socket.io/?authcode=" + alarmConnection.authCode, { transports: ['websocket'], upgrade: false, nsp: '/' } );
Any help would be appreciated
I did some research and it looks like there is a difference when connecting with socket.io that the official ring client doesn't do. Screenshots below:
Official Client:

