更新服务请求

适用于:合作伙伴中心 | Microsoft Cloud for US Government 合作伙伴中心

如何更新云解决方案提供商代表客户向 Microsoft 提交的现有客户服务请求。

在合作伙伴中心,可以通过首先 选择客户来执行此操作。 然后,选择左侧边栏中的“ 服务请求 ”,然后选择有问题的服务请求。 若要完成,请对服务请求进行所需的更改,然后选择“ 提交”。

必备条件

C#

若要更新客户的服务请求,请使用服务请求 ID 调用 IServiceRequestCollection.ById 方法以标识并返回服务请求接口。 然后调用 IServiceRequest.PatchPatchAsync 方法来更新服务请求。 若要提供更新的值,请创建一个新的空 ServiceRequest 对象,并仅设置要更改的属性值。 然后在调用 Patch 或 PatchAsync 方法时传递该对象。

// IAggregatePartner partnerOperations;
// ServiceRequest existingServiceRequest;

ServiceRequest updatedServiceRequest = partnerOperations.ServiceRequests.ById(existingServiceRequest.Id).Patch(new ServiceRequest
{
   NewNote = note
});

示例控制台测试应用项目:合作伙伴中心 SDK 示例 :UpdatePartnerServiceRequest.cs

REST 请求

请求语法

方法 请求 URI
PATCH {baseURL}/v1/servicerequests/{servicerequest-id} HTTP/1.1

URI 参数

使用以下 URI 参数更新服务请求。

名称 类型 必须 说明
servicerequest-id guid Y 标识服务请求的 GUID。

请求标头

有关详细信息,请参阅合作伙伴中心 REST 标头

请求正文

请求正文应包含 ServiceRequest 资源。 唯一必需的值是要更新的值。

请求示例

PATCH https://api.partnercenter.microsoft.com/v1/servicerequests/616122292874576 HTTP/1.1
Authorization: Bearer <token>
Accept: application/json
MS-RequestId: f9a030bd-e492-4c1a-9c70-021f18234981
MS-CorrelationId: fd969070-4e5f-4c6b-a3c6-1941283b39ae
X-Locale: en-US
Content-Type: application/json
Host: api.partnercenter.microsoft.com
Content-Length: 508
Expect: 100-continue

{
    "Id": null,
    "Title": null,
    "Description": null,
    "Severity": "unknown",
    "SupportTopicId": null,
    "SupportTopicName": null,
    "Status": "none",
    "Organization": null,
    "PrimaryContact": null,
    "LastUpdatedBy": null,
    "ProductName": null,
    "ProductId": null,
    "CreatedDate": "0001-01-01T00:00:00",
    "LastModifiedDate": "0001-01-01T00:00:00",
    "LastClosedDate": "0001-01-01T00:00:00",
    "NewNote": {
        "CreatedByName": null,
        "CreatedDate": null,
        "Text": "Sample Note"
    },
    "Notes": null,
    "CountryCode": null,
    "FileLinks": null,
    "Attributes": {
        "ObjectType": "ServiceRequest"
    }
}

REST 响应

如果成功,此方法在响应正文中返回具有更新属性 的服务请求 资源。

响应的成功和错误代码

每个响应都带有一个 HTTP 状态代码,用于指示成功或失败以及其他调试信息。 请使用网络跟踪工具来读取此代码、错误类型和其他参数。 有关完整列表,请参阅 合作伙伴中心 REST 错误代码

响应示例

HTTP/1.1 200 OK
Content-Length: 566
Content-Type: application/json; charset=utf-8
MS-CorrelationId: fd969070-4e5f-4c6b-a3c6-1941283b39ae
MS-RequestId: f9a030bd-e492-4c1a-9c70-021f18234981
MS-CV: rjLONPum/Uq94UQA.0
MS-ServerId: 030011719
Date: Mon, 09 Jan 2017 23:31:15 GMT

{
    "title": "TrialSR",
    "description": "Ignore this SR",
    "severity": "critical",
    "supportTopicId": "32444671",
    "supportTopicName": "Cannot manage my profile",
    "id": "616122292874576",
    "status": "open",
    "organization": {
        "id": "3b33e682-00c3-41ee-9dd2-a548adf56438",
        "name": "TEST_TEST_BugBash1"
    },
    "productId": "15960",
    "createdDate": "2016-12-22T20:31:17.24Z",
    "lastModifiedDate": "2017-01-09T23:31:15.373Z",
    "lastClosedDate": "0001-01-01T00:00:00",
    "notes": [{
            "createdByName": "Account",
            "createdDate": "2017-01-09T23:31:15.373",
            "text": "Sample Note"
        }
    ],
    "attributes": {
        "objectType": "ServiceRequest"
    }
}