為客戶取得所有服務要求
適用于:合作夥伴中心 |適用于 Microsoft Cloud for US Government 的合作夥伴中心
取得客戶的所有服務要求。
在合作夥伴中心,您可以先 選取客戶來執行此作業。 然後,選取左側提要欄位上的 [服務管理 ]。 客戶的服務要求會顯示在 [支援票證] 底下。
必要條件
認證,如合作夥伴中心驗證所述。 此案例僅支援使用「應用程式+使用者」認證來進行驗證。
客戶識別碼 (
customer-tenant-id
)。 如果您不知道客戶的識別碼,您可以選取 [客戶] 工作區,然後從客戶清單中選取客戶,然後從客戶清單中查詢該識別碼,然後查閱合作夥伴中心。 在客戶的 [帳戶] 頁面上,尋找 [客戶帳戶資訊] 區段中的 [Microsoft 識別碼] 。 Microsoft 識別碼與客戶識別碼 ()customer-tenant-id
相同。
C#
若要顯示所有客戶服務要求的清單,請使用您的 IAggregatePartner.Customers 集合並呼叫 ById () 方法。 然後呼叫 ServiceRequests 屬性,後面接著 Get () 或 GetAsync () 方法。
// IAggregatePartner partnerOperations;
// string customerId as string;
ResourceCollection<ServiceRequest> serviceRequests = partnerOperations.Customers.ById(customerId).ServiceRequests.Get();
範例: 主控台測試應用程式。 專案:PartnerCenterSDK.FeaturesSamples 類別:CustomerManagedServices.cs
REST 要求
要求的語法
方法 | 要求 URI |
---|---|
GET | {baseURL}/v1/customers/{customer-tenant-id}/servicerequests HTTP/1.1 |
URI 參數
使用下列查詢參數來取得客戶的所有服務要求。
名稱 | 類型 | 必要 | 描述 |
---|---|---|---|
customer-tenant-id | guid | Y | 與客戶對應的 GUID。 |
要求標頭
如需詳細資訊,請參閱合作夥伴中心 REST 標頭。
要求本文
無。
要求範例
GET https://api.partnercenter.microsoft.com/v1/customers/<customer-tenant-id>/servicerequests HTTP/1.1
Authorization: Bearer <token>
Accept: application/json
MS-RequestId: 53d5d48c-9693-46b6-8071-2eed07797d6c
MS-CorrelationId: aaaa0000-bb11-2222-33cc-444444dddddd
REST 回應
如果成功,此方法會在回應本文中傳回 服務要求 資源的集合。
回應成功和錯誤碼
每個回應都隨附 HTTP 狀態碼,會指出成功與否以及其他的偵錯資訊。 請使用網路追蹤工具來讀取此錯誤碼、錯誤類型和其他參數。 如需完整清單,請參閱錯誤碼。
回應範例
HTTP/1.1 200 OK
Content-Length: 742
Content-Type: application/json
MS-CorrelationId: aaaa0000-bb11-2222-33cc-444444dddddd
MS-RequestId: 53d5d48c-9693-46b6-8071-2eed07797d6c
Date: Tue, 24 Nov 2015 07:19:21 GMT
{
"totalCount": 1,
"items": [{
"title": "Test",
"severity": 0,
"id": "615112491169010",
"status": 1,
"primaryContact": {
"lastName": "LastName",
"firstName": "FirstName"
},
"createdDate": "2015-11-24T01:07:00.863",
"lastModifiedDate": "2015-11-24T01:17:10.61",
"lastClosedDate": "0001-01-01T00:00:00",
"attributes": {
"objectType": "ServiceRequest"
}
}],
"attributes": {
"objectType": "Collection"
}
}