Password Pusher 应用程序接口 v2
测试版用于集成的全面 REST API 文档 Password Pusher 到您的应用程序中
测试版通知: API v2 目前处于测试阶段。虽然我们已尽一切努力确保稳定性,但在最终发布前可能会有突破性的改动。欢迎您提出反馈意见!
推动
推送功能可将敏感数据安全、单向地传输给收件人。使用包含文本、文件、二维码或 URL 的秘密 URL 创建推送,然后与任何人共享,所有这些都不会在电子邮件、聊天或日志中暴露敏感数据。
非常适合员工入职、发送账户凭证、传输机密文件或共享任何敏感信息。推送会在指定的持续时间或浏览次数后自动过期,每次推送的审计日志中都会提供完整的生命周期跟踪。
POST /api/v2/pushes
使用提供的有效载荷创建新的推送。
请求正文(JSON)
{
"push": {
"payload": "secret_password_123",
"expire_after_duration": 6,
"expire_after_views": 5,
"passphrase": "optional_passphrase",
"name": "Database Credentials",
"note": "Internal note",
"deletable_by_viewer": true,
"retrieval_step": true,
"kind": "text"
},
"account_id": 123
}
带文件的请求正文(multipart/form-data)
curl -X POST https://us.pwpush.com/api/v2/pushes \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-F "push[payload]=secret_password_123" \
-F "push[expire_after_duration]=6" \
-F "push[expire_after_views]=5" \
-F "push[name]=Database Credentials" \
-F "push[files][]=@/path/to/file1.pdf" \
-F "push[files][]=@/path/to/file2.txt"
请注意: 附加文件时,使用 multipart/form-data 格式并设置 kind: "file". 使用 push[files][].
参数
| 参数 | 类型 | 描述 |
|---|---|---|
payload
必需的
|
string | 分享的秘密文本 |
expire_after_duration
可选的
|
integer (0-17) | 持续时间枚举(0-17) |
expire_after_views
可选的
|
integer (1-100) | 过期前的浏览次数 |
passphrase
可选的
|
string | 需要密码才能查看 |
name
可选的
|
string | 推动的名称 |
note
可选的
|
string | 内部说明(仅创作者可见) |
deletable_by_viewer
可选的
|
boolean | 允许观众删除推送 |
retrieval_step
可选的
|
boolean | 需要额外的检索步骤 |
kind
可选的
|
string | 类型:"文本"、"文件"、"url "或 "qr"(默认为 "文本) |
notify_emails_to
可选的
|
string | 创建推送时要通知的电子邮件地址(以逗号分隔) |
notify_emails_to_locale
可选的
|
string | 发送电子邮件通知的语言(语言 |
authenticated_recipients
可选的
|
boolean | 查看前需通过电子邮件一次性密码(OTP)验证。需启用 notify_emails_to 功能。启用后,仅支持通过浏览器检索(API 检索将返回 403 错误)。 |
account_id
可选的
|
integer | 与推送关联的账户 ID(适用于拥有多个账户的用户) |
持续时间值为 expire_after_duration
响应字段
创建推送时,将在响应中返回以下字段。注意:创建时不会返回有效载荷和文件,只有通过 GET 获取推送时才会返回。
| 现场 | 类型 | 示例 | 描述 |
|---|---|---|---|
| account_id | integer or null | 1 | 所有者账户 ID |
| created_at | string | "2025-02-17T10:00:00.000Z" | ISO 8601 创建时间 |
| days_remaining | integer | 1 | 弃用 剩余天数(当 < 1 天时为 0);首选 expires_at / expires_in |
| deletable_by_viewer | boolean | true | 收件人是否可以删除推送内容 |
| deleted | boolean | false | 是否明确删除了推送 |
| expire_after_days | integer | 1 | 弃用 大约天数(根据持续时间推算) |
| expire_after_duration | integer | 6 | 持续时间枚举(0-17);见上表 |
| expire_after_views | integer | 5 | 到期前的最大浏览量 |
| expired | boolean | false | 推送是否已过期 |
| expired_on | string or null | null | 推送过期时为 ISO 8601;未过期时为空 |
| expires_at | string or null | "2025-02-18T10:00:00.000Z" | 推送过期的 ISO 8601 时间;过期为空 |
| expires_in | number | 86400 | 失效前的秒数(失效时为 0) |
| html_url | string | "https://.../p/abc" | 在浏览器中打开推送的 URL |
| json_url | string | "https://.../p/abc.json" | 以 JSON 格式检索推送的 URL |
| name | string or null | "Database credentials" | 推送的可选名称 |
| note | string or null | null | 可选的私人说明 |
| notify_emails_to | string or null | null | 创建时通知的电子邮件(仅限高级版) |
| passphrase | string or null | null | 仅在推送有口令时出现(值隐藏) |
| retrieval_step | boolean | false | 是否需要额外的步骤来检索 |
| updated_at | string | "2025-02-17T10:00:00.000Z" | ISO 8601 最后更新时间 |
| url_token | string | "fkwjfvhall92" | 推送的唯一秘密标识符 |
| views_remaining | integer | 5 | 到期前的剩余浏览次数 |
回复示例:
{
"expire_after_duration": 6,
"expire_after_views": 5,
"expired": false,
"url_token": "fkwjfvhall92",
"deletable_by_viewer": true,
"retrieval_step": false,
"expired_on": null,
"passphrase": null,
"created_at": "2025-02-17T10:00:00.000Z",
"updated_at": "2025-02-17T10:00:00.000Z",
"expire_after_days": 1,
"views_remaining": 5,
"deleted": false,
"days_remaining": 1,
"expires_at": "2025-02-18T10:00:00.000Z",
"expires_in": 86400,
"json_url": "https://example.com/p/fkwjfvhall92.json",
"html_url": "https://example.com/p/fkwjfvhall92",
"account_id": 1,
"note": null,
"name": "Database Credentials"
}
申请示例
curl -X POST https://us.pwpush.com/api/v2/pushes \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"push": {
"payload": "MySecretPassword123",
"expire_after_duration": 6,
"expire_after_views": 3
}
}'
require 'net/http'
require 'json'
require 'uri'
uri = URI('https://us.pwpush.com/api/v2/pushes')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri.path)
request['Authorization'] = 'Bearer YOUR_API_TOKEN'
request['Content-Type'] = 'application/json'
request.body = {
push: {
payload: 'MySecretPassword123',
expire_after_duration: 6,
expire_after_views: 3
}
}.to_json
response = http.request(request)
puts response.body
import requests
import json
url = 'https://us.pwpush.com/api/v2/pushes'
headers = {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Content-Type': 'application/json'
}
data = {
'push': {
'payload': 'MySecretPassword123',
'expire_after_duration': 6,
'expire_after_views': 3
}
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
$headers = @{
'Authorization' = 'Bearer YOUR_API_TOKEN'
'Content-Type' = 'application/json'
}
$body = @{
push = @{
payload = 'MySecretPassword123'
expire_after_duration = 6
expire_after_views = 3
}
} | ConvertTo-Json -Depth 10
$response = Invoke-RestMethod -Uri 'https://us.pwpush.com/api/v2/pushes' `
-Method Post `
-Headers $headers `
-Body $body
$response | ConvertTo-Json
GET /api/v2/pushes/:url_token
读取推送的秘密有效载荷。这会增加查看次数,并可能使推送过期。
响应字段
检索推送时会返回以下字段。该端点会返回其他端点无法提供的有效载荷和文件。
| 现场 | 类型 | 示例 | 描述 |
|---|---|---|---|
| created_at | string | "2025-02-17T10:00:00.000Z" | ISO 8601 创建时间 |
| days_remaining | integer | 1 | 弃用 剩余天数(当 < 1 天时为 0);首选 expires_at / expires_in |
| deletable_by_viewer | boolean | true | 收件人是否可以删除推送内容 |
| deleted | boolean | false | 是否明确删除了推送 |
| expire_after_days | integer | 1 | 弃用 大约天数(根据持续时间推算) |
| expire_after_duration | integer | 6 | 持续时间枚举(0-17) |
| expire_after_views | integer | 5 | 到期前的最大浏览量 |
| expired | boolean | false | 推送是否已过期 |
| expired_on | string or null | null | 推送过期时为 ISO 8601;未过期时为空 |
| expires_at | string or null | "2025-02-18T10:00:00.000Z" | 推送过期的 ISO 8601 时间;过期为空 |
| expires_in | number | 86400 | 失效前的秒数(失效时为 0) |
| files | array | [{ filename, content_type, url }] | 附带下载 URL 的文件元数据 |
| html_url | string | "https://.../p/abc" | 在浏览器中打开推送的 URL |
| json_url | string | "https://.../p/abc.json" | 以 JSON 格式检索推送的 URL |
| passphrase | string or null | null | 仅在推送有口令时出现(值隐藏) |
| payload | string or null | "secret123" | 秘密内容;过期时为空 |
| retrieval_step | boolean | false | 是否需要额外的步骤来检索 |
| updated_at | string | "2025-02-17T10:00:00.000Z" | ISO 8601 最后更新时间 |
| url_token | string | "fkwjfvhall92" | 推送的唯一秘密标识符 |
| views_remaining | integer | 2 | 到期前的剩余浏览次数 |
申请示例
curl -X GET https://us.pwpush.com/api/v2/pushes/fkwjfvhall92
带密码的请求示例
curl -X GET "https://us.pwpush.com/api/v2/pushes/fkwjfvhall92?passphrase=your_passphrase"
答复示例
{
"expire_after_duration": 6,
"expire_after_views": 3,
"expired": false,
"url_token": "fkwjfvhall92",
"deletable_by_viewer": false,
"retrieval_step": false,
"expired_on": null,
"passphrase": null,
"created_at": "2025-02-17T10:00:00.000Z",
"updated_at": "2025-02-17T10:00:00.000Z",
"expire_after_days": 1,
"views_remaining": 2,
"deleted": false,
"days_remaining": 1,
"expires_at": "2025-02-18T10:00:00.000Z",
"expires_in": 86400,
"json_url": "https://us.pwpush.com/p/fkwjfvhall92.json",
"html_url": "https://us.pwpush.com/p/fkwjfvhall92",
"payload": "MySecretPassword123",
"files": []
}
请注意: 如果推送有口令,请将其作为查询参数: ?passphrase=your_passphrase. 检索推送算作一个视图,如果达到视图限制,推送可能会过期。
GET /api/v2/pushes/:url_token/preview
在不检索有效载荷的情况下,返回推送的完全合格秘密 URL。
申请示例
curl -X GET https://us.pwpush.com/api/v2/pushes/fkwjfvhall92/preview
答复示例
{
"url": "https://us.pwpush.com/p/fkwjfvhall92"
}
GET /api/v2/pushes/:url_token/audit
返回推送的审计日志。需要身份验证和所有权。
查询参数:
page (可选的): 用于分页的页码。
- 默认值:
1(首页) - 范围
1至200 - 每页最多可返回 50 个审计日志条目
- 例如
?page=2检索第二页
申请示例
curl -X GET https://us.pwpush.com/api/v2/pushes/fkwjfvhall92/audit \
-H "Authorization: Bearer YOUR_API_TOKEN"
答复示例
{
"logs": [
{
"ip": "192.168.1.100",
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36",
"referrer": null,
"kind": "creation",
"created_at": "2023-10-27T10:00:00.000Z",
"updated_at": "2023-10-27T10:00:00.000Z"
},
{
"ip": "192.168.1.101",
"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36",
"referrer": "https://example.com",
"kind": "view",
"created_at": "2023-10-27T10:05:00.000Z",
"updated_at": "2023-10-27T10:05:00.000Z"
}
]
}
请注意: "(《世界人权宣言》) kind 字段表示记录的操作类型。常见值包括 creation, view, expire, failed_passphrase, 和 failed_view.
DELETE /api/v2/pushes/:url_token
推送立即失效,并永久删除所有敏感数据,包括有效载荷和任何附加文件。此操作不可逆转,且无法撤销。需要身份验证和所有权,或者推送必须是用 deletable_by_viewer: true.
申请示例
curl -X DELETE https://us.pwpush.com/api/v2/pushes/fkwjfvhall92 \
-H "Authorization: Bearer YOUR_API_TOKEN"
答复示例
{
"expire_after_duration": 7,
"expire_after_views": 5,
"expired": true,
"url_token": "fkwjfvhall92",
"deletable_by_viewer": false,
"retrieval_step": false,
"expired_on": "2023-10-27T10:15:00.000Z",
"passphrase": null,
"created_at": "2023-10-27T10:00:00.000Z",
"updated_at": "2023-10-27T10:15:00.000Z",
"expire_after_days": 7,
"days_remaining": 0,
"expires_at": null,
"expires_in": 0,
"views_remaining": 0,
"deleted": true,
"json_url": "https://us.pwpush.com/p/fkwjfvhall92.json",
"html_url": "https://us.pwpush.com/p/fkwjfvhall92",
"account_id": 1,
"note": null,
"name": null
}
GET /api/v2/pushes/active
返回活动(非过期)推送的分页列表。需要验证。
GET /api/v2/pushes/expired
返回已过期推送的分页列表。需要验证。
查询参数:
page (可选的): 用于分页的页码。
- 默认值:
1(首页) - 范围
1至200 - 每页最多可返回 50 次推送
- 例如
?page=2检索第二页
请求示例(活动)
curl -X GET https://us.pwpush.com/api/v2/pushes/active \
-H "Authorization: Bearer YOUR_API_TOKEN"
申请示例(已过期)
curl -X GET https://us.pwpush.com/api/v2/pushes/expired \
-H "Authorization: Bearer YOUR_API_TOKEN"
答复示例
[
{
"expire_after_duration": 7,
"expire_after_views": 5,
"expired": false,
"url_token": "abc123xyz789",
"deletable_by_viewer": false,
"retrieval_step": false,
"expired_on": null,
"passphrase": null,
"created_at": "2023-10-27T10:00:00.000Z",
"updated_at": "2023-10-27T10:00:00.000Z",
"expire_after_days": 7,
"days_remaining": 7,
"expires_at": "2023-10-29T10:00:00.000Z",
"expires_in": 172800,
"views_remaining": 5,
"deleted": false,
"json_url": "https://us.pwpush.com/p/abc123xyz789.json",
"html_url": "https://us.pwpush.com/p/abc123xyz789",
"account_id": 1,
"note": null,
"name": null
},
{
"expire_after_duration": 1,
"expire_after_views": 3,
"expired": false,
"url_token": "def456uvw012",
"deletable_by_viewer": true,
"retrieval_step": false,
"expired_on": null,
"passphrase": null,
"created_at": "2023-10-26T15:30:00.000Z",
"updated_at": "2023-10-26T15:30:00.000Z",
"expire_after_days": 1,
"days_remaining": 0,
"expires_at": "2023-10-26T16:00:00.000Z",
"expires_in": 1200,
"views_remaining": 2,
"deleted": false,
"json_url": "https://us.pwpush.com/p/def456uvw012.json",
"html_url": "https://us.pwpush.com/p/def456uvw012",
"account_id": 1,
"note": null,
"name": null
}
]
最后更新 July 20, 2026