Password Pusher 应用程序接口 v2
测试版用于集成的全面 REST API 文档 Password Pusher 到您的应用程序中
测试版通知: API v2 目前处于测试阶段。虽然我们已尽一切努力确保稳定性,但在最终发布前可能会有突破性的改动。欢迎您提出反馈意见!
请求
请求可为收集敏感信息提供安全的双向交流。创建一个带有秘密 URL 的请求,与任何人共享,并接收包含文本或文件的安全响应--所有这些都不会在电子邮件、聊天或日志中暴露敏感数据。
非常适合从同事、客户或顾客那里收集凭证、API 密钥、机密文件或任何敏感信息。回复会自动加密,并在指定时间后自动删除,以尽量减少数据暴露。每个请求的审计日志中都有完整的生命周期跟踪。
请求有三种状态:
POST /api/v2/requests
创建一个新请求。 需要验证。
Request Body (JSON)
{
"request": {
"request": "Please provide your hosting information here.",
"close_after_duration": 8,
"passphrase": "optional_passphrase",
"name": "Database Access Request",
"note": "Internal note",
"retrieval_step": true,
"include_requestor": false,
"response_file_attachments": true
}
}
Request Body with Files (multipart/form-data)
curl -X POST https://us.pwpush.com/api/v2/requests \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-F "request[request]=Please provide your hosting information here." \
-F "request[close_after_duration]=8" \
-F "request[name]=Database Access Request" \
-F "request[files][]=@/path/to/document.pdf" \
-F "request[files][]=@/path/to/spreadsheet.xlsx"
Note: When attaching files, use multipart/form-data format. Multiple files can be attached using request[files][].
Parameters
| Parameter | Type | Description |
|---|---|---|
request
必需的
|
string | 要共享的请求文本/信息 |
close_after_duration
可选的
|
integer (0-17) | 持续时间枚举 - 何时关闭请求 |
passphrase
可选的
|
string | 要求收件人输入此密码才能查看 |
name
可选的
|
string | 在仪表板、通知和电子邮件中显示的名称 |
note
可选的
|
string | 内部说明(仅创作者可见) |
retrieval_step
可选的
|
boolean | 有助于避免聊天系统和 URL 扫描器占用浏览量 |
include_requestor
可选的
|
boolean | 在申请中包含申请者信息 |
response_file_attachments
可选的
|
boolean | 允许在回复中添加文件附件 |
files
可选的
|
array | 上传并附加到申请中的文件 |
notify_emails_to
可选的
|
string | 创建申请时要通知的电子邮件地址(以逗号分隔) |
notify_emails_to_locale
可选的
|
string | 发送电子邮件通知的语言(语言 |
authenticated_recipients
可选的
|
boolean | 访问前需通过电子邮件一次性密码(OTP)验证。需要设置 notify_emails_to。启用后仅限浏览器访问(API 请求/响应将返回 403 错误)。 |
account_id
可选的
|
integer | 将请求与之关联的账户 ID |
持续时间值为 close_after_duration
申请示例
curl -X POST https://us.pwpush.com/api/v2/requests \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"request": {
"request": "Please provide your hosting information here.",
"close_after_duration": 8,
"passphrase": "optional_passphrase",
"name": "Database Access Request"
}
}'
require 'net/http'
require 'json'
require 'uri'
uri = URI('https://us.pwpush.com/api/v2/requests')
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 = {
request: {
request: 'Please provide your hosting information here.',
close_after_duration: 8,
passphrase: 'optional_passphrase',
name: 'Database Access Request'
}
}.to_json
response = http.request(request)
puts response.body
import requests
import json
url = 'https://us.pwpush.com/api/v2/requests'
headers = {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Content-Type': 'application/json'
}
data = {
'request': {
'request': 'Please provide your hosting information here.',
'close_after_duration': 8,
'passphrase': 'optional_passphrase',
'name': 'Database Access Request'
}
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
$headers = @{
'Authorization' = 'Bearer YOUR_API_TOKEN'
'Content-Type' = 'application/json'
}
$body = @{
request = @{
request = 'Please provide your hosting information here.'
close_after_duration = 8
passphrase = 'optional_passphrase'
name = 'Database Access Request'
}
} | ConvertTo-Json -Depth 10
$response = Invoke-RestMethod -Uri 'https://us.pwpush.com/api/v2/requests' `
-Method Post `
-Headers $headers `
-Body $body
$response | ConvertTo-Json
GET /api/v2/requests/:url_token
读取已打开或准备就绪的请求内容。如果配置为查看一定次数后关闭,则可能会关闭请求。
申请示例
curl -X GET https://us.pwpush.com/api/v2/requests/orpw2wkg00vpn0a
带密码的请求示例
curl -X GET "https://us.pwpush.com/api/v2/requests/orpw2wkg00vpn0a?passphrase=your_passphrase"
响应示例(开放式请求)
{
"close_after_duration": 8,
"url_token": "orpw2wkg00vpn0a",
"retrieval_step": true,
"passphrase": "optional_passphrase",
"created_at": "2023-10-27T10:00:00.000Z",
"updated_at": "2023-10-27T10:00:00.000Z",
"state": "open",
"include_requestor": false,
"response_file_attachments": true,
"close_after_at": "2023-11-04T10:00:00.000Z",
"days_remaining": 8,
"json_url": "https://us.pwpush.com/r/orpw2wkg00vpn0a.json",
"html_url": "https://us.pwpush.com/r/orpw2wkg00vpn0a",
"request": "Please provide your hosting information here.",
"response": null,
"files": []
}
响应示例(就绪请求)
{
"close_after_duration": 8,
"url_token": "orpw2wkg00vpn0a",
"retrieval_step": true,
"passphrase": "optional_passphrase",
"created_at": "2023-10-27T10:00:00.000Z",
"updated_at": "2023-10-27T10:00:00.000Z",
"state": "ready",
"include_requestor": false,
"response_file_attachments": true,
"close_after_at": "2023-11-04T10:00:00.000Z",
"days_remaining": 8,
"json_url": "https://us.pwpush.com/r/orpw2wkg00vpn0a.json",
"html_url": "https://us.pwpush.com/r/orpw2wkg00vpn0a",
"request": null,
"response": "The API key is: sk_live_1234567890",
"files": []
}
请注意: 如果请求有口令,请将其作为查询参数: ?passphrase=your_passphrase. 检索请求算作一个视图,如果达到视图限制,可能会关闭请求。
PATCH /api/v2/requests/:url_token/respond
响应开放请求,将其状态更改为 "就绪"。
Request Body (JSON)
{
"request": {
"response": "The API key is: sk_live_1234567890"
}
}
Request Body with Files (multipart/form-data)
curl -X PATCH https://us.pwpush.com/api/v2/requests/orpw2wkg00vpn0a/respond \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-F "request[response]=The API key is: sk_live_1234567890" \
-F "request[files][]=@/path/to/response_doc.pdf"
Note: When attaching files, use multipart/form-data format. Multiple files can be attached using request[files][].
参数
| 参数 | 类型 | 描述 |
|---|---|---|
response
必需的
|
string | 请求的回复文本/信息 |
files
可选的
|
array | 要附加到回复中的文件(需要 response_file_attachments: true 请求) |
请注意: 只有处于 "打开 "状态的请求才能接收回复。一旦提交了回复,请求就会转入 "就绪 "状态,不再接受其他回复。
GET /api/v2/requests/:url_token/preview
返回请求的完全限定密文 URL,但不检索内容。
申请示例
curl -X GET https://us.pwpush.com/api/v2/requests/orpw2wkg00vpn0a/preview
答复示例
{
"url": "https://us.pwpush.com/r/orpw2wkg00vpn0a"
}
GET /api/v2/requests/:url_token/audit
返回请求的审计日志。需要身份验证和所有权。
查询参数:
page (可选的): 用于分页的页码。
- 默认值:
1(首页) - 范围
1至200 - 每页最多可返回 50 个审计日志条目
- 例如
?page=2检索第二页
申请示例
curl -X GET https://us.pwpush.com/api/v2/requests/orpw2wkg00vpn0a/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"
},
{
"ip": "192.168.1.102",
"user_agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit/605.1.15",
"referrer": null,
"kind": "response",
"created_at": "2023-10-27T10:10:00.000Z",
"updated_at": "2023-10-27T10:10:00.000Z"
}
]
}
请注意: "(《世界人权宣言》) kind 字段表示记录的操作类型。常见值包括 creation, view, response, close, failed_passphrase, 和 failed_view.
DELETE /api/v2/requests/:url_token
立即关闭请求并永久删除与之相关的所有敏感数据。此操作不可逆转,无法撤销。需要身份验证和所有权。
申请示例
curl -X DELETE https://us.pwpush.com/api/v2/requests/orpw2wkg00vpn0a \
-H "Authorization: Bearer YOUR_API_TOKEN"
答复示例
{
"close_after_duration": null,
"url_token": "orpw2wkg00vpn0a",
"retrieval_step": false,
"passphrase": null,
"created_at": "2023-10-27T10:00:00.000Z",
"updated_at": "2023-10-27T10:15:00.000Z",
"state": "closed",
"include_requestor": false,
"response_file_attachments": false,
"close_after_at": null,
"days_remaining": null,
"json_url": "https://us.pwpush.com/r/orpw2wkg00vpn0a.json",
"html_url": "https://us.pwpush.com/r/orpw2wkg00vpn0a",
"account_id": 1,
"note": null,
"name": null,
"request": null,
"response": null,
"files": []
}
GET /api/v2/requests/active
返回分页的活动(打开或就绪)请求列表。需要验证。
GET /api/v2/requests/open
返回分页的未处理请求列表。需要验证。
GET /api/v2/requests/ready
返回已处理请求的分页列表。需要验证。
GET /api/v2/requests/closed
返回已关闭请求的分页列表。需要验证。
查询参数:
page (可选的): 用于分页的页码。
- 默认值:
1(首页) - 范围
1至200 - 每页最多可返回 50 个请求
- 例如
?page=2检索第二页
请求国
打开
请求已创建,正在等待回复。请求文本可见,但尚未提供回复。
准备好
请求已得到响应,现在包含响应有效负载。请求文本不再可见,但响应可供检索。
关闭
请求已处理,所有敏感数据(包括请求和响应)已被永久删除。这种状态是不可逆的。
请求示例(活动)
curl -X GET https://us.pwpush.com/api/v2/requests/active \
-H "Authorization: Bearer YOUR_API_TOKEN"
申请示例(开放)
curl -X GET https://us.pwpush.com/api/v2/requests/open \
-H "Authorization: Bearer YOUR_API_TOKEN"
请求示例(就绪)
curl -X GET https://us.pwpush.com/api/v2/requests/ready \
-H "Authorization: Bearer YOUR_API_TOKEN"
请求示例(已关闭)
curl -X GET https://us.pwpush.com/api/v2/requests/closed \
-H "Authorization: Bearer YOUR_API_TOKEN"
答复示例
[
{
"close_after_duration": 7,
"url_token": "abc123xyz789",
"retrieval_step": false,
"passphrase": null,
"created_at": "2023-10-27T10:00:00.000Z",
"updated_at": "2023-10-27T10:00:00.000Z",
"state": "open",
"include_requestor": false,
"response_file_attachments": false,
"close_after_at": "2023-11-03T10:00:00.000Z",
"days_remaining": 7,
"json_url": "https://us.pwpush.com/r/abc123xyz789.json",
"html_url": "https://us.pwpush.com/r/abc123xyz789",
"account_id": 1,
"note": null,
"name": null
},
{
"close_after_duration": 7,
"url_token": "def456uvw012",
"retrieval_step": false,
"passphrase": null,
"created_at": "2023-10-26T15:30:00.000Z",
"updated_at": "2023-10-27T09:00:00.000Z",
"state": "ready",
"include_requestor": false,
"response_file_attachments": false,
"close_after_at": "2023-11-02T15:30:00.000Z",
"days_remaining": 6,
"json_url": "https://us.pwpush.com/r/def456uvw012.json",
"html_url": "https://us.pwpush.com/r/def456uvw012",
"account_id": 1,
"note": null,
"name": null
}
]
请注意: "(《世界人权宣言》) /active 端点以两种语言返回请求 open 和 ready 状态。使用 /open 或者 /ready 端点,以按特定状态进行过滤。
最后更新 July 20, 2026