Snapshots
Snapshots allow you to create a read-only archive of files at a specific point in time. You can define a snapshot, add files to it, and then finalize it. Once finalized, the snapshot’s contents are immutable.
Each snapshot may have an expiration date. When the expiration date is reached, the snapshot is automatically deleted from the Files.com platform.
List Snapshots
SDK Method
snapshot.List()
Return Object
[]*Snapshot
Authorization Requirement
Requires a Site-Wide API key, or a User API key or session from a Site Administrator.
Additional Arguments
Show Snapshot
SDK Method
snapshot.Find()
Return Object
Snapshot
Authorization Requirement
Requires a Site-Wide API key, or a User API key or session from a Site Administrator.
SnapshotFindParams Fields
| Field | Description |
|---|---|
| Id int64 Required | Snapshot ID. |
Create Snapshot
SDK Method
snapshot.Create()
Return Object
Snapshot
Authorization Requirement
Available to all authenticated keys or sessions.
SnapshotCreateParams Fields
| Field | Default | Description |
|---|---|---|
| ExpiresAt string | When the snapshot expires. | |
| Name string | A name for the snapshot. | |
| Paths array(string) | An array of paths to add to the snapshot. | |
| WorkspaceId int64 | 0 | Workspace ID. 0 means the default workspace. |
Finalize Snapshot
SDK Method
snapshot.Finalize()
Return Object
No return value.
Authorization Requirement
Requires a Site-Wide API key, or a User API key or session from a Site Administrator.
SnapshotFinalizeParams Fields
| Field | Description |
|---|---|
| Id int64 Required | Snapshot ID. |
Update Snapshot
SDK Method
snapshot.Update()
Return Object
Snapshot
Authorization Requirement
Requires a Site-Wide API key, or a User API key or session from a Site Administrator.
SnapshotUpdateParams Fields
| Field | Description |
|---|---|
| Id int64 Required | Snapshot ID. |
| ExpiresAt string | When the snapshot expires. |
| Name string | A name for the snapshot. |
| Paths array(string) | An array of paths to add to the snapshot. |
Delete Snapshot
SDK Method
snapshot.Delete()
Return Object
No return value.
Authorization Requirement
Requires a Site-Wide API key, or a User API key or session from a Site Administrator.
SnapshotDeleteParams Fields
| Field | Description |
|---|---|
| Id int64 Required | Snapshot ID. |
The Snapshot Object
Some of the methods above return a Snapshot object. The attributes of this object are listed below.
| Attribute | Description |
|---|---|
| Id int64 | The snapshot's unique ID. |
| ExpiresAt date-time | When the snapshot expires. |
| FinalizedAt date-time | When the snapshot was finalized. |
| Name string | A name for the snapshot. |
| UserId int64 | The user that created this snapshot, if applicable. |
| BundleId int64 | The bundle using this snapshot, if applicable. |
| WorkspaceId int64 | Workspace ID. 0 means the default workspace. |