顧客の資格を非同期的に更新する
顧客の資格を非同期的に更新します。
パートナーは、顧客の資格を非同期的に "Education"、"GovernmentCommunityCloud" または "StateOwnedEntity" に更新できます。 "None" や "Nonprofit" などの他の値は設定できません。
前提条件
パートナー センターの認証に関するページで説明している資格情報。 このシナリオでは、アプリとユーザーの資格情報を使用した認証のみがサポートされます。
顧客 ID です (
customer-tenant-id
)。 顧客の ID がわからない場合は、パートナー センターで [顧客] ワークスペースを選び、顧客一覧から顧客を選び、[アカウント] を選んで調べることができます。 顧客の [アカウント] ページの [顧客のアカウント情報] セクションで Microsoft ID を探します。 Microsoft ID は、顧客 ID (customer-tenant-id
) と同じです。Government Community Cloud (GCC) の資格の場合のみ:次の詳細な委任された管理者特権 (GDAP) ロールのうち少なくとも 1 つが必要です。 GDAP の詳細については、
GDAP への導入 から始めて、MS Learn の記事を参照してください。- ディレクトリ閲覧者
- ディレクトリ ライター
- ライセンス管理者
- ユーザー管理者
C#
"Education" の顧客の資格を作成するには、まず、 CustomerQualificationRequest
型オブジェクトを作成し、 Education
修飾の種類と EducationSegment
を Website
(省略可能) と共に指定します。
次に、顧客識別子を使用して IAggregatePartner.Customers.ById メソッドを呼び出します。
次に、 Qualification プロパティを使用して、 ICustomerQualification インターフェイスを取得します。
最後に、CustomerQualificationRequest
型オブジェクトを入力パラメーターとして使用して、CreateQualifications()
またはCreateQualificationsAsync()
を呼び出します。
// Education
var eduRequestBody = new CustomerQualificationRequest
{
Qualification = "Education",
EducationSegment = "K12", // could also be "HigherEducation"
Website = "example.edu"
};
var eduCustomerQualification = partnerOperations.Customers.ById(existingCustomer.Id).Qualification.CreateQualifications(eduRequestBody);
// State Owned Entity
var soeRequestBody = new CustomerQualificationRequest
{
Qualification = "StateOwnedEntity"
};
var soeCustomerQualification = partnerOperations.Customers.ById(existingCustomer.Id).Qualification.CreateQualifications(soeRequestBody);
サンプル: Console サンプル アプリ。 Project: SdkSamples Class: CreateCustomerQualification.cs
顧客の資格を更新して、資格のない既存の顧客の GovernmentCommunityCloud に更新するには、パートナーも顧客の検証コードを含める必要があります。
まず、 CustomerQualificationRequest
型オブジェクトを作成し、 GovernmentCommunityCloud
修飾型と検証コードを指定します。
次に、顧客識別子を使用して IAggregatePartner.Customers.ById メソッドを呼び出します。
次に、 Qualification プロパティを使用して、 ICustomerQualification インターフェイスを取得します。
最後に、CustomerQualificationRequest
型オブジェクトを入力パラメーターとして使用して、CreateQualifications()
またはCreateQualificationsAsync()
を呼び出します。
var gccRequestBody = new CustomerQualificationRequest
{
Qualification = "GovernmentCommunityCloud",
ValidationCode = "<validation code>"
};
var gccCustomerQualification = partnerOperations.Customers.ById(existingCustomer.Id).Qualification.CreateQualifications(gccRequestBody);
サンプル: Console サンプル アプリ。 Project: SdkSamples Class: CreateCustomerQualificationWithGCC.cs
REST 要求
要求の構文
認証方法 | 要求 URI |
---|---|
投稿 | {baseURL}/v1/customers/{customer_tenant_id}/qualifications HTTP/1.1 |
URI パラメーター
修飾を更新するには、次のクエリ パラメーターを使用します。
名前 | タイプ | Required | 説明 |
---|---|---|---|
customer-tenant-id | GUID | はい | この値は、GUID 形式の customer-tenant-id で、これによってリセラーは、リセラーに属する特定の顧客の結果をフィルター処理できます。 |
要求ヘッダー
詳細については、「パートナー センター REST ヘッダー」を参照してください。
要求本文
次の表では、要求本文の修飾オブジェクトについて説明します。
プロパティ | タイプ | Required | 説明 |
---|---|---|---|
認定 | string | はい | CustomerQualification 列挙型の文字列値。 |
次の表では、 Education Qualification の要求本文について具体的に説明します。
プロパティ | タイプ | Required | 説明 |
---|---|---|---|
認定 | string | はい | Education |
EducationSegment | string | はい | K12、HigherEducation |
Web サイト | string | いいえ | 教育エンティティの Web サイト |
修飾が Education 用の場合Education セグメントは必須フィールドです。
- EducationSegment に使用できる値は K12 および HigherEducation です。
- Web サイトは省略可能なフィールドのままであり、資格が教育機関向けである場合にのみ関連します。 ただし、使用可能な場合や該当する場合は、それを含めておくことを強くお勧めします
次の表では、 GovernmentCommunityCloud Qualification の要求本文について具体的に説明します。
プロパティ | タイプ | Required | 説明 |
---|---|---|---|
認定 | string | はい | GovernmentCommunityCloud |
ValidationCode | string | はい | パートナーの GCC 検証コード。 例 - 123456 |
修飾が GovernmentCommunityCloud の場合ValidationCode は必須フィールドです。
要求の例
POST https://api.partnercenter.microsoft.com/v1/customers/<customer-tenant-id>/qualifications HTTP/1.1
Accept: application/json
Content-Type: application/json
MS-CorrelationId: aaaa0000-bb11-2222-33cc-444444dddddd
MS-RequestId: 037db222-6d8e-4d7f-ba78-df3dca33fb68
// SOE
{
"qualification": "StateOwnedEntity"
}
// Education
{
"qualification": "Education",
"educationSegment": "HigherEducation", // could also be "K12"
"website": "contoso.edu"
}
// GCC
{
"qualification": "GovernmentCommunityCloud",
"validationCode": "123456"
}
REST 応答
成功した場合、このメソッドは応答本文で修飾オブジェクトを返します。 次に示すPOSTEducation資格を持つ顧客 (以前のNone) に対する呼び出しの例を示します。
応答の成功とエラーのコード
各応答には、成功または失敗とその他のデバッグ情報を示す HTTP 状態コードが付属しています。 このコード、エラーの種類、追加のパラメーターを読み取るには、ネットワーク トレース ツールを使用します。 完全な一覧については、エラー コードに関するページを参照してください。
応答の例
HTTP/1.1 201 CREATED
Content-Length: 29
Content-Type: application/json
MS-CorrelationId: aaaa0000-bb11-2222-33cc-444444dddddd
MS-RequestId: 037db222-6d8e-4d7f-ba78-df3dca33fb68
{
"qualification": "Education",
"vettingStatus": "InReview",
"vettingCreateDate": "2020-12-04T20:54:24Z" // UTC
}