Details on the various actions that can be performed on the
File resource, including the expected
parameters and the potential responses.
Deletes a file or directory, if directory all the contents that directory will also be removed.
result = client.file.delete(
applicationId: my_application_id,
fileId: my_file_id)
puts result
The client must be configured with a valid api access token to call this
action. The token must include at least one of the following scopes:
all.Application, all.Application.cli, all.Organization, all.User, all.User.cli, file.*, or file.delete.
| Name |
Type |
Required |
Description |
Default |
Example |
| applicationId |
string |
Y |
ID associated with the application |
|
575ec8687ae143cd83dc4a97 |
| fileId |
string |
Y |
ID associated with the file |
|
575ec76c7ae143cd83dc4a96 |
| losantdomain |
string |
N |
Domain scope of request (rarely needed) |
|
example.com |
| Code |
Type |
Description |
| 200 |
Success |
If file was successfully deleted |
| Code |
Type |
Description |
| 400 |
Error |
Error if malformed request |
| 404 |
Error |
Error if file was not found |
Retrieves information on a file
result = client.file.get(
applicationId: my_application_id,
fileId: my_file_id)
puts result
The client must be configured with a valid api access token to call this
action. The token must include at least one of the following scopes:
all.Application, all.Application.cli, all.Application.read, all.Organization, all.Organization.read, all.User, all.User.cli, all.User.read, file.*, or file.get.
| Name |
Type |
Required |
Description |
Default |
Example |
| applicationId |
string |
Y |
ID associated with the application |
|
575ec8687ae143cd83dc4a97 |
| fileId |
string |
Y |
ID associated with the file |
|
575ec76c7ae143cd83dc4a96 |
| losantdomain |
string |
N |
Domain scope of request (rarely needed) |
|
example.com |
| Code |
Type |
Description |
| 400 |
Error |
Error if malformed request |
| 404 |
Error |
Error if file was not found |
Move a file or the entire contents of a directory
result = client.file.move(
applicationId: my_application_id,
fileId: my_file_id)
puts result
The client must be configured with a valid api access token to call this
action. The token must include at least one of the following scopes:
all.Application, all.Application.cli, all.Organization, all.User, all.User.cli, file.*, or file.move.
| Name |
Type |
Required |
Description |
Default |
Example |
| applicationId |
string |
Y |
ID associated with the application |
|
575ec8687ae143cd83dc4a97 |
| fileId |
string |
Y |
ID associated with the file |
|
575ec76c7ae143cd83dc4a96 |
| name |
undefined |
N |
The new name of the file or directory |
|
fileA |
| parentDirectory |
undefined |
N |
The new parent directory for the file or directory to move into. |
|
/new/location/here |
| losantdomain |
string |
N |
Domain scope of request (rarely needed) |
|
example.com |
| Code |
Type |
Description |
| 201 |
File Schema |
Returns a new file or directory that was created by the move, if a directory a job will kick off to move all the directories children. |
| Code |
Type |
Description |
| 400 |
Error |
Error if malformed request |
| 404 |
Error |
Error if file was not found |
Reupload a file
result = client.file.patch(
applicationId: my_application_id,
fileId: my_file_id,
updates: my_updates)
puts result
The client must be configured with a valid api access token to call this
action. The token must include at least one of the following scopes:
all.Application, all.Application.cli, all.Organization, all.User, all.User.cli, file.*, or file.patch.
| Name |
Type |
Required |
Description |
Default |
Example |
| applicationId |
string |
Y |
ID associated with the application |
|
575ec8687ae143cd83dc4a97 |
| fileId |
string |
Y |
ID associated with the file |
|
575ec76c7ae143cd83dc4a96 |
| updates |
File Patch |
Y |
Updated information about the file |
|
File Patch Example |
| losantdomain |
string |
N |
Domain scope of request (rarely needed) |
|
example.com |
| Code |
Type |
Description |
| 201 |
File Upload Post Response |
Successfully updated file and the information needed to upload the file content |
| Code |
Type |
Description |
| 400 |
Error |
Error if malformed request |
| 404 |
Error |
Error if file was not found |
Uploads the file
result = client.file.upload(
applicationId: my_application_id,
fileId: my_file_id,
file: my_file)
puts result
The client must be configured with a valid api access token to call this
action. The token must include at least one of the following scopes:
all.Application, all.Application.cli, all.Organization, all.User, all.User.cli, file.*, or file.upload.
| Name |
Type |
Required |
Description |
Default |
Example |
| applicationId |
string |
Y |
ID associated with the application |
|
575ec8687ae143cd83dc4a97 |
| fileId |
string |
Y |
ID associated with the file |
|
575ec76c7ae143cd83dc4a96 |
| file |
file |
Y |
The content of the file to upload |
|
undefined |
| losantdomain |
string |
N |
Domain scope of request (rarely needed) |
|
example.com |
| Code |
Type |
Description |
| 200 |
File Schema |
Updated file content |
| Code |
Type |
Description |
| 400 |
Error |
Error if malformed request |
| 404 |
Error |
Error if file was not found |