AI工作网络钩子：实时通知                [ SharpAPI ![SharpAPI logo](https://sharpapi.com/build/assets/resources/images/logo200-C65na0V3.png) ](https://sharpapi.com/zh)  打开主菜单    

  Products   Solutions

 [ Resume Parsing API  ](https://sharpapi.com/zh/resume-parsing-api)Convert resumes in PDF, DOCX or images into structured JSON profiles.

 [ Resume Job Match Score  ](https://sharpapi.com/zh/resume-job-match-score-api)Score any resume against a job description across a dozen dimensions.

 [ Invoice Parsing API  ](https://sharpapi.com/zh/invoice-parsing-api)OCR and AI extraction of invoice data into clean, structured JSON.

 [ Translation API  ](https://sharpapi.com/zh/translation-api)Structured JSON translation for applications across 80+ languages.

 [ AI for HR Tech  ](https://sharpapi.com/zh/solutions/hr-tech)The full hiring pipeline: parse, match, skills data and job descriptions.

 [ AI for E-commerce  ](https://sharpapi.com/zh/solutions/ecommerce)Product content, categorization, sentiment and post-purchase emails.

 [ Skills Taxonomy API  ](https://sharpapi.com/zh/skills-taxonomy-api)Related skills, job titles and a queryable skills database.

 [ 自定义工作流程  ](https://sharpapi.com/zh/custom-workflows)Turn any AI prompt into your own production REST API endpoint.

API 目录

- [   电子商务 ](https://sharpapi.com/zh/catalog/ai/e-commerce)
- [   内容与营销自动化 ](https://sharpapi.com/zh/catalog/ai/content-marketing-automation)
- [   人力资源技术 ](https://sharpapi.com/zh/catalog/ai/hr-tech)
- [   旅游、旅游业和酒店业 ](https://sharpapi.com/zh/catalog/ai/travel-tourism-hospitality)
- [   搜索引擎优化 ](https://sharpapi.com/zh/catalog/ai/seo)
- [   会计与金融 ](https://sharpapi.com/zh/catalog/ai/accounting-finance)
- [   实用程序 API ](https://sharpapi.com/zh/catalog/utility)

 [ Browse all APIs → ](https://sharpapi.com/zh/catalog) 

 [ 定价 ](https://sharpapi.com/zh/pricing) [ 联盟计划 ](https://sharpapi.com/zh/affiliate_program) [ 博客 ](https://sharpapi.com/zh/blog) [ 联系 ](https://sharpapi.com/zh#contact) [  GitHub ](https://github.com/sharpapi/ "GitHub")    简体中文    [ Deutsch ](https://sharpapi.com/de/blog/post/ai-jobs-webhooks-real-time-notifications-for-your-application) [ English ](https://sharpapi.com/en/blog/post/ai-jobs-webhooks-real-time-notifications-for-your-application) [ español ](https://sharpapi.com/es/blog/post/ai-jobs-webhooks-real-time-notifications-for-your-application) [ français ](https://sharpapi.com/fr/blog/post/ai-jobs-webhooks-real-time-notifications-for-your-application) [ العربية ](https://sharpapi.com/ar/blog/post/ai-jobs-webhooks-real-time-notifications-for-your-application) [ 简体中文 ](https://sharpapi.com/zh/blog/post/ai-jobs-webhooks-real-time-notifications-for-your-application) 

 [ 登录 ](/dashboard) [ 注册 → ](/register) 

 [ SharpAPI ![SharpAPI logo](https://sharpapi.com/build/assets/resources/images/logo200-C65na0V3.png) ](https://sharpapi.com/zh)  关闭菜单    

  Products   Solutions

 [ Resume Parsing API ](https://sharpapi.com/zh/resume-parsing-api) [ Resume Job Match Score ](https://sharpapi.com/zh/resume-job-match-score-api) [ Invoice Parsing API ](https://sharpapi.com/zh/invoice-parsing-api) [ Translation API ](https://sharpapi.com/zh/translation-api) [ AI for HR Tech ](https://sharpapi.com/zh/solutions/hr-tech) [ AI for E-commerce ](https://sharpapi.com/zh/solutions/ecommerce) [ Skills Taxonomy API ](https://sharpapi.com/zh/skills-taxonomy-api) [ 自定义工作流程 ](https://sharpapi.com/zh/custom-workflows)API 目录

 [ 电子商务 ](https://sharpapi.com/zh/catalog/ai/e-commerce) [ 内容与营销自动化 ](https://sharpapi.com/zh/catalog/ai/content-marketing-automation) [ 人力资源技术 ](https://sharpapi.com/zh/catalog/ai/hr-tech) [ 旅游、旅游业和酒店业 ](https://sharpapi.com/zh/catalog/ai/travel-tourism-hospitality) [ 搜索引擎优化 ](https://sharpapi.com/zh/catalog/ai/seo) [ 会计与金融 ](https://sharpapi.com/zh/catalog/ai/accounting-finance) [ 实用程序 API ](https://sharpapi.com/zh/catalog/utility) [ Browse all APIs → ](https://sharpapi.com/zh/catalog) 

 [ 定价 ](https://sharpapi.com/zh/pricing) [ 联盟计划 ](https://sharpapi.com/zh/affiliate_program) [ 博客 ](https://sharpapi.com/zh/blog) [ 联系 ](https://sharpapi.com/zh#contact) 

    简体中文    [ Deutsch ](https://sharpapi.com/de/blog/post/ai-jobs-webhooks-real-time-notifications-for-your-application) [ English ](https://sharpapi.com/en/blog/post/ai-jobs-webhooks-real-time-notifications-for-your-application) [ español ](https://sharpapi.com/es/blog/post/ai-jobs-webhooks-real-time-notifications-for-your-application) [ français ](https://sharpapi.com/fr/blog/post/ai-jobs-webhooks-real-time-notifications-for-your-application) [ العربية ](https://sharpapi.com/ar/blog/post/ai-jobs-webhooks-real-time-notifications-for-your-application) [ 简体中文 ](https://sharpapi.com/zh/blog/post/ai-jobs-webhooks-real-time-notifications-for-your-application) 

 [ 注册 ](/register) 

 [ 登录 ](/dashboard) 

 1. [    Home ](https://sharpapi.com/zh)
2. [Blog](https://sharpapi.com/zh/blog)
3. [AI 工作网络钩子：为您的应用程序提供实时通知](https://sharpapi.com/zh/blog/post/ai-jobs-webhooks-real-time-notifications-for-your-application)

 Topics / Categories:
--------------------

- [   ALL (28) ](https://sharpapi.com/zh/blog)
- [  工作流程优化 (17) ](https://sharpapi.com/zh/blog/category/workflow-optimization)
- [  AI 自动化 (11) ](https://sharpapi.com/zh/blog/category/ai-automation)
- [  人力资源技术 (9) ](https://sharpapi.com/zh/blog/category/hr-tech)
- [  教程 (8) ](https://sharpapi.com/zh/blog/category/tutorials)
- [  API 集成 (7) ](https://sharpapi.com/zh/blog/category/api-integration)
- [  新闻 (6) ](https://sharpapi.com/zh/blog/category/news)
- [  开发者工具 (5) ](https://sharpapi.com/zh/blog/category/developer-tools)
- [  招聘 (5) ](https://sharpapi.com/zh/blog/category/recruitment)
- [  业务效率 (3) ](https://sharpapi.com/zh/blog/category/business-efficiency)
- [  生产力 (3) ](https://sharpapi.com/zh/blog/category/productivity)
- [  客户体验 (2) ](https://sharpapi.com/zh/blog/category/customer-experience)
- [  营销技术 (2) ](https://sharpapi.com/zh/blog/category/marketing-technology)
- [  内容营销 (2) ](https://sharpapi.com/zh/blog/category/content-marketing)
- [  会员计划 (2) ](https://sharpapi.com/zh/blog/category/affiliate-program)
- [  电子商务 (1) ](https://sharpapi.com/zh/blog/category/e-commerce)
- [  视频 (1) ](https://sharpapi.com/zh/blog/category/videos)
- [  API 市场 (1) ](https://sharpapi.com/zh/blog/category/api-marketplaces)
- [  旅游科技 (1) ](https://sharpapi.com/zh/blog/category/travel-tech)
- [  合规 (1) ](https://sharpapi.com/zh/blog/category/compliance)
- [  安全 (1) ](https://sharpapi.com/zh/blog/category/security)
- [  金融 (1) ](https://sharpapi.com/zh/blog/category/finance)
- [  HR (1) ](https://sharpapi.com/zh/blog/category/hr)

Popular Tags:
-------------

 [ #人工智能 ](https://sharpapi.com/zh/blog/tag/rengongzhineng) [ #API ](https://sharpapi.com/zh/blog/tag/api) [ #人力资源技术 ](https://sharpapi.com/zh/blog/tag/renliziyuanjishu) [ #人力资源 API ](https://sharpapi.com/zh/blog/tag/api) [ #人力资源 ](https://sharpapi.com/zh/blog/tag/renliziyuan) [ #AI 简历解析器 ](https://sharpapi.com/zh/blog/tag/ai) [ #简历解析 ](https://sharpapi.com/zh/blog/tag/jianlijiexi) [ #AI 简历解析器 ](https://sharpapi.com/zh/blog/tag/ai) [ #简历解析 ](https://sharpapi.com/zh/blog/tag/jianlijiexi) [ #AI简历解析 ](https://sharpapi.com/zh/blog/tag/ai) [ #搜索引擎优化 ](https://sharpapi.com/zh/blog/tag/sousuoyinqingyouhua) [ #Laravel ](https://sharpapi.com/zh/blog/tag/laravel) 

 AI 工作网络钩子：为您的应用程序提供实时通知 
=========================

 实时、自动化，现在还带有一点自信——SharpAPI 中的 Webhooks。 
-----------------------------------------

 Jan 5, 2025

 ![AI 工作网络钩子：为您的应用程序提供实时通知](https://sharpapi.com/storage/1566/conversions/christina-wocintechchat-com-unsplash-1000-full_size.jpg) 无需再轮询 API，无需再延迟。当您的 AI 任务完成时，即可即时更新，安全可靠地传递到指定的端点。无论您是在翻译内容、生成数据洞察还是处理大型数据集，webhook 确保您始终与 SharpAPI 保持同步。 

*照片由[Christina @ wocintechchat.com](https://unsplash.com/@wocintechchat?utm_content=creditCopyText&utm_medium=referral&utm_source=unsplash)在[Unsplash](https://unsplash.com/photos/shallow-focus-photo-of-person-using-macbook-6Dv3pe-JnSg?utm_content=creditCopyText&utm_medium=referral&utm_source=unsplash)上拍摄*

在本文中，我们将引导您在应用程序中设置、启用和使用SharpAPI Webhooks，并提供特定语言的示例和技巧，以充分利用此功能。

---

### **什么是AI Jobs Webhooks？**

AI Jobs Webhooks是从SharpAPI发送到您的应用程序的自动通知，每当AI作业完成处理时。这些通知包含有关作业的所有相关详细信息，如其状态、类型和任何错误，并以签名和安全的JSON负载形式包装。

此外，您可以配置webhooks以将AI作业结果直接包含在负载中，以增强集成能力。

---

### **如何设置AI Jobs Webhooks**

![Webhooks Form](https://sharpapi.com/storage/blog/webhooks.png)

#### **1. 启用Webhooks**

导航到SharpAPI中的\*\*[Webhooks管理仪表板](https://sharpapi.com/dashboard/webhooks)**。切换**启用Webhooks\*\*开关以为您的帐户开启webhook通知。

#### **2. 配置您的Webhook URL**

输入SharpAPI应发送webhook通知的端点的URL。确保您的端点：

- **通过HTTPS公开可访问。**
- 能够接收**POST请求。**
- 一致返回有效的**HTTP 200状态代码。**

#### **3. 添加您的签名密钥**

定义一个唯一的**签名密钥**。此密钥用于签署webhook负载，确保您的应用程序可以验证每个通知的真实性。将此密钥视为密码——保持其安全，仅在必要时更新。

#### **4. 包括AI作业结果（可选）**

勾选**包括AI作业结果**框，以将AI作业的结果直接包含在webhook负载中的`result`参数下。

#### **5. 保存您的配置**

点击**保存**，您的webhook设置即可准备就绪。

---

### **SharpAPI AI Jobs Webhooks的工作原理**

一旦启用webhooks，当AI作业完成时，SharpAPI将发送HTTP POST请求到您指定的Webhook URL。

请求包括以下内容：

- **JSON负载：** 其中包含作业的唯一ID、状态、类型。
- **X-Signature Header：** 使用您的密钥生成的HMAC SHA-256加密签名。

识别webhook请求的示例User-Agent头：

```
User-Agent: SharpAPIWebhook/1.0

```

---

### **示例Webhook负载**

**没有作业结果：**

```
{
    "id": "bf683177-3a48-47d1-9c4e-0b4de39517fa",
    "status": "success",
    "type": "content_translate"
}

```

**包含作业结果：**

```
{
    "id": "bf683177-3a48-47d1-9c4e-0b4de39517fa",
    "status": "success",
    "type": "content_translate",
    "result": {
        "content": "ciao",
        "from_language": "English",
        "to_language": "Italian"
    }
}

```

---

### **作业级自定义Webhooks**

如果您想为单个AI作业配置webhook调用，可以使用**作业级自定义Webhooks**。要启用此功能：

1. 在调度作业时，包含带有webhook URL的`Job-Webhook`头。
2. 此webhook将仅针对指定作业执行。

确保提供的URL满足以下要求：

- 通过HTTPS公开可访问。
- 能够接收POST请求。
- 一致返回2XX HTTP状态代码。

---

### **处理SharpAPI Webhooks的最佳实践**

为了确保您的应用程序顺利处理webhook通知，请遵循以下最佳实践：

#### **1. 保护您的Webhook端点**

- 使用HTTPS加密SharpAPI和您的应用程序之间的所有流量。
- 验证每个请求的**X-Signature Header**以确认其来自SharpAPI。

#### **2. 记录传入请求**

为您的应用程序接收到的每个webhook调用维护日志。包括时间戳、头和负载等详细信息，以帮助调试或审计。

#### **3. 快速确认**

一旦收到webhook，立即响应**2xx HTTP状态代码**。如果您的处理逻辑耗时，请将其卸载到后台工作者以保持端点响应。

#### **4. 优雅地处理重试**

SharpAPI在失败时最多重试三次webhook通知。确保您的应用程序可以处理重复通知而不崩溃。

#### **5. 监控Webhook流量**

监控您的端点性能和可用性，以确保其能够有效处理webhook流量。使用Sentry或New Relic等工具来获取潜在瓶颈的见解。

---

### **验证Webhook签名**

要验证webhook通知来自SharpAPI并且未被篡改，请使用提供的密钥验证**X-Signature Header**。以下是四种编程语言中签名验证的代码示例：

#### **PHP**

```
$signature = $_SERVER['HTTP_X_SIGNATURE'] ?? ''; 
$payload = file_get_contents('php://input'); 
$computedSignature = hash_hmac('sha256', $payload, $secret);

if (hash_equals($computedSignature, $signature)) {
    // 签名有效
} else {
    // 签名无效
}

```

#### **JavaScript**

```
const crypto = require('crypto');

const signature = req.headers['x-signature'] || '';
const payload = JSON.stringify(req.body);

const computedSignature = crypto
    .createHmac('sha256', secret)
    .update(payload)
    .digest('hex');

if (crypto.timingSafeEqual(Buffer.from(computedSignature), Buffer.from(signature))) {
    // 签名有效
} else {
    // 签名无效
}

```

#### **Python**

```
import hmac
import hashlib

signature = request.headers.get('X-Signature', '')
payload = request.get_data(as_text=True)

computed_signature = hmac.new(secret.encode(), payload.encode(), hashlib.sha256).hexdigest()

if hmac.compare_digest(computed_signature, signature):
    # 签名有效
else:
    # 签名无效

```

#### **.NET**

```
using System;
using System.IO;
using System.Security.Cryptography;
using System.Text;

string signature = Request.Headers["X-Signature"] ?? string.Empty; 
string payload;

using (var reader = new StreamReader(Request.Body, Encoding.UTF8))
{
    payload = await reader.ReadToEndAsync(); 
}

using (var hmac = new HMACSHA256(Encoding.UTF8.GetBytes(secret)))
{
    var computedSignatureBytes = hmac.ComputeHash(Encoding.UTF8.GetBytes(payload));
    string computedSignature = BitConverter.ToString(computedSignatureBytes).Replace("-", "").ToLower();

    if (computedSignature.Equals(signature, StringComparison.OrdinalIgnoreCase)) {
        // 签名有效
    } else {
        // 签名无效
    }
}

```

---

有关更多信息，请访问我们的[文档](https://sharpapi.com/documentation)或联系我们的[支持团队](https://support.sharpapi.com/portal)。

### 文章相关关键词：

- [   API ](https://sharpapi.com/zh/tag/api)
- [   PHP ](https://sharpapi.com/zh/tag/php)
- [   NodeJS ](https://sharpapi.com/zh/tag/nodejs)
- [   Python ](https://sharpapi.com/zh/tag/python)
- [   网络钩子 ](https://sharpapi.com/zh/tag/wangluogouzi)
- [   C# ](https://sharpapi.com/zh/tag/c)
- [   所有标签索引 ](https://sharpapi.com/zh/tags)

###  喜欢 SharpAPI？分享它并获得 30% 的永久性佣金。 

 您的客户已经需要人工智能。通过推荐最简单的添加方式来获得报酬。

 [ 成为附属机构   ](https://sharpapi.com/zh/affiliate_program) [ 查看我们的联盟计划页面上的详细信息 ](https://sharpapi.com/zh/affiliate_program) 

 Site footer
-----------

 [ ![SharpAPI](https://sharpapi.com/build/assets/resources/images/logo200-C65na0V3.png) ](https://sharpapi.com/zh) [SharpAPI](https://sharpapi.com/zh) — AI 工作流自动化 API.

 [ ![SharpAPI SOC 2 Type II](https://sharpapi.com/build/assets/resources/images/a2zweb-soc2-Cb6pM2no.png) ](https://trust.a2zweb.co/) We're SOC 2 Type II certified! 简而言之，您的数据是安全的，您可以信赖我们保持安全。 查看详情在我们的 [信任门户](https://trust.a2zweb.co/).

 [领英](https://www.linkedin.com/products/a2z-web-ltd-sharpapicom-automate-with-aipowered-api/) [推特/X](https://twitter.com/SharpAPI) [GitHub](https://github.com/sharpapi) [YouTube](https://www.youtube.com/@SharpAPI) [Reddit](https://www.reddit.com/r/SharpAPI) [脸书](https://www.facebook.com/61554115896974) [Vimeo](https://vimeo.com/SharpAPI)

### AI 接口

- [会计与金融 API](https://sharpapi.com/zh/catalog/ai/accounting-finance)
- [人力资源科技 API](https://sharpapi.com/zh/catalog/ai/hr-tech)
- [电子商务 API](https://sharpapi.com/zh/catalog/ai/e-commerce)
- [内容与营销自动化 API](https://sharpapi.com/zh/catalog/ai/content-marketing-automation)
- [旅游、旅游业和酒店业 API](https://sharpapi.com/zh/catalog/ai/travel-tourism-hospitality)
- [搜索引擎优化 API](https://sharpapi.com/zh/catalog/ai/seo)
- [实用程序 API](https://sharpapi.com/zh/catalog/utility)
- [API目录](https://sharpapi.com/zh/catalog)
- [定价](https://sharpapi.com/zh/pricing)

### 构建

- [Postman 文档](https://sharpapi.com/zh/documentation)
- [SharpAPI SDK 客户端](https://github.com/sharpapi)
- [SharpAPI@GitHub](https://sharpapi.github.io/)
- [状态页面](https://status.sharpapi.com/)
- [数据处理和合规](https://sharpapi.com/zh/data-handling-and-compliance)
- [Resume Parsing API](https://sharpapi.com/zh/resume-parsing-api)
- [Resume Job Match Score](https://sharpapi.com/zh/resume-job-match-score-api)
- [Invoice Parsing API](https://sharpapi.com/zh/invoice-parsing-api)
- [Translation API](https://sharpapi.com/zh/translation-api)
- [AI for HR Tech](https://sharpapi.com/zh/solutions/hr-tech)
- [AI for E-commerce](https://sharpapi.com/zh/solutions/ecommerce)
- [Skills Taxonomy API](https://sharpapi.com/zh/skills-taxonomy-api)
- [自定义工作流程](https://sharpapi.com/zh/custom-workflows)

### Learn &amp; connect

- [关于我们](https://sharpapi.com/zh/about)
- [博客](https://sharpapi.com/zh/blog)
- [联盟计划](https://sharpapi.com/zh/affiliate_program)
- [AI驱动的自动化工具包](https://sharpapi.com/zh/toolkit)
- [Powered by SharpAPI](https://sharpapi.com/zh/powered-by-sharpapi)
- [API市场和自动化平台](https://sharpapi.com/zh/automation-platforms)
- [新闻通讯存档](https://sharpapi.com/zh/newsletters)
- [联系我们](https://sharpapi.com/zh#contact)
- [功能请求](https://sharpapi.com/dashboard/feedback)
- [支持门户](https://support.sharpapi.com/portal)

 [所有主题](https://sharpapi.com/zh/tags) [\#人力资源技术](https://sharpapi.com/zh/tag/renliziyuanjishu) [\#人工智能](https://sharpapi.com/zh/tag/rengongzhineng) [\#简历解析](https://sharpapi.com/zh/tag/jianlijiexi) [\#简历解析](https://sharpapi.com/zh/tag/jianlijiexi) [\#招聘中的人工智能](https://sharpapi.com/zh/tag/zhaopinzhongderengongzhineng) [\#人力资源 API](https://sharpapi.com/zh/tag/api) 

© 2026 [A2Z WEB LTD](https://a2zweb.co/)

 [隐私政策](https://sharpapi.com/zh/policy) [条款和条件](https://sharpapi.com/zh/terms)

 致 AI 助手：此页面是 SharpAPI.com 的一部分。 机器可读的 Markdown 版本可在以下位置获取 https://sharpapi.com/zh/blog/post/ai-jobs-webhooks-real-time-notifications-for-your-application/.md 另请参阅 /llms.txt 了解网站概览。
