将请求从回收站中恢复

将请求从回收站中恢复

API调用URL地址

http://<serverName>:<portNumber>/api/v3/requests/{request_id}/restore_from_trash

其中{request_id}为需要获取摘要信息的请求ID

示例:http://192.168.0.39:8080/api/v3/requests/13/restore_from_trash

请求参数

方法:PUT

请求参数:

参数名

位置

authtoken

<API Key>

header

响应示例

 {

    "request": {
        "ola_due_by_time"null,
        "subject""测试主题2",
        "resolution": {
            "submitted_on": {
                "display_value""13/08/2021 02:47 PM",
                "value""1628837225606"
            },
            "submitted_by": {
                "email_id""test2@test.com",
                "phone""1234455",
                "name""Administrator",
                "mobile""1234567890",
                "is_vipuser"false,
                "id""4",
                "department"null
            },
            "resolution_attachments": [
                {
                    "module""request",
                    "content_type""image/png",
                    "size": {
                        "display_value""437.54KB",
                        "value"448041
                    },
                    "name""电脑.png",
                    "content_url""/api/v3/requests/13/resolution_attachments/301/download",
                    "id""301"
                }
            ],
            "content""<div>解决方法<br /></div><div>1:test1<br /></div><div>2:test2<br /></div><div>3:test3<br /></div>"
        },
        "linked_to_request"null,
        "onhold_time"null,
        "mode": {
            "name""E-Mail",
            "id""1"
        },
        "is_read"false,
        "lifecycle"null,
        "reason_for_cancel"null,
        "assets": [
            {
                "name""ap1",
                "id""301"
            }
        ],
        "is_trashed"false,
        "id""13",
        "assigned_time": {
            "display_value""13/08/2021 02:20 PM",
            "value""1628835631939"
        },
        "group": {
            "site"null,
            "name""Hardware Problems",
            "id""1"
        },
        "requester": {
            "email_id""test1@test.com",
            "phone""8888",
            "name""Guest",
            "mobile""1234567890",
            "is_vipuser"false,
            "id""3",
            "department"null
        },
        "cancel_requested_by"null,
        "email_to": [],
        "sla_violated_technician": {
            "email_id"null,
            "phone""925-852-2602",
            "name""Heather Graham",
            "mobile""",
            "is_vipuser"false,
            "id""6",
            "department"null
        },
        "created_time": {
            "display_value""03/08/2021 03:59 PM",
            "value""1627977556786"
        },
        "item"null,
        "level": {
            "name""Tier 2",
            "id""2"
        },
        "has_resolution_attachments"true,
        "approval_status"null,
        "impact": {
            "name""Low",
            "id""3"
        },
        "service_category"null,
        "sla": {
            "name""Medium SLA",
            "id""3"
        },
        "priority": {
            "color""#ff6600",
            "name""Medium",
            "id""3"
        },
        "created_by": {
            "email_id""test2@test.com",
            "phone""1234455",
            "name""Administrator",
            "mobile""1234567890",
            "is_vipuser"false,
            "id""4",
            "department"null
        },
        "sla_violated_group": {
            "site"null,
            "name""Hardware Problems",
            "id""1"
        },
        "scheduled_end_time"null,
        "tags": [],
        "first_response_due_by_time"null,
        "last_updated_time": {
            "display_value""13/08/2021 02:49 PM",
            "value""1628837398746"
        },
        "has_notes"false,
        "udf_fields": {
            "udf_sline_301""责任人一",
            "udf_sline_302""格式一"
        },
        "impact_details""影响了XX,XX,XX",
        "subcategory": {
            "name""Redhat Linux",
            "id""25"
        },
        "email_cc": [],
        "status": {
            "color""#0066ff",
            "name""Open",
            "id""2"
        },
        "scheduled_start_time"null,
        "template": {
            "is_service_template"false,
            "service_category"null,
            "name""测试模板",
            "id""301"
        },
        "email_ids_to_notify": [],
        "primary_asset": {
            "name""ap1",
            "id""301"
        },
        "request_type": {
            "name""Incident",
            "id""1"
        },
        "cancel_requested_time"null,
        "notification_status"null,
        "description"null,
        "has_dependency"false,
        "has_conversation"false,
        "callback_url"null,
        "chat_type"0,
        "is_service_request"false,
        "urgency": {
            "name""Low",
            "id""4"
        },
        "is_shared"false,
        "cancel_requested"false,
        "has_request_initiated_change"false,
        "request_template_task_ids": [],
        "department"null,
        "is_reopened"true,
        "has_draft"false,
        "has_attachments"false,
        "has_linked_requests"false,
        "is_overdue"true,
        "technician": {
            "email_id"null,
            "phone""925-852-2602",
            "name""Heather Graham",
            "mobile""",
            "is_vipuser"false,
            "id""6",
            "department"null
        },
        "has_request_caused_by_change"false,
        "has_problem"true,
        "due_by_time": {
            "display_value""13/08/2021 04:39 PM",
            "value""1628843942875"
        },
        "has_project"false,
        "is_first_response_overdue"false,
        "cancel_requested_is_pending"false,
        "recommend_template"null,
        "unreplied_count"null,
        "category": {
            "name""Operating System",
            "id""11"
        }
    },
    "response_status": {
        "status_code"2000,
        "status""success"
    }
}

Postman示例

 

Python脚本示例

#Python version - 3.9
#需要安装requests模块
import requests
 
url = "http://192.168.0.39:8080/api/v3/requests/13/restore_from_trash"
headers = {"authtoken":"9E5E6F38-CA0E-4EC9-B7A8-60F7726FC926"}
response = requests.put(url,headers=headers,verify=False)
print(response.text)