Screenshots endpoint¶
Fetch all screenshots¶
- screenshots(project_id[, params = None])¶
- Parameters:
project_id (str) – ID of the project
params (dict) – pagination options
- Returns:
Collection of screenshots
Example:
client.screenshots('123.abc', {"page": 2, "limit": 3})
Fetch a screenshot¶
- screenshot(project_id, screenshot_id)¶
- Parameters:
project_id (str) – ID of the project
screenshot_id (int or str) – ID of the screenshot to fetch
- Returns:
Screenshot model
Example:
screenshot = client.screenshot('123.abc', 12345)
screenshot.width # => 480
screenshot.height # => 800
Create screenshots¶
- create_screenshots(project_id, params)¶
- Parameters:
project_id (str) – ID of the project
params (dict or list) – Screenshots parameters
- Returns:
Collection of screenshots
Example:
screenshots = client.create_screenshots('123.abc', [{
"data": 'data:image/jpeg;base64,iVBOR...',
"title": "Python screenshot",
"ocr": False
}])
screenshots.items[0].title # => "Python screenshot"
Update a screenshot¶
- update_screenshot(project_id, screenshot_id[, params = None])¶
- Parameters:
project_id (str) – ID of the project
screenshot_id (int or str) – ID of the screenshot to update
params (dict) – Screenshots parameters
- Returns:
Screenshot model
Example:
screenshot = client.update_screenshot('123.abc', 12345, {
"title": "Updated by Python",
"description": "Python description"
})
screenshot.title # => "Updated by Python"
Delete a screenshot¶
- delete_screenshot(project_id, screenshot_id)¶
- Parameters:
project_id (str) – ID of the project
screenshot_id (int or str) – ID of the screenshot to delete
- Returns:
Dictionary with the project ID and “screenshot_deleted”: True
Example:
client.delete_screenshot('123.abc', 496094)