修改一个请求信息

修改一个请求信息

API调用URL地址

http://<serverName>:<portNumber>/api/v3/requests/{request_id}
其中{request_id}为被修改请求的id
示例:http://192.168.0.31:8080/api/v3/requests/16

请求参数

方法:PUT

请求参数:

参数名

位置

input_data

<JSON_String>

body

authtoken

<API Key>

header

 

输入示例

 {

    "request":{
        "subject":"Please hold off the issuance of macbook as the employee will be joining late",
        "description":"Hold off issuance of macbook",
        "impact_details":"Routine tasks are pending due to mail server problem",
        "resolution":{
            "content":"Mail Fetching Server problem has been fixed"
        }
,
        "status":{
            "name":"Open"
        }

    }

}
以上为修改主题,描述,影响明细,解决方案,状态。

响应示例

 {

    "request": {
        "ola_due_by_time"null,
        "subject""Please hold off the issuance of macbook as the employee will be joining late",
        "resolution": {
            "submitted_on": {
                "display_value""05/08/2021 04:38 PM",
                "value""1628152684023"
            },
            "submitted_by": {
                "email_id""test2@test.com",
                "phone""1234455",
                "name""Administrator",
                "mobile""1234567890",
                "is_vipuser"false,
                "id""4",
                "department"null
            },
            "resolution_attachments": [],
            "content""Mail Fetching Server problem has been fixed"
        },
        "linked_to_request"null,
        "onhold_time"null,
        "mode"null,
        "is_read"false,
        "lifecycle"null,
        "reason_for_cancel"null,
        "assets": [],
        "is_trashed"false,
        "id""16",
        "assigned_time"null,
        "group"null,
        "requester": {
            "email_id""test2@test.com",
            "phone""1234455",
            "name""Administrator",
            "mobile""1234567890",
            "is_vipuser"false,
            "id""4",
            "department"null
        },
        "cancel_requested_by"null,
        "email_to": [],
        "sla_violated_technician"null,
        "created_time": {
            "display_value""05/08/2021 04:38 PM",
            "value""1628152684023"
        },
        "item"null,
        "level"null,
        "has_resolution_attachments"false,
        "approval_status"null,
        "impact"null,
        "service_category"null,
        "sla"null,
        "priority"null,
        "created_by": {
            "email_id""test2@test.com",
            "phone""1234455",
            "name""Administrator",
            "mobile""1234567890",
            "is_vipuser"false,
            "id""4",
            "department"null
        },
        "sla_violated_group"null,
        "scheduled_end_time"null,
        "tags": [],
        "first_response_due_by_time"null,
        "last_updated_time": {
            "display_value""05/08/2021 05:05 PM",
            "value""1628154327133"
        },
        "has_notes"false,
        "udf_fields": {},
        "impact_details""Routine tasks are pending due to mail server problem",
        "subcategory"null,
        "email_cc": [],
        "status": {
            "color""#0066ff",
            "name""Open",
            "id""2"
        },
        "scheduled_start_time"null,
        "template": {
            "is_service_template"false,
            "name""Default Request",
            "id""1"
        },
        "email_ids_to_notify": [],
        "request_type"null,
        "cancel_requested_time"null,
        "notification_status"null,
        "description""Hold off issuance of macbook",
        "has_dependency"false,
        "has_conversation"false,
        "callback_url"null,
        "chat_type"0,
        "is_service_request"false,
        "urgency"null,
        "is_shared"false,
        "cancel_requested"false,
        "has_request_initiated_change"false,
        "request_template_task_ids": [],
        "department"null,
        "is_reopened"false,
        "has_draft"false,
        "has_attachments"false,
        "has_linked_requests"false,
        "is_overdue"false,
        "technician"null,
        "has_request_caused_by_change"false,
        "has_problem"false,
        "due_by_time"null,
        "has_project"false,
        "is_first_response_overdue"false,
        "cancel_requested_is_pending"false,
        "recommend_template"null,
        "unreplied_count"null,
        "category"null
    },
    "response_status": {
        "status_code"2000,
        "status""success"
    }
}

Postman示例

 

Python脚本示例

#Python version - 3.9
#需要安装requests模块
import requests
 
url = "http://192.168.0.31:8080/api/v3/requests/16"
headers = {"authtoken":"E2E86808-C03A-4E04-8911-CCC2D90ACFD4"}
input_data = '''{
    "request": {
        "subject": "Please hold off the issuance of macbook as the employee will be joining late",
        "description": "Hold off issuance of macbook",
        "impact_details": "Routine tasks are pending due to mail server problem",
        "resolution": {
            "content": "Mail Fetching Server problem has been fixed"
        },
        "status": {
            "name": "Open"
        }
    }
}'''
data = {'input_data'input_data}
response = requests.put(url,headers=headers,data=data,verify=False)
print(response.text)