ドメインが使用できるかどうかを確認するVerify domain availability
適用対象Applies To
- パートナー センターPartner Center
- 21Vianet が運営するパートナー センターPartner Center operated by 21Vianet
- Microsoft Cloud ドイツのパートナー センターPartner Center for Microsoft Cloud Germany
- 米国政府機関向け Microsoft Cloud のパートナー センターPartner Center for Microsoft Cloud for US Government
ドメインが使用可能かどうかを確認する方法。How to determine if a domain is available for use.
前提条件Prerequisites
パートナー センターの認証に関するページで説明している資格情報。Credentials as described in Partner Center authentication. このシナリオでは、スタンドアロンアプリとアプリ + ユーザー資格情報の両方を使用した認証がサポートされています。This scenario supports authentication with both standalone App and App+User credentials.
ドメイン (など
contoso.onmicrosoft.com
)。A domain (for examplecontoso.onmicrosoft.com
).
C#C#
ドメインが使用可能かどうかを確認するには、まず iaggregatepartner.customers を呼び出して、ドメイン操作へのインターフェイスを取得します。To verify if a domain is available, first call IAggregatePartner.Domains to obtain an interface to domain operations. 次に、ドメインで bydomain メソッドを呼び出して確認します。Then call the ByDomain method with the domain to check. このメソッドは、特定のドメインで使用可能な操作に対するインターフェイスを取得します。This method retrieves an interface to the operations available for a specific domain. 最後に、 exists メソッドを呼び出して、ドメインが既に存在するかどうかを確認します。Finally, call the Exists method to see if the domain already exists.
// IAggregatePartner partnerOperations;
// const string domain = "contoso.onmicrosoft.com";
bool result = partnerOperations.Domains.ByDomain(domain).Exists();
サンプル: コンソールテストアプリ。Sample: Console test app. プロジェクト: パートナーセンター SDK サンプル クラス: CheckDomainAvailability.csProject: Partner Center SDK Samples Class: CheckDomainAvailability.cs
REST 要求REST request
要求の構文Request syntax
認証方法Method | 要求 URIRequest URI |
---|---|
矢印HEAD | {baseURL}/v1/domains/{domain} HTTP/1.1{baseURL}/v1/domains/{domain} HTTP/1.1 |
URI パラメーターURI parameter
ドメインの可用性を確認するには、次のクエリパラメーターを使用します。Use the following query parameter to verify domain availability.
名前Name | 種類Type | 必須Required | 説明Description |
---|---|---|---|
領域domain | stringstring | YY | チェック対象のドメインを識別する文字列。A string that identifies the domain to check. |
要求ヘッダーRequest headers
詳細については、「パートナー センター REST ヘッダー」を参照してください。For more information, see Partner Center REST headers.
[要求本文]Request body
なしNone
要求の例Request example
HEAD https://api.partnercenter.microsoft.com/v1/domains/contoso.onmicrosoft.com HTTP/1.1
Authorization: Bearer <token>
Accept: application/json
MS-RequestId: cf5b00d6-9240-431c-a973-cc06c904e5bf
MS-CorrelationId: ec57501a-a4c3-45ee-ab2b-da4250545fc9
X-Locale: en-US
Host: api.partnercenter.microsoft.com
Connection: Keep-Alive
REST 応答REST response
ドメインが存在する場合は使用できず、応答状態コード 200 OK が返されます。If the domain exists, it isn't available for use and a response status code 200 OK is returned. ドメインが見つからない場合は、そのドメインが使用可能であり、応答状態コード "404 が見つかりません" が返されます。If the domain isn't found, it's available for use and a response status code 404 Not Found is returned.
応答の成功とエラーのコードResponse success and error codes
各応答には、成功または失敗を示す HTTP ステータス コードと、追加のデバッグ情報が付属しています。Each response comes with an HTTP status code that indicates success or failure and additional debugging information. このコード、エラーの種類、追加のパラメーターを読み取るには、ネットワーク トレース ツールを使用します。Use a network trace tool to read this code, error type, and additional parameters. 完全な一覧については、パートナー センターの REST エラーコードに関する記事を参照してください。For the full list, see Partner Center REST error codes.
ドメインが既に使用されている場合の応答の例Response example for when the domain is already in use
HTTP/1.1 200 OK
Content-Length: 0
MS-CorrelationId: ec57501a-a4c3-45ee-ab2b-da4250545fc9
MS-RequestId: cf5b00d6-9240-431c-a973-cc06c904e5bf
MS-CV: 7UXAHds8J0mNUCSp.0
MS-ServerId: 201022015
Date: Tue, 31 Jan 2017 22:22:35 GMT
ドメインが使用可能な場合の応答の例Response example for when the domain is available
HTTP/1.1 404 Not Found
Content-Length: 0
MS-CorrelationId: 54770745-17f0-433c-bd7b-0265e5b38f98
MS-RequestId: 1169a4cd-3be7-4e29-9cb3-0f78ffa2e91e
MS-CV: RRmc+bEw9U2e97CC.0
MS-ServerId: 202010406
Date: Tue, 31 Jan 2017 22:36:01 GMT