# 创建渠道码

请求方式: POST(HTTPS

请求地址: https://nbd-api.myscrm.cn/open-nbd-qw-channel/v1/channel-code/add

请求参数说明:

参数 必须 说明
group_id 所属渠道分组 id
channel_name 渠道名称
type 渠道类型:1-多人一码,2-批量单人码
app_id 所属企微中台应用 id
need_add_confirm 客户添加时是否需要员工确认,默认为 false
add_nickname_remark 是否开启扫码客户自动添加备注,默认为 false
nickname_remark 自动添加的昵称备注。add_nickname_remark = true 时必传
add_description 是否开启扫码客户自动添加描述,默认为 false
client_description 自动添加的客户描述。add_description = true 时必传
welcome_type 欢迎语类型:1-默认欢迎语,2-自定义欢迎语,3-不设置,4-预设欢迎语
welcome_text 欢迎语文本
preset_welcome_api_name 预设欢迎语 API 名称。welcome_type=4 时必传
preset_welcome_api 预设欢迎语 API 地址。welcome_type=4 时必传
preset_welcome_api_code 预设欢迎语 API code。welcome_type=4 时必传
is_fission 是否裂变,默认为 false
organ_fission_id 接入方裂变 id。is_fission = true 时必传
organ_fission_name 接入方裂变名称。is_fission = true 时必传
qw_users 关联员工的企微成员
qw_users.qw_user_id 企微里的 userid
qw_users.qw_user_name 企微成员姓名
add_tag 是否开启扫码客户自动添加标签
corp_tags 自动添加的客户标签 id 列表,已被删除的标签不会再返回。add_tag = true 时必传
corp_tags.id 标签 id
add_organ_tag 是否开启接入方自定义标签
organ_tags 接入方自定义标签。add_organ_tag = true 时必传
organ_tags.code 标签 code
organ_tags.value 标签值
is_hidden 是否标识隐藏,默认为 false,隐藏则不在列表中返回
channel_attachments 欢迎语附件
channel_attachments.type 附件类型:1-图片,2-小程序,3-H5,4-视频,5-文件
channel_attachments.img_url 图片 URL,type = 1 时必传
channel_attachments.h5_href h5 链接,type = 3 时必传
channel_attachments.h5_title h5 标题,type = 3 时必传
channel_attachments.h5_description h5 描述,type = 3 时必传
channel_attachments.h5_cover_url h5 封面,type = 3 时必传
channel_attachments.video_url 视频 url,type = 4 时必传
channel_attachments.file_url 文件 url,type = 5 时必传
channel_attachments.is_custom_miniprogram 是否自定义小程序,默认为 false
channel_attachments.miniprogram_title 小程序标题,type = 2 时必传
channel_attachments.miniprogram_appid 小程序 appid,type = 2 时必传
channel_attachments.miniprogram_page_group 选择已有小程序时的页面分类,type = 1 且 is_custom_miniprogram = false 时必传
channel_attachments.miniprogram_page_name 选择已有小程序时的页面名称,type = 1 且 is_custom_miniprogram = false 时必传
channel_attachments.miniprogram_url 小程序路径,type = 2 时必传
channel_attachments.miniprogram_pic_url 小程序封面 url,type = 2 时必传

请求示例:

{
  "group_id": "39fe4b87-9047-1c56-6d1b-cb5d16b3ef4b",
  "channel_name": "渠道码名称",
  "type": 2,
  "app_id": "39fdde5b-f8cb-2246-cf8a-43902bd31084",
  "need_add_confirm": false,
  "qw_users": [
    {
      "qw_user_id": "939fea758a72664cac50d8904cc51eff",
      "qw_user_name": "张三"
    }
  ],
  "add_tag": true,
  "corp_tags": [
    {
      "id": "939fea758a72664cac50d8904cc51eff",
      "name": "客户标签"
    }
  ],
  "add_organ_tag": true,
  "organ_tags": [
    {
      "code": "channel_tag",
      "value": "1001"
    }
  ],
  "is_hidden": false,
  "add_nickname_remark": true,
  "nickname_remark": "昵称备注",
  "add_description": true,
  "client_description": "客户描述",
  "welcome_type": 4,
  "welcome_text": "xxxx",
  "preset_welcome_api_name": "智能名片",
  "preset_welcome_api": "http://a.com",
  "preset_welcome_code": "code-card",
  "channel_attachments": [
    {
      "type": 0,
      "img_url": "string",
      "h5_href": "string",
      "h5_title": "string",
      "h5_description": "string",
      "h5_cover_url": "string",
      "video_url": "string",
      "file_url": "string",
      "is_custom_miniprogram": true,
      "miniprogram_title": "string",
      "miniprogram_appid": "string",
      "miniprogram_page_group": "string",
      "miniprogram_page_name": "string",
      "miniprogram_url": "string",
      "miniprogram_pic_url": "string"
    }
  ],
  "is_fission": true,
  "organ_fission_id": "fuzz",
  "organ_fission_name": "裂变活动名称"
}

返回数据:

{
  "errcode": 0,
  "errmsg": "ok",
  "channel_id": "5b5b473d-28ef-4d4c-8f5c-7209e8b551e7"
}

返回参数说明:

参数 说明
channel_id 创建的渠道码 id