Crypto & Security
Encrypt, decrypt, hash, sign, and generate secure tokens
11 endpoints in this category. All require X-API-Key header.
Hash Document
/api/HashDocument
1 token
Compute SHA-256/SHA-1/MD5 hash of any document for integrity verification. Supports HMAC with a salt for keyed hashing. Optionally verify a document against a previously stored hash.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
file |
string | required | Base64-encoded document |
algorithm |
string | optional |
sha256, sha1, or md5
(default: sha256)
|
compareHash |
string | optional | Hash to verify against |
salt |
string | optional | HMAC salt for keyed hashing |
Request Example
{"file": "SGVsbG8gV29ybGQ=", "algorithm": "sha256"}
Response Example
{"success": true, "algorithm": "sha256", "hash": "a591a6d40bf420404a...", "hashBase64": "pZGm1Av0IEBKoW...", "fileSize": 11, "fileSizeKb": 0, "timestamp": "2026-03-06T12:00:00Z"}
Code Examples
curl -X POST "https://docbutterfly.com/api/HashDocument" \
-H "X-API-Key: df_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{"file": "SGVsbG8gV29ybGQ=", "algorithm": "sha256"}'using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "df_your_api_key_here");
var json = @"{""file"": ""SGVsbG8gV29ybGQ="", ""algorithm"": ""sha256""}";
var content = new StringContent(json, System.Text.Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://docbutterfly.com/api/HashDocument", content);
response.EnsureSuccessStatusCode();
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);import requests
import json
url = "https://docbutterfly.com/api/HashDocument"
headers = {
"X-API-Key": "df_your_api_key_here",
"Content-Type": "application/json"
}
payload = json.loads('{"file": "SGVsbG8gV29ybGQ=", "algorithm": "sha256"}')
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/HashDocument
│ │
│ Headers: │
│ X-API-Key: df_your_api_key_here │
│ Content-Type: application/json │
│ │
│ Body: │
│ {
│ "file": "SGVsbG8gV29ybGQ=",
│ "algorithm": "sha256"
│ }
│ │
└─────────────────────────────────────────────┘
Steps:
1. Add an HTTP action to your flow
2. Set Method to "POST"
3. Set URI to "https://docbutterfly.com/api/HashDocument"
4. Add the headers shown above
5. Paste the Body JSON into the Body field
6. Replace placeholder values with dynamic content as neededAnchor Hash
/api/AnchorHash
1 token
Write a document hash to Azure Confidential Ledger for tamper-evident certification. The hash is stored immutably and can be independently verified by any party. Use with HashDocument for a complete certification flow.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
hash |
string | required | Hex-encoded document hash to anchor |
algorithm |
string | optional |
Hash algorithm used (metadata)
(default: sha256)
|
metadata |
object | optional | Optional JSON metadata to store with the hash |
Request Example
{"hash": "a591a6d40bf420404a011733cfb7b190d62c65bf0bcda32b57b277d9ad9f146e", "algorithm": "sha256"}
Response Example
{"success": true, "transactionId": "2.315", "collectionId": "docbutterfly-hashes", "state": "Committed", "timestamp": "2026-03-06T12:00:00Z"}
Code Examples
curl -X POST "https://docbutterfly.com/api/AnchorHash" \
-H "X-API-Key: df_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{"hash": "a591a6d40bf420404a011733cfb7b190d62c65bf0bcda32b57b277d9ad9f146e", "algorithm": "sha256"}'using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "df_your_api_key_here");
var json = @"{""hash"": ""a591a6d40bf420404a011733cfb7b190d62c65bf0bcda32b57b277d9ad9f146e"", ""algorithm"": ""sha256""}";
var content = new StringContent(json, System.Text.Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://docbutterfly.com/api/AnchorHash", content);
response.EnsureSuccessStatusCode();
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);import requests
import json
url = "https://docbutterfly.com/api/AnchorHash"
headers = {
"X-API-Key": "df_your_api_key_here",
"Content-Type": "application/json"
}
payload = json.loads('{"hash": "a591a6d40bf420404a011733cfb7b190d62c65bf0bcda32b57b277d9ad9f146e", "algorithm": "sha256"}')
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/AnchorHash
│ │
│ Headers: │
│ X-API-Key: df_your_api_key_here │
│ Content-Type: application/json │
│ │
│ Body: │
│ {
│ "hash": "a591a6d40bf420404a011733cfb7b190d62c65bf0bcda32b57b277d9ad9f146e",
│ "algorithm": "sha256"
│ }
│ │
└─────────────────────────────────────────────┘
Steps:
1. Add an HTTP action to your flow
2. Set Method to "POST"
3. Set URI to "https://docbutterfly.com/api/AnchorHash"
4. Add the headers shown above
5. Paste the Body JSON into the Body field
6. Replace placeholder values with dynamic content as neededVerify Anchor
/api/VerifyAnchor
1 token
Verify a document hash exists in Azure Confidential Ledger by transaction ID. Optionally compare a provided hash against the stored ledger entry to confirm document integrity.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
transactionId |
string | required | Transaction ID from AnchorHash response |
hash |
string | optional | Hex hash to compare against ledger entry |
Request Example
{"transactionId": "2.315", "hash": "a591a6d40bf420404a011733cfb7b190d62c65bf0bcda32b57b277d9ad9f146e"}
Response Example
{"success": true, "verified": true, "state": "Committed", "ledgerEntry": {"contents": "{\"hash\":\"a591a6d40bf420...\",\"clientId\":\"client1\"}", "collectionId": "docbutterfly-hashes", "transactionId": "2.315"}, "timestamp": "2026-03-06T12:00:00Z"}
Code Examples
curl -X POST "https://docbutterfly.com/api/VerifyAnchor" \
-H "X-API-Key: df_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{"transactionId": "2.315", "hash": "a591a6d40bf420404a011733cfb7b190d62c65bf0bcda32b57b277d9ad9f146e"}'using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "df_your_api_key_here");
var json = @"{""transactionId"": ""2.315"", ""hash"": ""a591a6d40bf420404a011733cfb7b190d62c65bf0bcda32b57b277d9ad9f146e""}";
var content = new StringContent(json, System.Text.Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://docbutterfly.com/api/VerifyAnchor", content);
response.EnsureSuccessStatusCode();
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);import requests
import json
url = "https://docbutterfly.com/api/VerifyAnchor"
headers = {
"X-API-Key": "df_your_api_key_here",
"Content-Type": "application/json"
}
payload = json.loads('{"transactionId": "2.315", "hash": "a591a6d40bf420404a011733cfb7b190d62c65bf0bcda32b57b277d9ad9f146e"}')
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/VerifyAnchor
│ │
│ Headers: │
│ X-API-Key: df_your_api_key_here │
│ Content-Type: application/json │
│ │
│ Body: │
│ {
│ "transactionId": "2.315",
│ "hash": "a591a6d40bf420404a011733cfb7b190d62c65bf0bcda32b57b277d9ad9f146e"
│ }
│ │
└─────────────────────────────────────────────┘
Steps:
1. Add an HTTP action to your flow
2. Set Method to "POST"
3. Set URI to "https://docbutterfly.com/api/VerifyAnchor"
4. Add the headers shown above
5. Paste the Body JSON into the Body field
6. Replace placeholder values with dynamic content as neededAES Encrypt
/api/AesEncrypt
1 token
AES encrypt data with a key.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
data |
string | required | Data to encrypt |
key |
string | required | Encryption key |
algorithm |
string | optional |
aes-256-cbc, aes-128-cbc, aes-256-gcm
(default: aes-256-cbc)
|
Request Example
{"data": "Hello secret world", "key": "my-secret-key-32-chars-long!!!!!"}
Response Example
{"encrypted": "<base64>", "iv": "<base64>", "algorithm": "aes-256-cbc"}
Code Examples
curl -X POST "https://docbutterfly.com/api/AesEncrypt" \
-H "X-API-Key: df_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{"data": "Hello secret world", "key": "my-secret-key-32-chars-long!!!!!"}'using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "df_your_api_key_here");
var json = @"{""data"": ""Hello secret world"", ""key"": ""my-secret-key-32-chars-long!!!!!""}";
var content = new StringContent(json, System.Text.Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://docbutterfly.com/api/AesEncrypt", content);
response.EnsureSuccessStatusCode();
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);import requests
import json
url = "https://docbutterfly.com/api/AesEncrypt"
headers = {
"X-API-Key": "df_your_api_key_here",
"Content-Type": "application/json"
}
payload = json.loads('{"data": "Hello secret world", "key": "my-secret-key-32-chars-long!!!!!"}')
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/AesEncrypt
│ │
│ Headers: │
│ X-API-Key: df_your_api_key_here │
│ Content-Type: application/json │
│ │
│ Body: │
│ {
│ "data": "Hello secret world",
│ "key": "my-secret-key-32-chars-long!!!!!"
│ }
│ │
└─────────────────────────────────────────────┘
Steps:
1. Add an HTTP action to your flow
2. Set Method to "POST"
3. Set URI to "https://docbutterfly.com/api/AesEncrypt"
4. Add the headers shown above
5. Paste the Body JSON into the Body field
6. Replace placeholder values with dynamic content as neededAES Decrypt
/api/AesDecrypt
1 token
AES decrypt data with a key.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
encrypted |
string | required | Encrypted data |
key |
string | required | Decryption key |
iv |
string | required | Initialization vector |
algorithm |
string | optional | Algorithm used |
Request Example
{"encrypted": "<base64>", "key": "my-secret-key-32-chars-long!!!!!", "iv": "<base64>"}
Code Examples
curl -X POST "https://docbutterfly.com/api/AesDecrypt" \
-H "X-API-Key: df_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{"encrypted": "<base64>", "key": "my-secret-key-32-chars-long!!!!!", "iv": "<base64>"}'using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "df_your_api_key_here");
var json = @"{""encrypted"": ""<base64>"", ""key"": ""my-secret-key-32-chars-long!!!!!"", ""iv"": ""<base64>""}";
var content = new StringContent(json, System.Text.Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://docbutterfly.com/api/AesDecrypt", content);
response.EnsureSuccessStatusCode();
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);import requests
import json
url = "https://docbutterfly.com/api/AesDecrypt"
headers = {
"X-API-Key": "df_your_api_key_here",
"Content-Type": "application/json"
}
payload = json.loads('{"encrypted": "<base64>", "key": "my-secret-key-32-chars-long!!!!!", "iv": "<base64>"}')
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/AesDecrypt
│ │
│ Headers: │
│ X-API-Key: df_your_api_key_here │
│ Content-Type: application/json │
│ │
│ Body: │
│ {
│ "encrypted": "\u003Cbase64\u003E",
│ "key": "my-secret-key-32-chars-long!!!!!",
│ "iv": "\u003Cbase64\u003E"
│ }
│ │
└─────────────────────────────────────────────┘
Steps:
1. Add an HTTP action to your flow
2. Set Method to "POST"
3. Set URI to "https://docbutterfly.com/api/AesDecrypt"
4. Add the headers shown above
5. Paste the Body JSON into the Body field
6. Replace placeholder values with dynamic content as neededRSA Encrypt
/api/RsaEncrypt
1 token
RSA encrypt with public key.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
data |
string | required | Data to encrypt |
publicKey |
string | required | PEM-format public key |
Request Example
{"data": "Secret message", "publicKey": "-----BEGIN PUBLIC KEY-----..."}
Code Examples
curl -X POST "https://docbutterfly.com/api/RsaEncrypt" \
-H "X-API-Key: df_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{"data": "Secret message", "publicKey": "-----BEGIN PUBLIC KEY-----..."}'using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "df_your_api_key_here");
var json = @"{""data"": ""Secret message"", ""publicKey"": ""-----BEGIN PUBLIC KEY-----...""}";
var content = new StringContent(json, System.Text.Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://docbutterfly.com/api/RsaEncrypt", content);
response.EnsureSuccessStatusCode();
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);import requests
import json
url = "https://docbutterfly.com/api/RsaEncrypt"
headers = {
"X-API-Key": "df_your_api_key_here",
"Content-Type": "application/json"
}
payload = json.loads('{"data": "Secret message", "publicKey": "-----BEGIN PUBLIC KEY-----..."}')
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/RsaEncrypt
│ │
│ Headers: │
│ X-API-Key: df_your_api_key_here │
│ Content-Type: application/json │
│ │
│ Body: │
│ {
│ "data": "Secret message",
│ "publicKey": "-----BEGIN PUBLIC KEY-----..."
│ }
│ │
└─────────────────────────────────────────────┘
Steps:
1. Add an HTTP action to your flow
2. Set Method to "POST"
3. Set URI to "https://docbutterfly.com/api/RsaEncrypt"
4. Add the headers shown above
5. Paste the Body JSON into the Body field
6. Replace placeholder values with dynamic content as neededRSA Decrypt
/api/RsaDecrypt
1 token
RSA decrypt with private key.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
encrypted |
string | required | Encrypted data |
privateKey |
string | required | PEM-format private key |
Request Example
{"encrypted": "<base64>", "privateKey": "-----BEGIN PRIVATE KEY-----..."}
Code Examples
curl -X POST "https://docbutterfly.com/api/RsaDecrypt" \
-H "X-API-Key: df_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{"encrypted": "<base64>", "privateKey": "-----BEGIN PRIVATE KEY-----..."}'using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "df_your_api_key_here");
var json = @"{""encrypted"": ""<base64>"", ""privateKey"": ""-----BEGIN PRIVATE KEY-----...""}";
var content = new StringContent(json, System.Text.Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://docbutterfly.com/api/RsaDecrypt", content);
response.EnsureSuccessStatusCode();
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);import requests
import json
url = "https://docbutterfly.com/api/RsaDecrypt"
headers = {
"X-API-Key": "df_your_api_key_here",
"Content-Type": "application/json"
}
payload = json.loads('{"encrypted": "<base64>", "privateKey": "-----BEGIN PRIVATE KEY-----..."}')
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/RsaDecrypt
│ │
│ Headers: │
│ X-API-Key: df_your_api_key_here │
│ Content-Type: application/json │
│ │
│ Body: │
│ {
│ "encrypted": "\u003Cbase64\u003E",
│ "privateKey": "-----BEGIN PRIVATE KEY-----..."
│ }
│ │
└─────────────────────────────────────────────┘
Steps:
1. Add an HTTP action to your flow
2. Set Method to "POST"
3. Set URI to "https://docbutterfly.com/api/RsaDecrypt"
4. Add the headers shown above
5. Paste the Body JSON into the Body field
6. Replace placeholder values with dynamic content as neededGenerate RSA Key Pair
/api/GenerateRsaKeyPair
1 token
Generate an RSA public/private key pair.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
modulusLength |
number | optional |
2048 or 4096
(default: 2048)
|
Request Example
{"modulusLength": 2048}
Response Example
{"publicKey": "-----BEGIN PUBLIC KEY-----...", "privateKey": "-----BEGIN PRIVATE KEY-----..."}
Code Examples
curl -X POST "https://docbutterfly.com/api/GenerateRsaKeyPair" \
-H "X-API-Key: df_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{"modulusLength": 2048}'using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "df_your_api_key_here");
var json = @"{""modulusLength"": 2048}";
var content = new StringContent(json, System.Text.Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://docbutterfly.com/api/GenerateRsaKeyPair", content);
response.EnsureSuccessStatusCode();
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);import requests
import json
url = "https://docbutterfly.com/api/GenerateRsaKeyPair"
headers = {
"X-API-Key": "df_your_api_key_here",
"Content-Type": "application/json"
}
payload = json.loads('{"modulusLength": 2048}')
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/GenerateRsaKeyPair
│ │
│ Headers: │
│ X-API-Key: df_your_api_key_here │
│ Content-Type: application/json │
│ │
│ Body: │
│ {
│ "modulusLength": 2048
│ }
│ │
└─────────────────────────────────────────────┘
Steps:
1. Add an HTTP action to your flow
2. Set Method to "POST"
3. Set URI to "https://docbutterfly.com/api/GenerateRsaKeyPair"
4. Add the headers shown above
5. Paste the Body JSON into the Body field
6. Replace placeholder values with dynamic content as neededGenerate Hash
/api/GenerateHash
1 token
Generate a hash digest.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
data |
string | required | Data to hash |
algorithm |
string | optional |
sha256, sha512, md5, sha1
(default: sha256)
|
encoding |
string | optional |
hex or base64
(default: hex)
|
Request Example
{"data": "Hello World", "algorithm": "sha256"}
Response Example
{"hash": "a591a6d40bf420404a...", "algorithm": "sha256"}
Code Examples
curl -X POST "https://docbutterfly.com/api/GenerateHash" \
-H "X-API-Key: df_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{"data": "Hello World", "algorithm": "sha256"}'using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "df_your_api_key_here");
var json = @"{""data"": ""Hello World"", ""algorithm"": ""sha256""}";
var content = new StringContent(json, System.Text.Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://docbutterfly.com/api/GenerateHash", content);
response.EnsureSuccessStatusCode();
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);import requests
import json
url = "https://docbutterfly.com/api/GenerateHash"
headers = {
"X-API-Key": "df_your_api_key_here",
"Content-Type": "application/json"
}
payload = json.loads('{"data": "Hello World", "algorithm": "sha256"}')
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/GenerateHash
│ │
│ Headers: │
│ X-API-Key: df_your_api_key_here │
│ Content-Type: application/json │
│ │
│ Body: │
│ {
│ "data": "Hello World",
│ "algorithm": "sha256"
│ }
│ │
└─────────────────────────────────────────────┘
Steps:
1. Add an HTTP action to your flow
2. Set Method to "POST"
3. Set URI to "https://docbutterfly.com/api/GenerateHash"
4. Add the headers shown above
5. Paste the Body JSON into the Body field
6. Replace placeholder values with dynamic content as neededGenerate HMAC
/api/GenerateHmac
1 token
Generate an HMAC signature.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
data |
string | required | Data to sign |
key |
string | required | Secret key |
algorithm |
string | optional |
sha256, sha512
(default: sha256)
|
Request Example
{"data": "Hello World", "key": "my-secret", "algorithm": "sha256"}
Code Examples
curl -X POST "https://docbutterfly.com/api/GenerateHmac" \
-H "X-API-Key: df_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{"data": "Hello World", "key": "my-secret", "algorithm": "sha256"}'using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "df_your_api_key_here");
var json = @"{""data"": ""Hello World"", ""key"": ""my-secret"", ""algorithm"": ""sha256""}";
var content = new StringContent(json, System.Text.Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://docbutterfly.com/api/GenerateHmac", content);
response.EnsureSuccessStatusCode();
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);import requests
import json
url = "https://docbutterfly.com/api/GenerateHmac"
headers = {
"X-API-Key": "df_your_api_key_here",
"Content-Type": "application/json"
}
payload = json.loads('{"data": "Hello World", "key": "my-secret", "algorithm": "sha256"}')
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/GenerateHmac
│ │
│ Headers: │
│ X-API-Key: df_your_api_key_here │
│ Content-Type: application/json │
│ │
│ Body: │
│ {
│ "data": "Hello World",
│ "key": "my-secret",
│ "algorithm": "sha256"
│ }
│ │
└─────────────────────────────────────────────┘
Steps:
1. Add an HTTP action to your flow
2. Set Method to "POST"
3. Set URI to "https://docbutterfly.com/api/GenerateHmac"
4. Add the headers shown above
5. Paste the Body JSON into the Body field
6. Replace placeholder values with dynamic content as neededGenerate JWT
/api/GenerateJwt
1 token
Generate a signed JWT token.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
payload |
object | required | JWT payload |
secret |
string | required | Signing secret |
options.algorithm |
string | optional |
HS256, RS256
(default: HS256)
|
options.expiresIn |
string | optional | Expiry: 1h, 7d, 30m |
Request Example
{"payload": {"sub": "user123", "name": "John"}, "secret": "your-secret", "options": {"algorithm": "HS256", "expiresIn": "1h"}}
Response Example
{"token": "eyJhbGciOiJIUzI1NiIs..."}
Code Examples
curl -X POST "https://docbutterfly.com/api/GenerateJwt" \
-H "X-API-Key: df_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{"payload": {"sub": "user123", "name": "John"}, "secret": "your-secret", "options": {"algorithm": "HS256", "expiresIn": "1h"}}'using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "df_your_api_key_here");
var json = @"{""payload"": {""sub"": ""user123"", ""name"": ""John""}, ""secret"": ""your-secret"", ""options"": {""algorithm"": ""HS256"", ""expiresIn"": ""1h""}}";
var content = new StringContent(json, System.Text.Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://docbutterfly.com/api/GenerateJwt", content);
response.EnsureSuccessStatusCode();
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);import requests
import json
url = "https://docbutterfly.com/api/GenerateJwt"
headers = {
"X-API-Key": "df_your_api_key_here",
"Content-Type": "application/json"
}
payload = json.loads('{"payload": {"sub": "user123", "name": "John"}, "secret": "your-secret", "options": {"algorithm": "HS256", "expiresIn": "1h"}}')
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/GenerateJwt
│ │
│ Headers: │
│ X-API-Key: df_your_api_key_here │
│ Content-Type: application/json │
│ │
│ Body: │
│ {
│ "payload": {
│ "sub": "user123",
│ "name": "John"
│ },
│ "secret": "your-secret",
│ "options": {
│ "algorithm": "HS256",
│ "expiresIn": "1h"
│ }
│ }
│ │
└─────────────────────────────────────────────┘
Steps:
1. Add an HTTP action to your flow
2. Set Method to "POST"
3. Set URI to "https://docbutterfly.com/api/GenerateJwt"
4. Add the headers shown above
5. Paste the Body JSON into the Body field
6. Replace placeholder values with dynamic content as needed