POST /communication/callback/{provider}

接收并处理各短信、邮件、推送服务商(阿里云、腾讯云、AWS SNS/SES、SendGrid、Mailgun、FCM、APNs、JPush等)的投递状态回调通知,自动更新对应消息的发送状态。回调为公开端点,必须携带 HMAC-SHA256 签名(X-Callback-Signature,hex;密钥见 callback.secret),签名缺失/不符一律 401。参考:ePrivacy Directive 2002/58/EC、CAN-SPAM Act。

通信服务 None application/json

请求参数

名称位置类型必填默认值示例约束描述
provider path string 是 服务商名称:aliyun/tencentcloud/aws/sendgrid/ses/mailgun/fcm/apns/jpush
X-Callback-Signature header string 是 回调体 HMAC-SHA256 签名(hex,密钥 = callback.secret)

请求体

接受空 JSON 对象 {}

响应

状态描述Schema
200回调已接收确认service-communication/internal/handler/dto.CallbackResultDetailResponse
400请求数据格式错误dto.SimpleResponse
401回调签名缺失或无效dto.SimpleResponse
404回调指向的消息不存在dto.SimpleResponse
500回调处理内部错误/验签密钥未配置dto.SimpleResponse

引用的 Schema

dto.SimpleResponse

字段类型必填示例约束描述
code integer 否
message string 否
timestamp string 否

service-communication/internal/handler/dto.CallbackResultDetailResponse

字段类型必填示例约束描述
code integer 否
data service-communication/internal/handler/dto.CallbackResultResponse 否
message string 否
timestamp string 否

service-communication/internal/handler/dto.CallbackResultResponse

提供商回调结果

字段类型必填示例约束描述
provider string 否 aliyun
received boolean 否 True