帮我吧文档:数据接口:资产表

资产表

资产表是表单的一种,您可在帮我吧后台设置某个表单用作资产表,可以将该资产表关联到客户档案,那么该表单就可以用来记录某个客户的资产,资产的形式可以根据场景的不同而不同,比如可以作为某个客户的“合同表”,可以作为某个客户的“购买明细”,也可作为某个客户的“回访记录”等等。

JSON格式

名称 类型 只读 必填 注释
tableId int 资产表id,系统自动生成
ownerType varchar 资产表数据的所属人类型,取值为:agent-服务商,servicer-客服,contacter-联系人,company-公司
owner int 资产表数据的所属人,取值为:agent-服务商id,servicer-客服id,contacter-联系人id,company-公司id
rId int 资产表某条数据的id,系统自动生成
unique_key varchar 唯一值的字段唯一标识,根据这个标识搜索唯一值
unique_value varchar 唯一值的取值,根据这个值更新数据
createTime datetime 创建时间
updateTime datetime 更新时间

JSON示例

{
     "tableId": 91739,
     "ownerType": "https://www.bangwo8.com/api/v1/forms/91739.json",
     "owner": "合同表",
     "rId": "3223",
     "updateTime":"2018-12-07 18:30:30",
     "createTime":"2018-12-07 18:30:30"
}

获取指定资产表的所有数据

GET /api/v1/forms/asset_form/{tableId}.json

说明:默认按编码升序返回

调用者权限

管理员

调用示例

curl https://www.bangwo8.com/api/v1/forms/asset_form/3234.json \
  -v -u {account}:{password}

返回值示例

Status: 200 OK

{
    "asset_table":[
        {
            "rId":"1",
            "cpdm":"312",
            "cpmc":"ffsfs",
            "owner":"37809",
            "ownerType":"agent",
            "tableId":"61748",
            "createTime":"2019-01-15 14:03:59",
            "updateTime":"2019-01-15 14:03:59"
        },
        {
            "rId":"2",
            "cpdm":"erer",
            "cpmc":"sfsfg",
            "owner":"37809",
            "ownerType":"agent",
            "tableId":"61748",
            "createTime":"2019-01-15 14:03:59",
            "updateTime":"2019-01-15 14:03:59"
        }
    ]
}

给指定资产表添加一行数据

POST /api/v1/forms/asset_form/{tableId}.json

调用者权限

管理员

调用示例

curl -v -u {account}:{password} https://www.bangwo8.com/api/v1/forms/asset_form/61748.json \
  -H "Content-Type: application/json" \
  -X POST -d \
'{"item_data":{"owner":"65047","ownerType":"servicer","cpmc":"","cpdm":"20190102555", "tableId":"61748"}}'

返回值示例

Status: 200 OK

{
    "item_data":{
        "rId":"5",
        "cpdm":"20190102555",
        "cpmc":"",
        "tableId":"61748",
        "owner":"65047",
        "ownerType":"servicer",
        "createTime":"2019-01-15 14:34:47",
        "updateTime":"2019-01-15 14:34:47"
    }
}

给指定资产表添加多行数据

POST /api/v1/forms/asset_form/{tableId}.json

调用者权限

管理员

调用示例

curl -v -u {account}:{password} https://www.bangwo8.com/api/v1/forms/asset_form/61748.json \
  -H "Content-Type: application/json" \
  -X POST -d \
'{
    "items_data":[
        {
            "field_1":"4273353",
            "field_2":"测试数据1111111",
            "field_3":"大第三方的",
            "field_4_pid":"o3",
            "field_4_curId":"o39",
            "field_6":"3",
            "field_7":"",
            "relative_ticket_columnId":"21910041",
            "owner":"1134973",
            "ownerType":"servicer",
            "tableId":"3331893"
        },
        {
            "field_1":"4273356",
            "field_2":"测试数据222222",
            "field_3":"1111",
            "field_4_pid":"o39",
            "field_4_curId":"o458",
            "field_6":"22",
            "field_7":"",
            "relative_ticket_columnId":"21910041",
            "owner":"1134973",
            "ownerType":"servicer",
            "tableId":"3331893"
        }
    ]
}'

返回值示例

Status: 200 OK

{
    "items_data":[
        {
            "field_1":"4273353",
            "field_2":"测试数据1111111",
            "field_3":"大第三方的",
            "field_4_pid":"o3",
            "field_4_curId":"o39",
            "field_6":"3",
            "field_7":"",
            "relative_ticket_columnId":"21910041",
            "owner":"1134973",
            "ownerType":"servicer",
            "tableId":"3331893"
        },
        {
            "field_1":"4273356",
            "field_2":"测试数据222222",
            "field_3":"1111",
            "field_4_pid":"o39",
            "field_4_curId":"o458",
            "field_6":"22",
            "field_7":"",
            "relative_ticket_columnId":"21910041",
            "owner":"1134973",
            "ownerType":"servicer",
            "tableId":"3331893"
        }
    ]
}

更新指定资产表一行数据

PUT  /api/v1/forms/asset_form/{tableId}/{rId}.json?unique_key=xxx&unique_value=xxx

调用者权限

管理员

调用示例

curl -v -u {account}:{password} https://www.bangwo8.com/api/v1/forms/asset_form/61748/5.json \
  -H "Content-Type: application/json" \
  -X PUT -d '{"item_data":{"rId":"5","owner":"65047","ownerType":"servicer","cpmc":"帮我吧", \
  "cpdm":"XF345", "tableId":"61748"}}'

返回值示例

Status: 200 OK

{
    "item_data":{
        "rId":"5",
        "cpdm":"20190102555",
        "cpmc":"",
        "tableId":"61748",
        "owner":"65047",
        "ownerType":"servicer",
        "createTime":"2019-01-15 14:34:47",
        "updateTime":"2019-01-15 14:34:47"
    }
}

根据唯一值更新指定资产表一行数据

PUT  /api/v1/forms/asset_form/{tableId}.json

调用者权限

管理员

调用示例

curl -v -u {account}:{password} https://www.bangwo8.com/api/v1/forms/asset_form/61748.json?unique_key=cpdm&unique_value=XF345\
  -H "Content-Type: application/json" \
  -X PUT -d '{"item_data":{"rId":"5","owner":"65047","ownerType":"servicer","cpmc":"帮我吧", \
  "cpdm":"XF345", "tableId":"61748"}}'

返回值示例

Status: 200 OK

{
    "item_data":{
        "rId":"5",
        "cpdm":"XF345",
        "cpmc":"帮我吧",
        "tableId":"61748",
        "owner":"65047",
        "ownerType":"servicer",
        "createTime":"2019-01-15 14:34:47",
        "updateTime":"2019-01-15 14:34:47"
    }
}

删除一行数据

DELETE /api/v1/forms/asset_form/{tableId}/{rId}.json

调用者权限

所有客服

调用示例

curl https://www.bangwo8.com/api/v1/forms/asset_form/61748/5.json \
  -v -u {account}:{password} \
  -X DELETE

返回值示例

Status: 200 OK

{
    "result":{
        "rId": 5,
        "tableId": 61748,
        "success": true,
        "error_log": ""
    }
}

页面工具