Operations (sample payloads)

Main operations
Copy

Bzip2
Copy

Compress a file using bzip2.

Sample Input

1
{
2
"file": {
3
"name": "example.txt",
4
"url": "https://example.com/files/example.txt",
5
"mime_type": "text/plain",
6
"expires": 1672531200
7
},
8
"file_name": "compressed_example"
9
}

Sample Output

1
{
2
"file": {
3
"name": "compressed_example.bz2",
4
"url": "https://example.com/files/compressed_example.bz2",
5
"mime_type": "application/x-bzip2",
6
"expires": 1672617600
7
}
8
}

Gzip
Copy

Gzip a file.

Sample Input

1
{
2
"file": {
3
"name": "example.txt",
4
"url": "https://example.com/files/example.txt",
5
"mime_type": "text/plain",
6
"expires": 1672531200
7
}
8
}

Sample Output

1
{
2
"result": {
3
"name": "example.txt.gz",
4
"url": "https://example.com/files/example.txt.gz",
5
"mime_type": "application/gzip",
6
"expires": 1672617600
7
}
8
}

Unbzip2
Copy

Decompress a bzip2 file.

Sample Input

1
{
2
"file": {
3
"name": "compressed_document.bz2",
4
"url": "https://example.com/files/compressed_document.bz2",
5
"mime_type": "application/x-bzip2",
6
"expires": 1623456789
7
},
8
"file_name": "decompressed_document.pdf"
9
}

Sample Output

1
{
2
"file": {
3
"name": "decompressed_document.pdf",
4
"url": "https://example.com/files/decompressed_document.pdf",
5
"mime_type": "application/pdf",
6
"expires": 1623456789
7
}
8
}

Ungzip
Copy

Decompress a gzip file.

Sample Input

1
{
2
"file": {
3
"name": "compressed_document.gz",
4
"url": "https://example.com/files/compressed_document.gz",
5
"mime_type": "application/gzip",
6
"expires": 1623456789
7
},
8
"output_file_name": "decompressed_document.pdf"
9
}

Sample Output

1
{
2
"result": {
3
"name": "decompressed_document.pdf",
4
"url": "https://example.com/files/decompressed_document.pdf",
5
"mime_type": "application/pdf",
6
"expires": 1623457789
7
}
8
}

Unzip
Copy

Unzip a file.

Sample Input

1
{
2
"url": "https://example.com/files/archive.zip"
3
}

Sample Output

1
{
2
"items": [
3
{
4
"name": "document1.pdf",
5
"url": "https://example.com/temp/unzipped/document1.pdf",
6
"mime_type": "application/pdf",
7
"expires": 1623456789
8
},
9
{
10
"name": "image1.jpg",
11
"url": "https://example.com/temp/unzipped/image1.jpg",
12
"mime_type": "image/jpeg",
13
"expires": 1623456789
14
},
15
{
16
"name": "spreadsheet.xlsx",
17
"url": "https://example.com/temp/unzipped/spreadsheet.xlsx",
18
"mime_type": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
19
"expires": 1623456789
20
}
21
]
22
}

Unzip and decrypt
Copy

Unzip a password protected file

Sample Input

1
{
2
"file": {
3
"name": "confidential_report.zip",
4
"url": "https://example.com/files/confidential_report.zip",
5
"mime_type": "application/zip",
6
"expires": 1623456789
7
},
8
"password": "S3cureP@ssw0rd!"
9
}

Sample Output

1
{
2
"items": [
3
{
4
"name": "financial_data.xlsx",
5
"url": "https://example.com/files/financial_data.xlsx",
6
"mime_type": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
7
"expires": 1623457789
8
},
9
{
10
"name": "project_summary.pdf",
11
"url": "https://example.com/files/project_summary.pdf",
12
"mime_type": "application/pdf",
13
"expires": 1623457789
14
},
15
{
16
"name": "meeting_notes.docx",
17
"url": "https://example.com/files/meeting_notes.docx",
18
"mime_type": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
19
"expires": 1623457789
20
}
21
]
22
}

Zip
Copy

Zip up a number of files.

Sample Input

1
{
2
"files": [
3
{
4
"file": {
5
"name": "document1.pdf",
6
"url": "https://example.com/files/document1.pdf",
7
"mime_type": "application/pdf",
8
"expires": 1623456789
9
},
10
"path": "/documents/document1.pdf"
11
},
12
{
13
"file": {
14
"name": "image1.jpg",
15
"url": "https://example.com/files/image1.jpg",
16
"mime_type": "image/jpeg",
17
"expires": 1623456790
18
},
19
"path": "/images/image1.jpg"
20
},
21
{
22
"file": {
23
"name": "spreadsheet1.xlsx",
24
"url": "https://example.com/files/spreadsheet1.xlsx",
25
"mime_type": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
26
"expires": 1623456791
27
},
28
"path": "/spreadsheets/spreadsheet1.xlsx"
29
}
30
],
31
"file_name": "my_project_files",
32
"encase_files_in_directory": true
33
}

Sample Output

1
{
2
"result": {
3
"name": "my_project_files.zip",
4
"url": "https://example.com/zipped/my_project_files.zip",
5
"mime_type": "application/zip",
6
"expires": 1623543189
7
}
8
}

Zip and encrypt
Copy

Zip and password protect a number of files

Sample Input

1
{
2
"files": [
3
{
4
"file": {
5
"name": "document1.pdf",
6
"url": "https://example.com/files/document1.pdf",
7
"mime_type": "application/pdf",
8
"expires": 1623456789
9
},
10
"path": "/documents/"
11
},
12
{
13
"file": {
14
"name": "image1.jpg",
15
"url": "https://example.com/files/image1.jpg",
16
"mime_type": "image/jpeg",
17
"expires": 1623456790
18
},
19
"path": "/images/"
20
}
21
],
22
"file_name": "protected_archive.zip",
23
"password": "securePassword123!",
24
"encryption_type": "AES 256"
25
}

Sample Output

1
{
2
"result": {
3
"name": "protected_archive.zip",
4
"url": "https://example.com/files/protected_archive.zip",
5
"mime_type": "application/zip",
6
"expires": 1623460000
7
}
8
}