Skip to content

Latest commit

 

History

History
219 lines (156 loc) · 7 KB

File metadata and controls

219 lines (156 loc) · 7 KB

File Actions

Details on the various actions that can be performed on the File resource, including the expected parameters and the potential responses.

Contents

Delete

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

Authentication

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.

Available Parameters

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

Successful Responses

Code Type Description
200 Success If file was successfully deleted

Error Responses

Code Type Description
400 Error Error if malformed request
404 Error Error if file was not found

Get

Retrieves information on a file

result = client.file.get(
  applicationId: my_application_id,
  fileId: my_file_id)

puts result

Authentication

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.

Available Parameters

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

Successful Responses

Code Type Description
200 File Schema File information

Error Responses

Code Type Description
400 Error Error if malformed request
404 Error Error if file was not found

Move

Move a file or the entire contents of a directory

result = client.file.move(
  applicationId: my_application_id,
  fileId: my_file_id)

puts result

Authentication

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.

Available Parameters

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

Successful Responses

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.

Error Responses

Code Type Description
400 Error Error if malformed request
404 Error Error if file was not found

Patch

Reupload a file

result = client.file.patch(
  applicationId: my_application_id,
  fileId: my_file_id,
  updates: my_updates)

puts result

Authentication

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.

Available Parameters

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

Successful Responses

Code Type Description
201 File Upload Post Response Successfully updated file and the information needed to upload the file content

Error Responses

Code Type Description
400 Error Error if malformed request
404 Error Error if file was not found

Upload

Uploads the file

result = client.file.upload(
  applicationId: my_application_id,
  fileId: my_file_id,
  file: my_file)

puts result

Authentication

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.

Available Parameters

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

Successful Responses

Code Type Description
200 File Schema Updated file content

Error Responses

Code Type Description
400 Error Error if malformed request
404 Error Error if file was not found