Archive
Create and extract ZIP archives
3 endpoints in this category. All require X-API-Key header.
Create ZIP
POST
/api/CreateZip
1 token
Create a ZIP archive from multiple files.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
files |
array | required | Array of {name, content (base64)} |
compressionLevel |
number | optional |
0-9
(default: 6)
|
Request Example
JSON
{"files": [{"name": "file1.txt", "content": "SGVsbG8="}, {"name": "file2.txt", "content": "V29ybGQ="}]}
Response Example
JSON
{"zip": "UEsDBBQAAAA...", "fileCount": 2}
Code Examples
curl -X POST "https://docbutterfly.com/api/CreateZip" \
-H "X-API-Key: df_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{"files": [{"name": "file1.txt", "content": "SGVsbG8="}, {"name": "file2.txt", "content": "V29ybGQ="}]}'using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "df_your_api_key_here");
var json = @"{""files"": [{""name"": ""file1.txt"", ""content"": ""SGVsbG8=""}, {""name"": ""file2.txt"", ""content"": ""V29ybGQ=""}]}";
var content = new StringContent(json, System.Text.Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://docbutterfly.com/api/CreateZip", content);
response.EnsureSuccessStatusCode();
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);import requests
import json
url = "https://docbutterfly.com/api/CreateZip"
headers = {
"X-API-Key": "df_your_api_key_here",
"Content-Type": "application/json"
}
payload = json.loads('{"files": [{"name": "file1.txt", "content": "SGVsbG8="}, {"name": "file2.txt", "content": "V29ybGQ="}]}')
response = requests.post(url, headers=headers, json=payload)
response.raise_for_status()
data = response.json()
print(json.dumps(data, indent=2))┌─────────────────────────────────────────────┐
│ Power Automate - HTTP Action │
├─────────────────────────────────────────────┤
│ │
│ Method: POST │
│ URI: https://docbutterfly.com/api/CreateZip
│ │
│ Headers: │
│ X-API-Key: df_your_api_key_here │
│ Content-Type: application/json │
│ │
│ Body: │
│ {
│ "files": [
│ {
│ "name": "file1.txt",
│ "content": "SGVsbG8="
│ },
│ {
│ "name": "file2.txt",
│ "content": "V29ybGQ="
│ }
│ ]
│ }
│ │
└─────────────────────────────────────────────┘
Steps:
1. Add an HTTP action to your flow
2. Set Method to "POST"
3. Set URI to "https://docbutterfly.com/api/CreateZip"
4. Add the headers shown above
5. Paste the Body JSON into the Body field
6. Replace placeholder values with dynamic content as neededExtract ZIP
POST
/api/ExtractZip
1 token
Extract all files from a ZIP archive.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
zip |
string | required | Base64-encoded ZIP |
Request Example
JSON
{"zip": "<base64-zip>"}
Response Example
JSON
{"files": [{"name": "file1.txt", "content": "SGVsbG8=", "size": 5}], "fileCount": 1}
Code Examples
curl -X POST "https://docbutterfly.com/api/ExtractZip" \
-H "X-API-Key: df_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{"zip": "<base64-zip>"}'using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "df_your_api_key_here");
var json = @"{""zip"": ""<base64-zip>""}";
var content = new StringContent(json, System.Text.Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://docbutterfly.com/api/ExtractZip", content);
response.EnsureSuccessStatusCode();
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);import requests
import json
url = "https://docbutterfly.com/api/ExtractZip"
headers = {
"X-API-Key": "df_your_api_key_here",
"Content-Type": "application/json"
}
payload = json.loads('{"zip": "<base64-zip>"}')
response = requests.post(url, headers=headers, json=payload)
response.raise_for_status()
data = response.json()
print(json.dumps(data, indent=2))┌─────────────────────────────────────────────┐
│ Power Automate - HTTP Action │
├─────────────────────────────────────────────┤
│ │
│ Method: POST │
│ URI: https://docbutterfly.com/api/ExtractZip
│ │
│ Headers: │
│ X-API-Key: df_your_api_key_here │
│ Content-Type: application/json │
│ │
│ Body: │
│ {
│ "zip": "\u003Cbase64-zip\u003E"
│ }
│ │
└─────────────────────────────────────────────┘
Steps:
1. Add an HTTP action to your flow
2. Set Method to "POST"
3. Set URI to "https://docbutterfly.com/api/ExtractZip"
4. Add the headers shown above
5. Paste the Body JSON into the Body field
6. Replace placeholder values with dynamic content as neededExtract ZIP (Advanced)
POST
/api/ExtractZipV2
1 token
Extract ZIP with filtering and path options.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
zip |
string | required | Base64-encoded ZIP |
filter |
string | optional | Glob pattern to filter |
flatten |
boolean | optional |
Flatten directories
(default: false)
|
Request Example
JSON
{"zip": "<base64-zip>", "filter": "*.pdf", "flatten": true}
Code Examples
curl -X POST "https://docbutterfly.com/api/ExtractZipV2" \
-H "X-API-Key: df_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{"zip": "<base64-zip>", "filter": "*.pdf", "flatten": true}'using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "df_your_api_key_here");
var json = @"{""zip"": ""<base64-zip>"", ""filter"": ""*.pdf"", ""flatten"": true}";
var content = new StringContent(json, System.Text.Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://docbutterfly.com/api/ExtractZipV2", content);
response.EnsureSuccessStatusCode();
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);import requests
import json
url = "https://docbutterfly.com/api/ExtractZipV2"
headers = {
"X-API-Key": "df_your_api_key_here",
"Content-Type": "application/json"
}
payload = json.loads('{"zip": "<base64-zip>", "filter": "*.pdf", "flatten": true}')
response = requests.post(url, headers=headers, json=payload)
response.raise_for_status()
data = response.json()
print(json.dumps(data, indent=2))┌─────────────────────────────────────────────┐
│ Power Automate - HTTP Action │
├─────────────────────────────────────────────┤
│ │
│ Method: POST │
│ URI: https://docbutterfly.com/api/ExtractZipV2
│ │
│ Headers: │
│ X-API-Key: df_your_api_key_here │
│ Content-Type: application/json │
│ │
│ Body: │
│ {
│ "zip": "\u003Cbase64-zip\u003E",
│ "filter": "*.pdf",
│ "flatten": true
│ }
│ │
└─────────────────────────────────────────────┘
Steps:
1. Add an HTTP action to your flow
2. Set Method to "POST"
3. Set URI to "https://docbutterfly.com/api/ExtractZipV2"
4. Add the headers shown above
5. Paste the Body JSON into the Body field
6. Replace placeholder values with dynamic content as needed