NATSprofile.contact.bind绑定联系方式

绑定手机号 / 邮箱;OTP 工单由 profile_service 回源 otp_service 消费校验(scene=bind)。

Request Payload

消息格式:JSON

NameData TypeRequiredDescription
userIdstringYes用户 ID
channelstringYesphone / email
targetstringYes手机号或邮箱
verifyTicketIdstringYesOTP 已验证工单(scene=bind)
type RequestBody = {
  /** 用户 ID */
  userId: string
  /** phone / email */
  channel: string
  /** 手机号或邮箱 */
  target: string
  /** OTP 已验证工单(scene=bind) */
  verifyTicketId: string
}
{
  "userId": "01JD8SEGQ0P9N2XK4L7VDH3T6C",
  "channel": "email",
  "target": "chen.lin@example.com",
  "verifyTicketId": "otv_2b74ce91f5608d3a"
}

Response Payload

回复使用统一信封 {id, code, messages, result},其 result:

NameData TypeRequiredDescription
contactIdstringYes联系方式 ID
channelstringYes通道
targetstringYes绑定目标
boundAtstringYes绑定时间
type ResponseBody = {
  /** 联系方式 ID */
  contactId: string
  /** 通道 */
  channel: string
  /** 绑定目标 */
  target: string
  /** 绑定时间 */
  boundAt: string
}
{
  "contactId": "01JD8SNP7N9R2W8YR3V6YEL0W4G",
  "channel": "email",
  "target": "chen.lin@example.com",
  "boundAt": "2026-10-14T11:10:00Z"
}

Response Code

回复使用统一信封 {id, code, messages, result},其 code 字段:

code Meaning Notes
0 成功 绑定联系方式
2009 目标已被占用
2202 OTP 工单无效

Examples

{
  "userId": "01JD8SEGQ0P9N2XK4L7VDH3T6C",
  "channel": "email",
  "target": "chen.lin@example.com",
  "verifyTicketId": "otv_2b74ce91f5608d3a"
}
{
  "id": "01JD8SV59N1K7M4NJ",
  "code": 0,
  "messages": [],
  "result": {
    "contactId": "01JD8SNP7N9R2W8YR3V6YEL0W4G",
    "channel": "email",
    "target": "chen.lin@example.com",
    "boundAt": "2026-10-14T11:10:00Z"
  }
}