顧客の資格を非同期的に取得する方法。
前提条件
パートナー センターの認証に関するページで説明している資格情報。 このシナリオでは、スタンドアロン アプリとアプリ + ユーザーの両方の資格情報を使った認証がサポートされています。
顧客 ID です (
customer-tenant-id)。 顧客の ID がわからない場合は、パートナー センターで [顧客] ワークスペースを選び、顧客一覧から顧客を選び、[アカウント] を選んで調べることができます。 顧客の [アカウント] ページで、[顧客アカウント情報] セクションで Microsoft ID を探します。 Microsoft ID は、顧客 ID (customer-tenant-id) と同じです。
C#
顧客の資格を取得するには、IAggregatePartner.Customers.ById メソッドを顧客識別子と共に呼び出します。 次に、Qualification プロパティを使用して、ICustomerQualification インターフェイスを取得します。 最後に、GetQualifications() または GetQualificationsAsync() を呼び出して、顧客の資格を取得します。
// IAggregatePartner partnerOperations;
// string customerId;
var customerQualifications = partnerOperations.Customers.ById(customerId).Qualification.GetQualifications();
サンプル: コンソール サンプル アプリ。 プロジェクト: SdkSamples クラス: GetCustomerQualifications.cs
REST 要求
リクエスト構文
| メソッド | 要求 URI |
|---|---|
| GET | {baseURL}/v1/customers/{customer-tenant-id}/qualifications HTTP/1.1 |
URI パラメーター
次の表に、すべての資格を取得するために必要なクエリ パラメーターを示します。
| 名前 | タイプ | 必須 | 説明 |
|---|---|---|---|
| customer-tenant-id | 糸 | イエス | 顧客を識別する GUID 形式の文字列。 |
要求ヘッダー
詳細については、「パートナー センター REST ヘッダー」を参照してください。
要求本文
なし。
要求の例
GET https://api.partnercenter.microsoft.com/v1/customers/<customer-tenant-id>/qualifications HTTP/1.1
Authorization: Bearer <token>
Accept: application/json
MS-CorrelationId: aaaa0000-bb11-2222-33cc-444444dddddd
MS-RequestId: 037db222-6d8e-4d7f-ba78-df3dca33fb68
REST 応答
成功した場合、このメソッドは応答本文で資格のコレクションを返します。 Education 資格を持つ顧客に対する GET 呼び出しの例を次に示します。
応答の成功とエラー コード
各応答には、成功または失敗を示す HTTP ステータス コードと、追加のデバッグ情報が付属しています。 このコード、エラーの種類、追加のパラメーターを読み取るには、ネットワーク トレース ツールを使用します。 完全な一覧については、パートナー センターの REST エラー コード 参照してください。
応答例
承認
HTTP/1.1 200 OK
Content-Length:
Content-Type: application/json
MS-CorrelationId: aaaa0000-bb11-2222-33cc-444444dddddd
MS-RequestId: 037db222-6d8e-4d7f-ba78-df3dca33fb68
[
{
"qualification": "Education",
"vettingStatus": "Approved",
}
]
レビュー中
HTTP/1.1 200 OK
Content-Length:
Content-Type: application/json
MS-CorrelationId: aaaa0000-bb11-2222-33cc-444444dddddd
MS-RequestId: 037db222-6d8e-4d7f-ba78-df3dca33fb68
[
{
"qualification": "Education",
"vettingStatus": "InReview",
"vettingCreatedDate": "2020-12-03T10:37:38.885Z" // UTC
}
]
拒否する
HTTP/1.1 200 OK
Content-Length:
Content-Type: application/json
MS-CorrelationId: aaaa0000-bb11-2222-33cc-444444dddddd
MS-RequestId: 037db222-6d8e-4d7f-ba78-df3dca33fb68
[
{
"qualification": "Education",
"vettingStatus": "Denied",
"vettingReason": "Not an Education Customer", // example Vetting Reason
"vettingCreatedDate": "2020-12-03T10:37:38.885Z" // UTC
}
]
国有エンティティのサンプル
POST を使用する国有企業のサンプル
//SOE
POST {customer_id}/qualifications
{
"qualification": "StateOwnedEntity"
}
//
GET Qualification を使用する国有企業のサンプル
//SOE:
GET {customer_id}/qualifications
[
{
"qualification": "StateOwnedEntity"
}
]
GET Qualification を Education と合わせて使用する国有企業のサンプル
GET {customer_id}/qualifications
[
{
"qualification": "Education",
"vettingStatus": "Approved"
},
{
"qualification": "StateOwnedEntity"
}
]
GET Qualification を GCC と合わせて使用する国有企業のサンプル
GET {customer_id}/qualifications
[
{
"qualification": "GovernmentCommunityCloud",
"vettingStatus": "Approved",
"vettingCreateDate": "2021-05-06T19:59:56.6832021+00:00"
},
{
"qualification": "StateOwnedEntity"
}
]