基本信息
- 用途说明:附件上传
- 请求方式:POST
- 请求地址:http://api.kingdee.com/jdy/basedata/attachment_upload
请求参数
headers参数
- 所有的接口必须携带header参数
| 参数名称 | 参数示例 | 是否必填 | 参数说明 |
|---|---|---|---|
| Content-Type | application/json | true | 固定传:application/json |
| groupName | ns-v7g6 | true | 分组名称,获取授权信息时返回的groupName |
| accountId | 16xxxxxxxxxxxx | true | 账套ID,获取授权信息时返回的accountId |
| X-GW-Router-Addr | https://tf.jdy.com | true | IDC域名,获取授权信息时返回的domain |
特别注意:gruopName是变动的,若调用接口出现11010001返回码,则需要主动获取授权信息,以获取最新groupName。
params参数
| 参数名称 | 参数类型 | 是否必填 | 参数说明 |
|---|---|---|---|
| access_token | string | true | 金蝶云通行证token |
body参数
| 参数名称 | 类型 | 必选 | 说明 |
|---|---|---|---|
| file1 | File | true | 选中上传的文件 |
| file2 | File | false | 多个文件依此增加 |
请求示例
curl POST 'http://api.kingdee.com/jdy/basedata/attachment_upload?access_token=1588042310b6bc1ee37befeeee4ada1d'
--H 'Content-Type: multipart/form-data'
-H 'groupname: ns-v7g6'
-H 'accountid: 1584244570835057173'
--form 'file=@/D:/fastdfs_client-1.6.jar'
--H 'Content-Type: multipart/form-data'
-H 'groupname: ns-v7g6'
-H 'accountid: 1584244570835057173'
--form 'file=@/D:/fastdfs_client-1.6.jar'
响应参数
| 参数名称 | 参数类型 | 参数说明 |
|---|---|---|
| errorCode | string | 返回码,调用成功时为success |
| message | string | 返回信息,调用失败时会返回具体信息 |
| data | obj | 业务数据 |
data
| 参数名称 | 类型 | 必选 | 说明 |
|---|---|---|---|
| file | Strnig | true | 文件的访问地址,可用于新增单据时的附件上传 |
响应示例
{
success: true,
reachPlugin: true,
data: {
file: https://tf.jdy.com/fileserver//jdyattachmentimage/1584244570835057173/webapi/202009231600842783037/fastdfs_client-1.6.jar
},
errorCode: success
}