Password Pusher API เวอร์ชัน 2
เบต้าเอกสารประกอบการใช้งาน REST API อย่างครบถ้วนสำหรับการบูรณาการ Password Pusher ในแอปพลิเคชันของคุณ
ประกาศสำหรับรุ่นเบต้า: API เวอร์ชัน 2 ขณะนี้อยู่ในช่วงเบต้า แม้ว่าเราจะพยายามอย่างเต็มที่เพื่อให้มั่นใจถึงความเสถียรแล้ว แต่ก็อาจมีการเปลี่ยนแปลงที่ส่งผลกระทบต่อการทำงานก่อนการเปิดตัวเวอร์ชันเต็ม เรายินดีรับฟังความคิดเห็นของคุณ!
คำร้องขอ
การส่งคำขอช่วยให้การสื่อสารแบบสองทางที่ปลอดภัยสำหรับการรวบรวมข้อมูลที่ละเอียดอ่อน สร้างคำขอด้วย 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://eu.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) | enum ระยะเวลา - กำหนดว่าเมื่อใดจึงจะปิดคำขอ |
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 | ภาษาที่จะใช้ส่งอีเมลแจ้งเตือน |
account_id
ไม่จำเป็น
|
integer | รหัสบัญชีที่จะใช้เชื่อมโยงกับคำขอ |
ค่าระยะเวลาสำหรับ close_after_duration
ตัวอย่างคำขอ
curl -X POST https://eu.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://eu.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://eu.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://eu.pwpush.com/api/v2/requests' `
-Method Post `
-Headers $headers `
-Body $body
$response | ConvertTo-Json
GET /api/v2/requests/:url_token
ดึงเนื้อหาของคำขอที่เปิดอยู่หรือพร้อมใช้งาน การดำเนินการนี้อาจปิดคำขอหากมีการตั้งค่าให้ปิดหลังจากจำนวนการดูที่กำหนดไว้
ตัวอย่างคำขอ
curl -X GET https://eu.pwpush.com/api/v2/requests/orpw2wkg00vpn0a
ตัวอย่างคำขอพร้อมรหัสผ่าน
curl -X GET "https://eu.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://eu.pwpush.com/r/orpw2wkg00vpn0a.json",
"html_url": "https://eu.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://eu.pwpush.com/r/orpw2wkg00vpn0a.json",
"html_url": "https://eu.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://eu.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://eu.pwpush.com/api/v2/requests/orpw2wkg00vpn0a/preview
ตัวอย่างคำตอบ
{
"url": "https://eu.pwpush.com/r/orpw2wkg00vpn0a"
}
GET /api/v2/requests/:url_token/audit
ส่งคืนบันทึกการตรวจสอบสำหรับคำขอ ต้องมีการตรวจสอบสิทธิ์และความเป็นเจ้าของ
พารามิเตอร์การค้นหา:
page (ไม่จำเป็น): หมายเลขหน้าสำหรับการจัดหน้า
- ค่าเริ่มต้น:
1(หน้าแรก) - พิสัย:
1ถึง200 - แสดงรายการบันทึกการตรวจสอบได้สูงสุด 50 รายการต่อหน้า
- ตัวอย่าง:
?page=2เพื่อเรียกดูหน้าสอง
ตัวอย่างคำขอ
curl -X GET https://eu.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://eu.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://eu.pwpush.com/r/orpw2wkg00vpn0a.json",
"html_url": "https://eu.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://eu.pwpush.com/api/v2/requests/active \
-H "Authorization: Bearer YOUR_API_TOKEN"
ตัวอย่างคำขอ (เปิด)
curl -X GET https://eu.pwpush.com/api/v2/requests/open \
-H "Authorization: Bearer YOUR_API_TOKEN"
ตัวอย่างคำขอ (พร้อมใช้งาน)
curl -X GET https://eu.pwpush.com/api/v2/requests/ready \
-H "Authorization: Bearer YOUR_API_TOKEN"
ตัวอย่างคำขอ (ปิดแล้ว)
curl -X GET https://eu.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://eu.pwpush.com/r/abc123xyz789.json",
"html_url": "https://eu.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://eu.pwpush.com/r/def456uvw012.json",
"html_url": "https://eu.pwpush.com/r/def456uvw012",
"account_id": 1,
"note": null,
"name": null
}
]
บันทึก: เดอะ /active ปลายทางจะส่งคืนคำขอในทั้งสองกรณี open และ ready รัฐต่างๆ ใช้ /open หรือ /ready จุดสิ้นสุดสำหรับการกรองตามรัฐที่เฉพาะเจาะจง
อัปเดตล่าสุด: July 12, 2026