Snapshot
Snapshot Models #
The Snapshot and SnapshotImage models represent images captured via the Canvas iOS application or uploaded directly through the coverages modal. A Snapshot groups related images together, while each SnapshotImage represents an individual image with presigned URL support for secure access.
Snapshots are primarily used for storing coverage card images. Note that there is currently no way to navigate from a Snapshot to the Coverage it is associated with via the SDK. This linkage will be addressed in a future release.
Basic Usage #
from canvas_sdk.v1.data import Snapshot, SnapshotImage
# Get all snapshots
snapshots = Snapshot.objects.all()
# Get a specific snapshot
snapshot = Snapshot.objects.get(dbid=42)
# Get images for a snapshot
images = snapshot.images.all()
# Get all snapshot images
all_images = SnapshotImage.objects.all()
Accessing Image Files #
The image_url property on SnapshotImage returns a presigned S3 URL for securely accessing the image file.
from canvas_sdk.v1.data import SnapshotImage
image = SnapshotImage.objects.exclude(image="").first()
# Returns a presigned S3 URL (valid for 1 hour)
url = image.image_url
Attributes #
Snapshot #
| Field Name | Type |
|---|---|
| dbid | Integer |
| created | DateTime |
| modified | DateTime |
| originator | CanvasUser |
| committer | CanvasUser |
| deleted | Boolean |
| entered_in_error | Boolean |
| title | String |
| description | String |
| images | SnapshotImage[] |
SnapshotImage #
| Field Name | Type |
|---|---|
| dbid | Integer |
| created | DateTime |
| modified | DateTime |
| snapshot | Snapshot |
| image | String |
| title | String |
| instruction | String |
| tag | String |
| image_url | String (property) — presigned S3 URL |