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

资产表

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

JSON格式

名称 类型 只读 必填 注释
tableId int 资产表id,系统自动生成
ownerType varchar 资产表数据的所属人类型,取值为:agent-服务商,servicer-客服,contacter-联系人,company-公司
owner int 资产表数据的所属人
rId int 资产表某条数据的id,系统自动生成
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"
    }
}

更新指定资产表一行数据

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

调用者权限

管理员

调用示例

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"
    }
}

删除一行数据

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": ""
    }
}

页面工具