compress-pdf
Purpose
This skill compresses a PDF by:
1) accepting a PDF file from the user,
2) uploading it to the Cross-Service-Solutions compression API,
3) polling the job status until it is finished,
4) returning the compressed file download URL.
Credentials
The API requires an API key used as a Bearer token:
How the user gets an API key:
- - They can sign up and get their key at:
https://login.cross-service-solutions.com/register
- - Or they can provide an API key directly to the bot.
Rule: never echo or log the API key.
API endpoints
Base URL:
Create compression job:
- - INLINECODE2
- INLINECODE3 parameters:
-
file (PDF Dokument) — required — PDF file
-
imageQuality — required — number 0..100 (default 75)
-
dpi — required — number 72..300 (default 144)
Get result by ID:
When done, the response contains:
- -
output.files[] with { name, path } where path is a downloadable URL.
Inputs
Required
- - A PDF file (binary)
- An API key (string)
Optional
- -
imageQuality (0..100), default 75 - INLINECODE12 (72..300), default 144
Output
Return a structured result:
- -
job_id (number) - INLINECODE14 (string)
- INLINECODE15 (string, when done)
- INLINECODE16 (string, when available)
- INLINECODE17 (object)
Example output:
```json
{
"job_id": 123,
"status": "done",
"download_url": "https://.../compressed.pdf",
"file_name": "compressed.pdf",
"settings": { "imageQuality": 75, "dpi": 144 }
}
compress-pdf
目的
该技能通过以下步骤压缩PDF文件:
1) 接收用户提供的PDF文件,
2) 将其上传至Cross-Service-Solutions压缩API,
3) 轮询任务状态直至完成,
4) 返回压缩文件的下载链接。
凭证
API需要使用API密钥作为Bearer令牌:
用户获取API密钥的方式:
https://login.cross-service-solutions.com/register
规则: 切勿输出或记录API密钥。
API端点
基础URL:
- - https://api.xss-cross-service-solutions.com/solutions/solutions
创建压缩任务:
- - POST /api/29
- multipart/form-data 参数:
- file(PDF文档)— 必填 — PDF文件
- imageQuality — 必填 — 数值0..100(默认75)
- dpi — 必填 — 数值72..300(默认144)
通过ID获取结果:
任务完成后,响应中包含:
- - output.files[],包含 { name, path },其中 path 为可下载的URL。
输入
必填
可选
- - imageQuality(0..100),默认75
- dpi(72..300),默认144
输出
返回结构化结果:
- - jobid(数字)
- status(字符串)
- downloadurl(字符串,任务完成时)
- file_name(字符串,可用时)
- settings(对象)
输出示例:
json
{
job_id: 123,
status: done,
download_url: https://.../compressed.pdf,
file_name: compressed.pdf,
settings: { imageQuality: 75, dpi: 144 }
}