V3 解决方案 API 变更

V3 解决方案 API 变更

 

我们对解决方案 V3 API(以 /api/v3/solutions 开头的 URL)的格式和字段名做了一些变更,从 11200 版开始生效。 我们建议您尽早使用这些变更。对现有版本的支持将在 2021 年 9 月 30 日后终止。在此之前,将同时支持现有版本和新版本。


要获得新版本,请在 API 请求中包含以下标头 

 

已接受: vnd.manageengine.v3+json 

 

解决方案版本的主要差异:

旧版

 新版

key_words [Json 

Array] 

keywords [String 

separated by comma] 

comment * 

public 

is_public 

user_groups 

user_group_mapping 

view_count 

no_of_hits 

is_reviewdate_elapsed 

is_expirydate_elapsed 

expiry_notified 

is_expiry_notified 

review_notified 

is_review_notified 

solution_owner 

owner 

attachments 

"statuscode": "200" 

"status_code": 2000 

 

在新的 API 版本中删除了注释,因为注释等同于解决方案中的原因,而同样的原因也被记录在历史记录中。


要获取解决方案历史记录,请使用以下 URL :

http://localhost:8080/api/v3/solutions/<solutionid>/history 

 

Ex: http://localhost:8080/api/v3/solutions/1/history 

 

输入数据格式变更:

      旧版

  新版

    "solutions": { 

        "title": "sample", 

        "description": "sample description", 

        "topic": { 

            "name": "General" 

        } 

    } 

    "solution": { 

        "title": "sample", 

        "description": "sample description", 

        "topic": { 

            "name": "General" 

        } 

    } 

 

查看所有解决方案 >> 过滤器属性的支持值: 

 

 

旧版 

    新版

Approved 

ApprovedSolutions 

Rejected 

RejectedSolutions 

Approval Pending 

Approval_Pending 

UnApproved 

UnApprovedSolutions 

 

ExpiredSolutions 

 

AllSolutions 

 

输入数据样本,查看过滤器解决方案: 

   旧版本 

  新版本

    "list_info": { 

        "row_count": "3", 

        "start_index": "1", 

        "end_index": "2", 

        "sort_field": "topic", 

        "sort_order": "A", 

        "filter": "Approved" 

    } 

    "list_info": { 

        "row_count": "3", 

        "start_index": "1", 

        "sort_field": "topic", 

        "sort_order": "A", 

        "filter_by": { 

            "name": "ApprovedSolutions" 

        } 

    } 

 

获取附件:

<Server-Host>/api/v3/solutions/<solutionid>/attachments/ 

 

下载附件:

<Server-Host>/api/v3/solutions/<solutionid>/attachments/<attachment-id>/download 

 

完整响应比较 :

现有回复格式:

新的回复格式:

"solution": { 

 

"created_time": { 

"display_value": "Aug 18, 2020 02:30 PM", 

"value": "1597741248946" 

}, 

 

"has_attachments": true, 

 

"approval_status": { 

"name": "Approved", 

"id": "2" 

}, 

"review_notified": false, 

 

"expiry_date": { 

            "display_value": ,"Oct 30, 2021 

12:00 PM" 

            "value": "1635575400000" 

        }, 

"description": "<div>gkghk<br /></div>", 

 

"key_words": [ 

            "printer", 

            "problem" 

        ], 

 

"title": "test solution", 

"solution_owner": [ 

            { 

                "name": "administrator", 

                "id": "4" 

            }, 

            { 

                "name": "tech1", 

                "id": "301" 

            } 

        ], 

 

 

 

 

 

 

 

"created_by": { 

"email_id": null, 

"name": "administrator", 

"is_vipuser": false, 

"id": "4" 

}, 

 

"expiry_notified": false, 

 

"last_updated_by": { 

"email_id": null, 

"name": "administrator", 

"is_vipuser": false, 

"id": "4" 

}, 

 

"review_date": { 

            "display_value": "Sep 29, 2021 

12:00 PM", 

            "value": "1632897000000" 

        }, 

"public": true, 

 

 

 

 

 "last_updated_time": { 

            "display_value": "Jul 1, 2021 04:43 

PM", 

            "value": "1625138005507" 

        } 

"topic": { 

"name": "Hardware", 

"id": "1" 

}, 

 

"id": "1", 

 

"view_count": "6", 

 

"user_groups":  [ 

            { 

                "name": "test1", 

                "id": "1" 

            }, 

            { 

                "name": "user group 2", 

                "id": "2" 

            } 

        ] 

    } 

 

 

 

 

 

 

 

 

 

 

"comment": "Solution Approved Through 

Save And Approve mode", 

 

}, 

 

 

 

 

 

 

 

"response_status": { 

"messages": [ 

"status_code": "200", 

"type": "success", 

"message": "Solution details fetched 

successfully" 

], 

"status": "success" 

 

 

 

 

 

"solution": { 

 

"created_time": { 

"display_value": "Aug 18, 2020 11:20 AM", 

"value": "1597729800000" 

}, 

 

 

 

"has_attachments": true, 

 

"approval_status": { 

"name": "Approved", 

"id": "2" 

}, 

 

 

"is_review_notified": false, 

 

"expiry_date": { 

            "display_value": "Dec 29, 2021 

12:00 PM", 

            "value": "1640759400000" 

        }, 

 

 

"description": "<div>gkghk<br /></div>", 

 

"keywords": "printer , skype", 

 

 

"title": "test solution", 

 

"owner": [ 

            { 

                "email_id": null, 

                "phone": "1234455", 

                "name": "administrator", 

                "mobile": "1234567890", 

                "is_vipuser": false, 

                "id": "4", 

                "department": null 

            }, 

            { 

                "email_id": null, 

                "phone": "925-852-2588", 

                "name": "Shawn Adams", 

                "mobile": null, 

                "is_vipuser": false, 

                "id": "5", 

                "department": null 

            } 

        ] , 

 

"created_by": { 

"email_id": null, 

"name": "administrator", 

"is_vipuser": false, 

"id": "4", 

"department": null 

}, 

 

"is_expiry_notified": false, 

 

 

"last_updated_by": { 

"email_id": null, 

"name": "administrator", 

"is_vipuser": false, 

"id": "4", 

"department": null 

}, 

 

 

"review_date": { 

            "display_value": "Sep 29, 2021 

12:00 PM", 

            "value": "1632897000000" 

        }, 

 

"is_public": true, 

 

 

 

 

 

 

 

"last_updated_time": { 

"display_value": "Aug 18, 2020 05:54 PM", 

"value": "1597753478443" 

}, 

 

 

"topic": { 

"name": "Hardware", 

"id": "1" 

}, 

 

 

"id": "1", 

 

"no_of_hits": "6", 

 

 

"user_group_mapping":  [ 

            { 

                "name": "ug1", 

                "id": "1" 

            }, 

            { 

                "name": "ug2", 

                "id": "2" 

            } 

        ] 

    } 

 

 

 

 

 

 

 

 

 

"attachments": [ 

"content_type": "image/png", 

"size": { 

"display_value": "176.99KB", 

"value": 181246 

}, 

"module": "solution", 

"name": "Screen Shot 2020-08-18 at 

8.51.40 AM.png", 

"content_url": 

"/api/v3/solutions/1/attachments/1/dow

nload", 

"id": "1" 

], 

 

"is_reviewdate_elapsed": false, 

"is_expirydate_elapsed": false, 

 

}, 

 

 

 

"response_status": { 

 

"status_code": 2000, 

"status": "success"