Skip to content

Commit c3e8ecc

Browse files
committed
a bit more
1 parent 3fe6fb0 commit c3e8ecc

File tree

5 files changed

+147
-272
lines changed

5 files changed

+147
-272
lines changed

README.md

+6-271
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ The Client API is a straightforward REST API using JSON and HTTPS.
1414
* **Client** - A unique client/app to the account. A single account may have many client apps. Clients that the Blink servers believe are new will generate an out-of-band PIN OTP workflow. The Client ID is returned in a successful login response.
1515
* **Network** - A single account may have many networks. A network corresponds conceptually to a Blink Synch module. An account could have multiple networks/synch modules - e.g. multiple sites/homes. Network ID's and Synch Module information associated with an account is returned in the homescreen call.
1616
* **Camera** - A network/synch module may have one or more cameras. Camera ID information is returned in the homescreen call.
17+
* **Command** - Some operations reach out from the Blink Servers to your local Blink module. These operations are asynchronous and return a Command ID to be polled for completion via the Command Status call.
1718

1819

1920
### Authentication
@@ -33,22 +34,18 @@ The Client API is a straightforward REST API using JSON and HTTPS.
3334

3435
### Network
3536

36-
Commands specific to a network generally reach out from the Blink servers to your Blink module to issue the commad and wait for a response - these calls are asynchronous, and clients must poll to wait for a response via the Command Status call.
37-
3837
* Command Status : `GET /network/{NetworkID}/command/{CommandID}`
3938
* Arm System : `POST /api/v1/accounts/{AccountID}/networks/{NetworkID}/state/arm`
4039
* Disarm System : `POST api/v1/accounts/{AccountID}/networks/{NetworkID}/state/disarm`
41-
* List Network Programs : `GET /api/v1/networks/{NetworkID}/programs`
40+
* [List Schedules](network/listPrograms.md) : `GET /api/v1/networks/{NetworkID}/programs`
4241
* Enable Network Program : `POST /api/v1/networks/{NetworkID}/programs/{ProgramID}/enable`
4342
* Disable Network Program : `POST /api/v1/networks/{NetworkID}/programs/{ProgramID}/disable`
4443

4544
### Cameras
4645

47-
As with Network calls, these calls are sent to your Blink module by Blink's servers and are asynchronous - they must be polled for completion with the Command Status call.
48-
4946
* Enable Motion Detection : `POST /network/{NetworkID}/camera/{CameraID}/enable`
5047
* Disable Motion Detection : `POST /network/{NetworkID}/camera/{CameraID}/disable`
51-
* Get Current Thumbnail : `GET /media/production/account/{AccountID}/network/{NetworkID}/camera/{CameraID}/{JPEG_File_Name}`
48+
* [Get Current Thumbnail](camera/getThumbnail.md) : `GET /media/production/account/{AccountID}/network/{NetworkID}/camera/{CameraID}/{JPEG_File_Name}.jpg`
5249
* Create New Thumbnail : `POST /network/{NetworkID}/camera/{CameraID}/thumbnail`
5350
* Liveview : `POST /api/v5/accounts/{AccountID}/networks/{NetworkID}/cameras/{CameraID}/liveview`
5451
* Get Camera Config : `GET /network/{NetworkID}/camera/{CameraID}/config`
@@ -58,10 +55,9 @@ As with Network calls, these calls are sent to your Blink module by Blink's serv
5855

5956
### Videos
6057

61-
Videos are stored on Blink's servers, therefore they are synchronous and do not have to be polled.
62-
63-
* Get Media events ("changed since" filter) : `GET /api/v1/accounts/{AccountID}/media/changed` (?since=2020-08-03T16:50:24+0000&page=1) (?since=1970-01-01T00:00:00+0000&page=1)
64-
* Get Media video clip : `GET /api/v2/accounts/{AccountID}/media/clip/{mp4_Filename}`
58+
* [Get Video Events](videos/getVideoEvents.md) : `GET /api/v1/accounts/{AccountID}/media/changed?since={timestamp}&page={PageNumber}`
59+
* Get Video : `GET /api/v2/accounts/{AccountID}/media/clip/{mp4_Filename}`
60+
* Get Video Thumbnaail:
6561
* Video Options : `POST /api/v1/account/video_options`
6662
* Get Network events - deprecated?
6763
* Paginated list, etc - deprecated?
@@ -77,264 +73,3 @@ Videos are stored on Blink's servers, therefore they are synchronous and do not
7773
* Synch Modules - deprecated?
7874
* System Health - deprecated?
7975
* Clients - deprecated?
80-
81-
82-
83-
## Networks
84-
85-
Obtain information about the Blink networks defined for the logged in user.
86-
87-
**Request:**
88-
>curl -H "Host: prod.immedia-semi.com" -H "TOKEN_AUTH: *authtoken from login*" --compressed https://rest.prod.immedia-semi.com/networks
89-
90-
**Response:**
91-
JSON response containing information including Network ID and Account ID.
92-
93-
**Notes:**
94-
Network ID is needed to issue arm/disarm calls
95-
96-
97-
## Sync Modules
98-
99-
Obtain information about the Blink Sync Modules on the given network.
100-
101-
**Request:**
102-
>curl -H "Host: prod.immedia-semi.com" -H "TOKEN_AUTH: *authtoken from login*" --compressed https://rest.prod.immedia-semi.com/network/*network_id_from_networks_call*/syncmodules
103-
104-
**Response:**
105-
JSON response containing information about the known state of the Sync module, most notably if it is online
106-
107-
**Notes:**
108-
Probably not strictly needed but checking result can verify that the sync module is online and will respond to requests to arm/disarm, etc.
109-
110-
111-
## Arm
112-
113-
Arm the given network (start recording/reporting motion events)
114-
115-
**Request:**
116-
>curl -H "Host: prod.immedia-semi.com" -H "TOKEN_AUTH: *authtoken from login*" --data-binary --compressed https://rest.prod.immedia-semi.com/network/*network_id_from_networks_call*/arm
117-
118-
**Response:**
119-
JSON response containing information about the arm command request, including the command/request ID
120-
121-
**Notes:**
122-
When this call returns, it does not mean the arm request is complete, the client must gather the request ID from the response and poll for the status of the command.
123-
124-
## Disarm
125-
126-
Disarm the given network (stop recording/reporting motion events)
127-
128-
**Request:**
129-
>curl -H "Host: prod.immedia-semi.com" -H "TOKEN_AUTH: *authtoken from login*" --data-binary --compressed https://rest.prod.immedia-semi.com/network/*network_id_from_networks_call*/disarm
130-
131-
**Response:**
132-
JSON response containing information about the disarm command request, including the command/request ID
133-
134-
**Notes:**
135-
When this call returns, it does not mean the disarm request is complete, the client must gather the request ID from the response and poll for the status of the command.
136-
137-
138-
## Command Status
139-
140-
Get status info on the given command
141-
142-
**Request:**
143-
>curl -H "Host: prod.immedia-semi.com" -H "TOKEN_AUTH: *authtoken from login*" --compressed https://rest.prod.immedia-semi.com/network/*network_id*/command/*command_id*
144-
145-
**Response:**
146-
JSON response containing state information of the given command, most notably whether it has completed and was successful.
147-
148-
**Notes:**
149-
After an arm/disarm command, the client appears to poll this URL every second or so until the response indicates the command is complete.
150-
151-
**Known Commands:**
152-
lv_relay, arm, disarm, thumbnail, clip
153-
154-
## Home Screen
155-
156-
Return information displayed on the home screen of the mobile client - supports multiple sync modules.
157-
158-
**Request:**
159-
>curl -H "Host: prod.immedia-semi.com" -H "TOKEN_AUTH: *authtoken from login*" --compressed https://rest.prod.immedia-semi.com/network/*network_id_from_networks_call*/homescreen
160-
161-
**Response:**
162-
JSON response containing information that the mobile client displays on the home page for the requested sync module, including: status, armed state, links to thumbnails for each camera, etc.
163-
164-
**Notes:**
165-
Not necessary to as part of issuing arm/disarm commands, but contains good summary info.
166-
167-
## Events, thumbnails & video captures
168-
169-
**Request**
170-
Get events for a given network (sync module) -- Need network ID from home
171-
172-
>curl -H "Host: prod.immedia-semi.com" -H "TOKEN_AUTH: *authtoken from login*" --compressed https://rest.prod.immedia-semi.com/events/network/*network__id*
173-
174-
**Response**
175-
A json list of evets incluing URL's. Replace the "mp4" with "jpg" extension to get the thumbnail of each clip
176-
177-
178-
**Request**
179-
Get a video clip from the events list
180-
181-
>curl -H "Host: prod.immedia-semi.com" -H "TOKEN_AUTH: *authtoken from login*" --compressed **video url from events list.mp4** > video.mp4
182-
183-
**Response**
184-
The mp4 video
185-
186-
**Request**
187-
Get a thumbnail from the events list
188-
189-
>curl -H "Host: prod.immedia-semi.com" -H "TOKEN_AUTH: *authtoken from login*" --compressed **video url from events list.jpg** > video_thumb.jpg
190-
191-
**Response**
192-
The jpg bytes.
193-
194-
**Notes**
195-
Note that you replace the 'mp4' with a 'jpg' to get the thumbnail
196-
197-
**Request**
198-
Captures a new thumbnail for a camera
199-
200-
>curl -H "Host: prod.immedia-semi.com" -H "TOKEN_AUTH: *authtoken from login*" --data-binary --compressed https://rest.prod.immedia-semi.com/network/*network_id*/camera/*camera_id*/thumbnail
201-
202-
**Response**
203-
Command information.
204-
205-
**Request**
206-
Captures a new video for a camera
207-
208-
>curl -H "Host: prod.immedia-semi.com" -H "TOKEN_AUTH: *authtoken from login*" --data-binary --compressed https://rest.prod.immedia-semi.com/network/*network_id*/camera/*camera_id*/clip
209-
210-
**Response**
211-
Command information.
212-
213-
## Video Information
214-
215-
**Request**
216-
Get the total number of videos in the system
217-
218-
>curl -H "Host: prod.immedia-semi.com" -H "TOKEN_AUTH: *authtoken from login*" --compressed https://rest.prod.immedia-semi.com/api/v2/videos/count
219-
220-
**Response**
221-
JSON response containing the total video count.
222-
223-
**Request**
224-
Gets a paginated set of video information
225-
226-
>curl -H "Host: prod.immedia-semi.com" -H "TOKEN_AUTH: *authtoken from login*" --compressed https://rest.prod.immedia-semi.com/api/v2/videos/page/0
227-
228-
**Response**
229-
JSON response containing a set of video information, including: camera name, creation time, thumbnail URI, size, length
230-
231-
**Request**
232-
Gets information for a specific video by ID
233-
234-
>curl -H "Host: prod.immedia-semi.com" -H "TOKEN_AUTH: *authtoken from login*" --compressed https://rest.prod.immedia-semi.com/api/v2/video/*video_id*
235-
236-
**Response**
237-
JSON response containing video information
238-
239-
**Request**
240-
Gets a list of unwatched videos
241-
242-
>curl -H "Host: prod.immedia-semi.com" -H "TOKEN_AUTH: *authtoken from login*" --compressed https://rest.prod.immedia-semi.com/api/v2/videos/unwatched
243-
244-
**Response**
245-
JSON response containing unwatched video information
246-
247-
**Request**
248-
Deletes a video
249-
250-
>curl -H "Host: prod.immedia-semi.com" -H "TOKEN_AUTH: *authtoken from login*" --data-binary --compressed https://rest.prod.immedia-semi.com/api/v2/video/*video_id*/delete
251-
252-
**Response**
253-
Unknown - not tested
254-
255-
**Request**
256-
Deletes all videos
257-
258-
>curl -H "Host: prod.immedia-semi.com" -H "TOKEN_AUTH: *authtoken from login*" --data-binary --compressed https://rest.prod.immedia-semi.com/api/v2/videos/deleteall
259-
260-
**Response**
261-
Unknown - not tested
262-
263-
## Cameras
264-
265-
**Request**
266-
Gets a list of cameras
267-
268-
>curl -H "Host: prod.immedia-semi.com" -H "TOKEN_AUTH: *authtoken from login*" --compressed https://rest.prod.immedia-semi.com/network/*network_id*/cameras
269-
270-
**Response**
271-
JSON response containing camera information
272-
273-
**Request**
274-
Gets information for one camera
275-
276-
>curl -H "Host: prod.immedia-semi.com" -H "TOKEN_AUTH: *authtoken from login*" --compressed https://rest.prod.immedia-semi.com/network/*network_id*/camera/*camera_id*
277-
278-
**Response**
279-
JSON response containing camera information
280-
281-
**Request**
282-
Gets camera sensor information
283-
284-
>curl -H "Host: prod.immedia-semi.com" -H "TOKEN_AUTH: *authtoken from login*" --compressed https://rest.prod.immedia-semi.com/network/*network_id*/camera/*camera_id*/signals
285-
286-
**Response**
287-
JSON response containing camera sensor information, such as wifi strength, temperature, and battery level
288-
289-
**Request**
290-
Enables motion detection for one camera
291-
292-
>curl -H "Host: prod.immedia-semi.com" -H "TOKEN_AUTH: $auth_token" --data-binary --compressed https://rest.prod.immedia-semi.com/network/*network_id*/camera/*camera_id*/enable
293-
294-
**Response**
295-
JSON response containing camera information
296-
297-
**Request**
298-
Disables motion detection for one camera
299-
300-
>curl -H "Host: prod.immedia-semi.com" -H "TOKEN_AUTH: $auth_token" --data-binary --compressed https://rest.prod.immedia-semi.com/network/*network_id*/camera/*camera_id*/disable
301-
302-
**Response**
303-
JSON response containing camera information
304-
305-
*Note*: enabling or disabling motion detection is independent of arming or disarming the system. No motion detection or video recording will take place unless the system is armed.
306-
307-
308-
## Miscellaneous
309-
310-
**Request**
311-
Gets information about devices that have connected to the blink service
312-
313-
>curl -H "Host: prod.immedia-semi.com" -H "TOKEN_AUTH: *authtoken from login*" --compressed https://rest.prod.immedia-semi.com/account/clients
314-
315-
**Response**
316-
JSON response containing client information, including: type, name, connection time, user ID
317-
318-
**Request**
319-
Gets information about supported regions
320-
321-
>curl -H "Host: prod.immedia-semi.com" -H "TOKEN_AUTH: *authtoken from login*" --compressed https://rest.prod.immedia-semi.com/regions
322-
323-
**Response**
324-
JSON response containing region information
325-
326-
**Request**
327-
Gets information about system health
328-
329-
>curl -H "Host: prod.immedia-semi.com" -H "TOKEN_AUTH: *authtoken from login*" --compressed https://rest.prod.immedia-semi.com/health
330-
331-
**Response**
332-
"all ports tested are open"
333-
334-
**Request**
335-
Gets information about programs
336-
337-
>curl -H "Host: prod.immedia-semi.com" -H "TOKEN_AUTH: *authtoken from login*" --compressed https://rest.prod.immedia-semi.com/api/v1/networks/*network_id*/programs
338-
339-
**Response**
340-
Unknown.

auth/verifyPin.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
## Verify Pin
2-
Verify Client with PIN provided in an email.
2+
Verify Client with PIN provided in an email. Pass a consistent Client UUID at login to avoid needing to do this more than once.
33

44
`POST /api/v4/account/{AccountID}/client/{ClientID}/pin/verify`
55

camera/getThumbnail.md

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
## Get Thumbnail for Camera
2+
3+
Retrieve the JPEG thumbnail picture of the given camera. The URL path is specified in the thumbnail attribute of the camera, for example from the [HomeScreen](../system/homescreen.md) call. Add the .jpg extension to the URL path.
4+
5+
`GET /media/production/account/{AccountId}/network/{NetworkID}/camera/{CameraId}/theClipFileName.jpg`
6+
7+
### Headers
8+
- **TOKEN-AUTH** - session auth token
9+
10+
11+
### Response
12+
`content-type: image/jpeg`
13+
14+
### Example Request
15+
```sh
16+
curl --request GET \
17+
--url https://rest-prod.immedia-semi.com/media/production/account/1234/network/1234/camera/123456/theClipFileName.jpg \
18+
--header 'token-auth: {Auth_Token}'
19+
```
20+
21+

0 commit comments

Comments
 (0)