简要描述:

  • 客户更新

请求URL:

  • /api/v2/customers/:id

  • url请求参数说明
字段名 是否必填 描述
id true 客户的id,替换掉url的:id

请求方式:

  • PUT

请求头:

请求参数:

请求参数说明

字段名 是否必填 描述
check_duplicates false 是否需要查重 传 字符串 ‘true’ ‘flase’.
customer[user_id] false 负责人
customer[name] false 客户名称
customer[status] false 状态
customer[note] false 备注
customer[category] false 客户类型
customer[source] false 客户来源
customer[industry] false 所属行业
customer[staff_size] false 人员规模
customer[want_department_id] false 部门
customer[address_attributes][detail_address] false 地址相关的 详细地址
customer[address_attributes][tel] false 这是 customer[address_attributes][tel]
customer[address_attributes][url] false 这是 customer[address_attributes][url]
customer[address_attributes][country_id] false 这是 customer[address_attributes][country_id]
customer[address_attributes][province_id] false 这是 customer[address_attributes][province_id]
customer[address_attributes][city_id] false 这是 customer[address_attributes][city_id]
customer[address_attributes][district_id] false 这是 customer[address_attributes][district_id]
customer[address_attributes][zip] false 这是 customer[address_attributes][zip]
customer[address_attributes][fax] false 这是 customer[address_attributes][fax]
customer[address_attributes][qq] false 这是 customer[address_attributes][qq]
customer[address_attributes][wechat] false 这是 customer[address_attributes][wechat]
customer[address_attributes][wangwang] false 这是 customer[address_attributes][wangwang]
customer[address_attributes][phone] false 这是 customer[address_attributes][phone]
customer[address_attributes][email] false 这是 customer[address_attributes][email]
customer[labels][] false 客户标签 这里可以传多个标签

返回示例:

正确时返回:


{
  "code": 0,
  "data": {
    "id": 18,
    "name": "贸易公司",
    "status": "7",
    "status_mapped": "初访",
    "note": "主营外贸销售,代理国外一线品牌",
    "category": "",
    "category_mapped": "",
    "source": "",
    "source_mapped": "",
    "industry": "",
    "industry_mapped": "",
    "staff_size": 0,
    "staff_size_display": "",
    "staff_size_mapped": "",
    "created_at": "2015-07-03 17:31",
    "updated_at": "2015-09-24 16:48",
    "is_own": true,
    "attachments": "暂无附件",
    "company_name": "",
    "text_asset_9320d8d7": "",
    "text_asset_22503a16": "",
    "numeric_asset_e2955b70": 123,
    "numeric_asset_8ea55cf0": 1.1,
    "is_has_policy_for_assist_user": true,
    "address": {
      "id": 1076,
      "country": {
        "id": 4,
        "name": "中国",
        "pinyin": null
      },
      "province": {},
      "city": {},
      "district": {},
      "tel": "010-64881989",
      "phone": "",
      "email": "zhaoning@web.com",
      "qq": "18888896",
      "fax": "",
      "wechat": "weixinsadfasw",
      "wangwang": "288888897",
      "zip": "100008",
      "url": "",
      "detail_address": "北京市朝阳区朝阳门外大街18号丰联广场A座第9层",
      "lat": 0,
      "lng": 0,
      "distance": "0m",
      "region_info": "中国",
      "off_distance": 0,
      "country_id": 0,
      "province_id": 0,
      "city_id": 0,
      "district_id": 0
    },
    "user": {
      "id": 2,
      "email": "wp@qq.com",
      "created_at": "2015-06-10T11:06:45.000+08:00",
      "name": "test",
      "organization_id": 1,
      "phone": "15921076830",
      "role_id": 0,
      "workflow_state": "organization_staff",
      "job": "",
      "tel": "",
      "gender": "male",
      "avatar_url": "http://192.168.10.99:3000/assets/male.jpg",
      "confirmed_phone_at": ""
    },
    "owned_department": {
      "id": 2,
      "name": "销售部"
    }
  }
}

错误时返回:


{
  "code": 100000,
  "message": "device参数错误",
  "error": "invalid_app_error"
}

返回参数说明:

暂无

备注:

文档更新时间: 2025-04-29 14:18   作者:陈胜海