mirror of
https://github.com/beilunyang/moemail.git
synced 2026-09-05 23:36:37 +08:00
refactor: Update API documentation and curl examples with protocol-aware URLs
This commit is contained in:
@@ -411,33 +411,26 @@ Content-Type: application/json
|
|||||||
|
|
||||||
#### 获取邮箱列表
|
#### 获取邮箱列表
|
||||||
```http
|
```http
|
||||||
GET /api/emails?cursor=xxx&limit=10
|
GET /api/emails?cursor=xxx
|
||||||
```
|
```
|
||||||
参数说明:
|
参数说明:
|
||||||
- `cursor`: 分页游标,可选
|
- `cursor`: 分页游标,可选
|
||||||
- `limit`: 每页数量,默认 10
|
|
||||||
|
|
||||||
#### 获取单个邮箱
|
#### 获取指定邮箱邮件列表
|
||||||
```http
|
```http
|
||||||
GET /api/emails/{emailId}
|
GET /api/emails/{emailId}?cursor=xxx
|
||||||
```
|
```
|
||||||
|
参数说明:
|
||||||
|
- `cursor`: 分页游标,可选
|
||||||
|
|
||||||
#### 删除邮箱
|
#### 删除邮箱
|
||||||
```http
|
```http
|
||||||
DELETE /api/emails/{emailId}
|
DELETE /api/emails/{emailId}
|
||||||
```
|
```
|
||||||
|
|
||||||
#### 获取邮件列表
|
#### 获取单封邮件内容
|
||||||
```http
|
```http
|
||||||
GET /api/emails/{emailId}/messages?cursor=xxx&limit=10
|
GET /api/emails/{emailId}/{messageId}
|
||||||
```
|
|
||||||
参数说明:
|
|
||||||
- `cursor`: 分页游标,可选
|
|
||||||
- `limit`: 每页数量,默认 10
|
|
||||||
|
|
||||||
#### 获取单封邮件
|
|
||||||
```http
|
|
||||||
GET /api/emails/{emailId}/messages/{messageId}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### 使用示例
|
### 使用示例
|
||||||
|
|||||||
@@ -324,7 +324,7 @@ export function ApiKeyPanel() {
|
|||||||
variant="ghost"
|
variant="ghost"
|
||||||
size="icon"
|
size="icon"
|
||||||
onClick={() => copyToClipboard(
|
onClick={() => copyToClipboard(
|
||||||
`curl -X POST https://${window.location.host}/api/emails/generate \\
|
`curl -X POST ${window.location.protocol}//${window.location.host}/api/emails/generate \\
|
||||||
-H "X-API-Key: YOUR_API_KEY" \\
|
-H "X-API-Key: YOUR_API_KEY" \\
|
||||||
-H "Content-Type: application/json" \\
|
-H "Content-Type: application/json" \\
|
||||||
-d '{
|
-d '{
|
||||||
@@ -338,7 +338,7 @@ export function ApiKeyPanel() {
|
|||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
<pre className="text-xs bg-muted/50 rounded-lg p-4 overflow-x-auto">
|
<pre className="text-xs bg-muted/50 rounded-lg p-4 overflow-x-auto">
|
||||||
{`curl -X POST https://${window.location.host}/api/emails/generate \\
|
{`curl -X POST ${window.location.protocol}//${window.location.host}/api/emails/generate \\
|
||||||
-H "X-API-Key: YOUR_API_KEY" \\
|
-H "X-API-Key: YOUR_API_KEY" \\
|
||||||
-H "Content-Type: application/json" \\
|
-H "Content-Type: application/json" \\
|
||||||
-d '{
|
-d '{
|
||||||
@@ -356,7 +356,7 @@ export function ApiKeyPanel() {
|
|||||||
variant="ghost"
|
variant="ghost"
|
||||||
size="icon"
|
size="icon"
|
||||||
onClick={() => copyToClipboard(
|
onClick={() => copyToClipboard(
|
||||||
`curl https://${window.location.host}/api/emails?cursor=CURSOR \\
|
`curl ${window.location.protocol}//${window.location.host}/api/emails?cursor=CURSOR \\
|
||||||
-H "X-API-Key: YOUR_API_KEY"`
|
-H "X-API-Key: YOUR_API_KEY"`
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
@@ -364,7 +364,7 @@ export function ApiKeyPanel() {
|
|||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
<pre className="text-xs bg-muted/50 rounded-lg p-4 overflow-x-auto">
|
<pre className="text-xs bg-muted/50 rounded-lg p-4 overflow-x-auto">
|
||||||
{`curl https://${window.location.host}/api/emails?cursor=CURSOR \\
|
{`curl ${window.location.protocol}//${window.location.host}/api/emails?cursor=CURSOR \\
|
||||||
-H "X-API-Key: YOUR_API_KEY"`}
|
-H "X-API-Key: YOUR_API_KEY"`}
|
||||||
</pre>
|
</pre>
|
||||||
</div>
|
</div>
|
||||||
@@ -376,7 +376,7 @@ export function ApiKeyPanel() {
|
|||||||
variant="ghost"
|
variant="ghost"
|
||||||
size="icon"
|
size="icon"
|
||||||
onClick={() => copyToClipboard(
|
onClick={() => copyToClipboard(
|
||||||
`curl https://${window.location.host}/api/emails/{emailId}/messages?cursor=CURSOR \\
|
`curl ${window.location.protocol}//${window.location.host}/api/emails/{emailId}?cursor=CURSOR \\
|
||||||
-H "X-API-Key: YOUR_API_KEY"`
|
-H "X-API-Key: YOUR_API_KEY"`
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
@@ -384,7 +384,7 @@ export function ApiKeyPanel() {
|
|||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
<pre className="text-xs bg-muted/50 rounded-lg p-4 overflow-x-auto">
|
<pre className="text-xs bg-muted/50 rounded-lg p-4 overflow-x-auto">
|
||||||
{`curl https://${window.location.host}/api/emails/{emailId}/messages?cursor=CURSOR \\
|
{`curl ${window.location.protocol}//${window.location.host}/api/emails/{emailId}?cursor=CURSOR \\
|
||||||
-H "X-API-Key: YOUR_API_KEY"`}
|
-H "X-API-Key: YOUR_API_KEY"`}
|
||||||
</pre>
|
</pre>
|
||||||
</div>
|
</div>
|
||||||
@@ -396,7 +396,7 @@ export function ApiKeyPanel() {
|
|||||||
variant="ghost"
|
variant="ghost"
|
||||||
size="icon"
|
size="icon"
|
||||||
onClick={() => copyToClipboard(
|
onClick={() => copyToClipboard(
|
||||||
`curl https://${window.location.host}/api/emails/{emailId}/{messageId} \\
|
`curl ${window.location.protocol}//${window.location.host}/api/emails/{emailId}/{messageId} \\
|
||||||
-H "X-API-Key: YOUR_API_KEY"`
|
-H "X-API-Key: YOUR_API_KEY"`
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
@@ -404,7 +404,7 @@ export function ApiKeyPanel() {
|
|||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
<pre className="text-xs bg-muted/50 rounded-lg p-4 overflow-x-auto">
|
<pre className="text-xs bg-muted/50 rounded-lg p-4 overflow-x-auto">
|
||||||
{`curl https://${window.location.host}/api/emails/{emailId}/{messageId} \\
|
{`curl ${window.location.protocol}//${window.location.host}/api/emails/{emailId}/{messageId} \\
|
||||||
-H "X-API-Key: YOUR_API_KEY"`}
|
-H "X-API-Key: YOUR_API_KEY"`}
|
||||||
</pre>
|
</pre>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user