Skip to content

Commit 32b4bc8

Browse files
committed
Fix documentation for screenshot API
1 parent 063670c commit 32b4bc8

File tree

1 file changed

+30
-11
lines changed

1 file changed

+30
-11
lines changed

readme.md

Lines changed: 30 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -62,18 +62,30 @@ Worker objects are extended [browser objects](#browser-objects) which contain th
6262
* `status`: A string representing the current status of the worker.
6363
* Possible statuses: `"running"`, `"queue"`.
6464

65-
#### screenshot objects
65+
#### screenshot job objects
6666

67-
A "screenshot object" is a configuration object to run a screenshot job.
67+
Screenshot job objects are plain objects which contain the following properties:
6868

69-
It is a plain object with properties defined on [BrowserStack's Screenshot API reference](https://www.browserstack.com/screenshots/api#generate-screenshots).
69+
* `job_id`: The id of the job.
70+
* `state`: The state of the job.
71+
* `win_res`: The screen resolution for browsers running on Windows. May be one of: `"1024x768"`, `"1280x1024"`.
72+
* `mac_res`: The screen resolution for browsers running on Mac OS X. May be one of: `"1024x768"`, `"1280x960"`, `"1280x1024"`, `"1600x1200"`, `"1920x1080"`.
73+
* `orientation`: The screen orientation for devices. May be one of: `"portrait"`, `"landscape"`.
74+
* `quality`: The quality of the screenshot. May be one of: `"original"`, `"compressed"`.
75+
* `wait_time`: The number of seconds to wait before taking the screenshot. May be one of: `2`, `5`, `10`, `15`, `20`, `60`.
76+
* `local`: Boolean indicating whether a local testing connection should be used.
77+
* `browsers`: A collection of [browser objects](#browser-objects) indicating which browsers and devices to take screenshots with.
7078

79+
### screenshot state objects
7180

72-
#### job objects
81+
Screenshot state objects are extended [browser objects](#browser-objects) which contain the following additional properties:
7382

74-
A "job object" is a screenshot job object, commonly used to keep track of the screenshots requested using a [screenshot object](#screenshot-objects). They may also be displayed in the web interface on the BrowserStack website.
75-
76-
It is a plain object with properties defined on [BrowserStack's Screenshot API reference](https://www.browserstack.com/screenshots/api#screenshots-states).
83+
* `id`: The id of the screenshot object.
84+
* `state`: The state of the screenshot.
85+
* `url`: The URL of the page the screenshot was generated from.
86+
* `thumb_url`: The URL for the screenshot thumbnail.
87+
* `image_url`: The URL for the full-size screenshot.
88+
* `created_at`: The timestamp indicating when the screenshot was generated.
7789

7890
### REST API v4
7991

@@ -203,17 +215,24 @@ Gets the list of available browsers.
203215

204216
Creates a job to take screenshots.
205217

206-
* `options`: A hash of settings for the screenshots. See [screenshot objects](#screenshot-objects) for details.
207-
* `callback` (`function( error, browsers )`): A callback to invoke when the API call is complete.
208-
* `browsers`: An array of [browser objects](#browser-objects).
218+
* `options`: A hash of settings for the screenshots. See [screenshot job objects](#screenshot-job-objects) for details.
219+
* `browsers`: A collection of [browser objects](#browser-objects) indicating which browsers and devices to take screenshots with.
220+
* `win_res` (optional): Only required if taking a screenshot on Windows. Defaults to `"1024x768"`.
221+
* `mac_res` (optional): Only required if taking a screenshot on Mac OS X. Defaults to "1024x768"`.
222+
* `orientation` (optional): Defaults to `"portrait"`.
223+
* `quality` (optional): Defaults to `"compressed"`.
224+
* `wait_time` (optional): Defaults to `5`.
225+
* `local` (optional): Defaults to `false`.
226+
* `callback` (`function( error, job )`): A callback to invoke when the API call is complete.
227+
* `job`: A [screenshot job object](#screenshot-job-objects) containing [screenshot state objects](#screenshot-state-objects) in place of [browser objects](#browser-objects).
209228

210229
#### screenshotClient.getJob( id, callback )
211230

212231
Gets details about the current status of a screenshot job.
213232

214233
* `id`: The id of the job.
215234
* `callback` (`function( error, job )`): A callback to invoke when the API call is complete.
216-
* `job`: A [job object](#job-objects).
235+
* `job`: A [screenshot job object](#screenshot-job-objects) containing [screenshot state objects](#screenshot-state-objects) in place of [browser objects](#browser-objects).
217236

218237
## License
219238

0 commit comments

Comments
 (0)