关闭一个请求

关闭一个请求

API调用URL地址

http://<serverName>:<portNumber>/api/v3/requests/{request-id}/close

其中{request-id}为需要关闭得请求ID

示例:http://192.168.1.8:8080/api/v3/requests/11/close

请求参数

方法:PUT

请求参数:

参数名

位置

input_data

<JSON_String>

body

authtoken

<API Key>

header

 

输入示例

input_data=
{
    "request":{
        "closure_info":{
            "requester_ack_resolution":true,
            "requester_ack_comments":"Mail fetching is up and running now",
            "closure_comments":"Reset the pasword solved the issue",
            "closure_code":{
                "name":"success"
            }

        }

    }

}
closure_info中的信息与手动关闭请求时弹窗的窗口对应。
"requester_ack_resolution":true 表示解决方法是否已经过请求人的确认?是
"requester_ack_comments":"Mail fetching is up and running now" 表示下图中的备注
"closure_comments":"Reset the pasword solved the issue" 表示请求关闭注释
  "closure_code":{"name":"success" } 表示请求关闭代码为Success

 

响应示例

 {

    "response_status": {
        "status_code"2000,
        "messages": [
            {
                "status_code"2000,
                "type""success",
                "message""成功关闭请求"
            }
        ],
        "status""success"
    }
}

Postman示例

 

Python脚本示例

#需要安装requests模块
import requests
 
url = "http://192.168.1.8:8080/api/v3/requests/11/close"
headers = {"authtoken":"7BED0D54-EC1A-4C66-863A-84D0F4FAE6AF"}
input_data = '''{
    "request": {
        "closure_info": {
            "requester_ack_resolution": true,
            "requester_ack_comments": "Mail fetching is up and running now",
            "closure_comments": "Reset the pasword solved the issue",
            "closure_code": {
                "name": "success"
            }
        }
    }
}'''
data = {'input_data'input_data}
response = requests.put(url,headers=headers,data=data,verify=False)
print(response.text)