AI驱动的API
自定义感谢电子邮件生成器
生成详细的感谢信息在购买之后,不包括标题、问候语和发件人信息。
响应内容不包含标题、问候语或发送者信息,因此您可以轻松个性化电子邮件的其余部分。
此 API 非常适合希望自动化客户互动的电子商务平台。它确保每位客户收到贴心的感谢信息,提升他们的购物体验。使用案例包括发送个性化的感谢电子邮件、提高客户满意度和培养客户忠诚度。
只有 content 参数是必需的。
您可以使用 max_length 参数限制输出。请记住,max_length 只是对语言模型的强烈建议,而不是严格要求,以保持结果的一般意义。
您可以通过提供 voice_tone 参数来设置您喜欢的写作风格。它可以是形容词,如 funny 或 joyous,甚至是著名作家的名字。
此 API 方法还提供一个可选的 context 参数,可用于提供额外的灵活内容处理指令。
AI 工作涉及两个关键步骤:
- 提交AI任务: 通过发送工作请求来启动流程。
- 监控和接收结果: 持续检查作业状态,并在成功完成后获取最终输出。
相关SDK/库
Step 1. 提交AI工作请求
Endpoint: POST - /v1/ecommerce/thank_you_email
| Attribute | Type | Mandatory | Description |
|---|---|---|---|
| content | String | Yes | 产品名称及其参数以生成感谢邮件。 |
| language | String | No | 指定输出语言,默认为English。 |
| max_length | Number | No | 指定邮件的最大字数,例如,100。 |
| voice_tone | String | No | 指定输出的语气。可以是形容词如funny或joyous,甚至是famous writer的名字。 |
| context | String | No | 内容处理的额外灵活指令。 |
REQUEST EXAMPLE:
{
"content": "Razer Blade 16 Gaming Laptop: NVIDIA GeForce RTX 4090-13th Gen Intel 24-Core i9 HX CPU",
"language": "English",
"voice_tone": "neutral",
"context": "At the end of the email include an invitation for the customer to visit our store again"
}
RESPONSE EXAMPLE:
{
"status_url": "https://sharpapi.com/api/v1/content/translate/job/status/5de4887a-0dfd-49b6-8edb-9280e468c210",
"job_id": "5de4887a-0dfd-49b6-8edb-9280e468c210"
}
Step 2. 监控并获取AI工作结果
Endpoint: GET- v1/ecommerce/thank_you_email/job/status/:uuid
An endpoint is used to check on the progress of the requested API job.
RESULT EXAMPLE:
{
"data": {
"type": "api_job_result",
"id": "8c3af4d1-a8ae-4c52-9656-4f26254b7b71",
"attributes": {
"status": "success",
"type": "ecommerce_thank_you_email",
"result": {
"email": "Dear Customer,\n\nThank you for your recent purchase of the Razer Blade 16 Gaming Laptop: NVIDIA GeForce RTX 4090-13th Gen Intel 24-Core i9 HX CPU. We appreciate your business and are confident that you will enjoy the high performance and advanced features of your new laptop.\n\nWe look forward to serving you again. Please visit our store soon for more exciting products and offers.\n\nBest regards,\n[Your Company Name]"
}
}
}
}