主题
提交意见反馈
提交意见反馈
接口说明
请求URL:http[s]://{网关地址}/casp-portal/v2/feedback/submitFeedbackWithPic
请求方式: POST
请求内容类型: form-data
响应内容类型: application/json
请求说明
请求体
数据格式:
form-data
| 字段名 | 参数名 | 必填 | 类型 | 描述 |
|---|---|---|---|---|
| 上传文件 | uploadFile | O | File | 意见反馈的图片格式JPG JPEG PNG 大小1M内 |
| 意见反馈内容 | data | M | String | 意见反馈的json串 |
json串字段说明
| 字段名 | 参数名 | 必填 | 类型 | 描述 |
|---|---|---|---|---|
| 意见反馈标题 | feedbackTitle | O | String | 意见反馈标题 |
| 意见反馈内容 | feedbackContent | O | String | 意见反馈内容 和短语id 必须有一个值 |
| 短语wid | phrasesWid | O | String | 意见反馈内容 和短语id 必须有一个值 |
| 关联对象信息 | relatedContentInfo | O | RelatedContentInfo | 关联对象信息 |
| 用户账号 | userAccount | M | String | 用户账号 |
RelatedContentInfo
| 字段名 | 参数名 | 必填 | 类型 | 描述 |
|---|---|---|---|---|
| 服务或事项的wid | relaWid | M | String | 服务或事项的wid |
| 关联类型 | relaType | M | int | 0 服务 1 事项 |
请求示例
http
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="uploadFile"; filename="Frame 1261155219.png"
Content-Type: image/png
(data)
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="data"
{
"feedbackTitle": "反馈标题",
"feedbackContent": "反馈内容描述",
"phrasesWid": "78d9afc4cb6544b28c81e31124b16857",
"relatedContentInfo": {
"relaWid": "1402709100856184832",
"relaType": 1
},
"userAccount": "ampadmin"}
------WebKitFormBoundary7MA4YWxkTrZu0gW--1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
响应说明
响应体
| 参数名 | 类型 | 描述 |
|---|---|---|
| errcode | String | 返回码 |
| errmsg | String | 返回描述 |
响应示例
{
"attachmentId": 1559115106002923521,
"msg": "success",
"status": 200
}1
2
3
4
5
2
3
4
5
错误码
| 错误码 | 描述 |
|---|---|
| 999 | 统一错误码,详细描述信息参见接口返回 |
Demo
java
Client client = new DefaultClient(BASE_URL, APP_ID, APP_SECRET);
SubmitFeedbackWithPicRequest request = new SubmitFeedbackWithPicRequest();
List<File> uploadFile = new ArrayList<File>();
File file = new File("/Users/jszhang/Documents/20260108102401.png");
uploadFile.add( file);
File file1 = new File("/Users/jszhang/Documents/haha小姜丝.jpg");
uploadFile.add( file1);
request.setUploadFile(uploadFile);
//
SubmitFeedbackWithPicRequest.FeedbackContent feedbackContent = new SubmitFeedbackWithPicRequest.FeedbackContent();
feedbackContent.setFeedbackTitle("反馈标题1");
feedbackContent.setFeedbackContent("反馈内容1");
feedbackContent.setObjectScope(1);
feedbackContent.setUserAccount("ampadmin");
feedbackContent.setPhrasesContent("测试");
feedbackContent.setPhrasesWid("78d9afc4cb6544b28c81e31124b16857");
SubmitFeedbackWithPicRequest.RelatedContentInfo relatedContentInfo = new SubmitFeedbackWithPicRequest.RelatedContentInfo();
relatedContentInfo.setRelaType(1);
relatedContentInfo.setRelaWid("1402709100856184832");
feedbackContent.setRelatedContentInfo(relatedContentInfo);
request.setFeedbackContent(feedbackContent);
SubmitFeedbackWithPicResponse execute = client.execute(request);
if (execute.isSuccess()) {
System.out.println(JSONObject.toJSONString(execute));
} else {
throw new Exception("上传图片异常:" + JSONObject.toJSONString(execute));
}1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27

