Google Code が利用できる言語: English - Español - 日本語 - 한국어 - Português - Pусский - 中文(简体) - 中文(繁體)
最終更新日: 2007年8月7日 (最近の更新履歴)
Google Apps を使用すると、ウェブサイト管理者は Gmail などのさまざまな個人向け Google アプリケーションの独自ドメイン バージョンをユーザーに提供することができます。このドキュメントで説明する Google Apps Provisioning API は、Google パートナーがプログラムを通じてこのようなアプリケーションにアクセスするために使用されます。この API は、特にユーザー アカウント、ニックネーム、メーリング リストの作成、取得、更新、削除のための機能を提供します。
このバージョンの Provisioning API は、Google Data API の原則に従っています。また、Atom 1.0 と RSS 2.0 の 2 つのシンジケーション フォーマットと、Atom Publishing Protocol に基づいています。Google Data API の詳細をご覧ください。
注: Provisioning API を使用できるのは、Google Apps Premier Edition と Google Apps Education Edition のパートナーのみです。API を使用するには、管理者アカウントでログインして、[ユーザー アカウント] タブをクリックします。次に、[設定] サブタブをクリックし、Provisioning API を有効化するチェックボックスをオンにして、変更を保存します (管理者アカウントでログインする前に、Google Apps の設定の手順を終了させる必要があります)。
(Google は、既に Provisioning API バージョン 1.0 を導入済みのパートナーへのサポートを継続しますが、新規パートナーはバージョン 2.0 の API を導入してください)
このドキュメントには次のセクションがあります。
API の処理では、Provisioning API からアクセスできるさまざまなタイプの機能を紹介します。
認証では、すべての API リクエストに必要な認証プロセスについて説明します。
API の動作では、さまざまなタイプの API リクエスト、各リクエストの XML フォーマット、各リクエストに対する API の XML レスポンスのフォーマットについて説明します。これらのセクションでは、全体として API の XML リクエストの構築方法と XML レスポンスの処理方法を説明します。
Java クライアント ライブラリの使用では、API の XML リクエストを作成し、適切な URL に送信して、リクエストに対する API レスポンスを処理する Google Apps Java クライアント ライブラリについて説明します。言い換えれば、このセクションでは API の動作のセクションで説明した処理を実行するための Java クライアント ライブラリの使用方法を説明します。
.NET クライアント ライブラリの使用では、以下で説明する処理を実行するための .NET クライアント ライブラリの使用方法を説明します。
Python クライアント ライブラリの使用では、以下で説明する処理を実行するための Python クライアント ライブラリの使用方法を説明します。
補足情報では、Google Apps を使用するためのドメイン設定に関する背景情報を提供します。また、ここで論じられている XML ドキュメントについて、さらに詳しく説明します。
API を使用するには、ドメイン内のリソースに対する作成、取得、更新、削除処理を実行するように指示する HTTP リクエストを Google に送信します。リソースとは、ユーザー アカウント、ニックネーム、メーリング リストです。
このセクションでは、API がサポートするさまざまなタイプの処理について説明します。以下のAPI の動作のセクションでは、各 API 処理に対応する URL を示します。注: 以下のリンクは、関連の Java クライアント ライブラリ メソッドを示すものです。その他のクライアント ライブラリでも、同等のメソッドが提供されています。
作成処理では、新規のユーザー アカウント、ニックネーム、メーリング リストを追加できます。また、作成リクエストで、特定のメーリング リストにメールアドレスを追加することもできます。これらのいずれかの処理を実行するには、適切な URL に対する HTTP POST リクエストを発行します。POST リクエストのボディは、作成するリソースの情報を含む XML ドキュメントです。
取得処理では、ユーザー アカウント、ニックネーム、メーリング リストに関する情報をリクエストし、取得することができます。これらのいずれかのリソースについての情報を取得するには、適切な URL に対する HTTP GET リクエストを発行します。URL には、要求されたリソースを識別する情報が含まれます。
更新処理では、ユーザー アカウントに関する情報を変更できます。ユーザー アカウントを更新するには、適切な URL に対する HTTP PUT リクエストを発行します。PUT リクエストのボディは、更新するリソースに関する情報を含む XML ドキュメントです。API は、次のタイプの更新をサポートします。
注: API はニックネームまたはメーリング リストの更新をサポートしません。ニックネームまたはメーリング リストを更新するには、古いエンティティを削除して、代わりに新しいエンティティを作成します。メーリング リストの登録者リストを更新するには、メーリング リスト受信者を作成または削除する API リクエストを使用する必要があります。
削除処理では、ユーザー アカウント、ニックネーム、メーリング リストを削除することができます。また、削除リクエストで、メーリング リストからメール アドレスを削除することもできます。これらのいずれかの処理を実行するには、適切な URL に対する HTTP DELETE リクエストを発行します。URL には、削除するリソースを識別する情報が含まれます。
注: アカウントを削除すると、少なくとも 5日間、同じユーザー名を持つアカウントを作成することができません。
Google では、すべての作成、更新リクエストに、必要なすべてのデータ フィールド、認証要件などを満たす有効な XML が含まれていることを検証します。
API リクエストは、すべて HTTPS 経由で送信する必要があります。送信する API リクエストには、それぞれ認証トークンが含まれている必要があります。Google はこれを使用して、API リクエストで指定された処理へのアクセスを認証します。認証トークンを使用できるのは、ドメインの管理権限を持つユーザーのみです。また、これらのトークンはドメイン内の処理のみを認証します。
ClientLogin インターフェースでは、プログラムによるユーザー アカウントへのログインについての追加情報を提供します。
認証トークンを取得するには、次の URL に HTTP POST リクエストを送信します。
リクエストには次のガイドラインが適用されます。
POST のボディには、次の形式の文字列を含める必要があります。
この文字列を、次のように変更します。
<email_address> には管理者アカウントのメール アドレスを指定します。
<password> にはそのアカウントのパスワードを指定します。
メール アドレスとパスワードの値は、URL エンコードする必要があります。たとえば、メール アドレス apps.test.account@example.com を URL エンコードすると、apps%2Etest%2Eaccount%40example%2Ecom となります。
POST リクエストの Content-Type ヘッダーには、値 application/x-www-form-urlencoded を指定する必要があります。
Google は、POST リクエストへのレスポンスに認証トークンを含めます。認証トークンはそのページの Auth 値です。このページからトークンを抽出してください。API リクエストを送信するときは、次の例に示すように、Content-type と Authorization ヘッダーを設定する必要があります。
Content-type: application/atom+xml Authorization: GoogleLogin auth=your-authentication-token
注: 認証トークンは 24 時間経過すると無効になります。上記の URL に、最低でも 24 時間に 1 回はリクエストを送信してください。トークンはファイルに書きだすのではなく、メモリに記憶しておくことをおすすめします。認証トークンの取得に際して CAPTCHA 入力を求められた場合の対処方法については、よくある質問をご覧ください。
次の Perl スクリプトは、認証トークンを要求する HTTP POST リクエストの作成方法を示すものです。
#! /usr/bin/perl -w use strict; use LWP::UserAgent; # Create an LWP object to make the HTTP POST request my $lwp_object = LWP::UserAgent->new; # Define the URL to submit the request to my $url = 'https://www.google.com/accounts/ClientLogin'; # Submit the request with values for the Email, Passwd, # accountType and service variables. my $response = $lwp_object->post( $url, [ 'accountType' => 'HOSTED', 'Email' => 'admin_email@example.com', 'Passwd' => 'admin_password', 'service' => 'apps' ] ); die "$url error: ", $response->status_line unless $response->is_success; # Extract the authentication token from the response my $auth_token; foreach my $line (split/\n/, $response->content) { if ($line =~ m/^Auth=(.+)$/) { $auth_token = $1; last; } } print "authentication token is $auth_token\n";
このコードを使うには、Email と Passwd の値に、ホストされている管理者アカウントのメールアドレスとパスワードを指定します。
API を使用して処理を実行するには、実行する処理に対応する URL に HTTP POST、GET、PUT、DELETE リクエストを送信する必要があります。各 URL にはドメインが指定されます。作成、取得、更新、削除を行うリソースを識別する変数が含まれることもあります。たとえば、www.example.com ドメインの us-sales メーリング リストについての情報を取得するには、次の URL に HTTP GET リクエストを送信します。
https://www.google.com/a/feeds/www.example.com/emailList/2.0/us-sales
以下の項の表に、各 API 処理に対する URL を示します。また、各 API 処理に対する HTTP リクエストのタイプも示します。
作成リクエストと更新リクエスト (POST と PUT) を成功させるには、必ず必要な情報を含む XML ドキュメントを送信する必要があるということにも注意してください。コンテンツは、application/atom+xml コンテンツ タイプで送信する必要があります。これらの XML 構造については、表の下の XML リクエストのフォーマットのセクションで説明します。
次の表では、変数を太字の青い文字で強調表示しています。
| 処理 | HTTP リクエスト タイプと URL |
|---|---|
| ユーザー アカウントの作成 | POST https://www.google.com/a/feeds/{domain}/user/2.0 |
| ユーザー アカウントの取得 | GET https://www.google.com/a/feeds/{domain}/user/2.0/{userName} |
| ドメイン内の全ユーザーの取得 | GET https://www.google.com/a/feeds/{domain}/user/2.0 |
| ユーザー アカウントの更新 | PUT https://www.google.com/a/feeds/{domain}/user/2.0/{userName} |
| ユーザー アカウントの削除 | DELETE https://www.google.com/a/feeds/{domain}/user/2.0/{userName} |
| 処理 | HTTP リクエスト タイプと URL |
|---|---|
| ニックネームの作成 | POST https://www.google.com/a/feeds/{domain}/nickname/2.0 |
| ニックネームの取得 | GET https://www.google.com/a/feeds/{domain}/nickname/2.0/{nickname} |
| 特定のユーザーの全ニックネームの取得 | GET https://www.google.com/a/feeds/{domain}/nickname/2.0?username={userName} |
| ドメイン内の全ニックネームの取得 | GET https://www.google.com/a/feeds/{domain}/nickname/2.0 |
| ニックネームの削除 | DELETE https://www.google.com/a/feeds/{domain}/nickname/2.0/{nickname} |
| 処理 | HTTP リクエスト タイプと URL |
|---|---|
| メーリング リストの作成 | POST https://www.google.com/a/feeds/{domain}/emailList/2.0 |
| メーリング リストの取得 | GET https://www.google.com/a/feeds/{domain}/emailList/2.0/{emailListName} |
| 特定のメールアドレスが登録されている全メーリング リストの取得 | GET https://www.google.com/a/feeds/{domain}/emailList/2.0?recipient={emailAddress} |
| ドメイン内の全メーリング リストの取得 | GET https://www.google.com/a/feeds/{domain}/emailList/2.0 |
| メーリング リストの削除 | DELETE https://www.google.com/a/feeds/{domain}/emailList/2.0/{emailListName} |
| 処理 | HTTP リクエスト タイプと URL |
|---|---|
| メーリング リストへのアドレス追加 | POST https://www.google.com/a/feeds/{domain}/emailList/2.0/{emailListName}/recipient/ |
| メーリング リストの全登録者の取得 | GET https://www.google.com/a/feeds/{domain}/emailList/2.0/{emailListName}/recipient/ |
| メーリング リストからのアドレス削除 | DELETE https://www.google.com/a/feeds/{domain}/emailList/2.0/{emailListName}/recipient/{emailAddress} |
情報を作成または更新する API リクエスト (HTTP POST、PUT リクエスト) では、ボディはリクエストを完了させるために必要なデータを含む XML ドキュメントでなければなりません。情報を取得または削除する API リクエスト (HTTP GET、DELETE リクエスト) では、URL と HTTP リクエスト タイプに Google がリクエストを完了させるために必要な情報がすべて指定されていなければなりません。
次の項では、ユーザー アカウント、ニックネーム、メーリング リスト、メーリング リスト受信者を作成する XML リクエストの例を示します。ユーザー アカウントを作成する XML リクエストは、ユーザー アカウントの更新にも使用できます (ニックネーム、メーリング リスト、メーリング リスト受信者は作成、取得、削除のみが可能で更新はできません)。
クライアント ライブラリを使用しているパートナー様へ: クライアント ライブラリは、これらの XML 構造を自動的に作成、送信するメソッドを提供します。次の XML サンプルを確認していただくことをお勧めしますが、Java クライアント ライブラリによる API リクエスト送信、.NET クライアント ライブラリによる API リクエスト送信、Python クライアント ライブラリによる API リクエスト送信のセクションでは、直接 XML を操作せずに、クライアント ライブラリを使用して API リクエストを送信し、API レスポンスを処理する方法を説明しています。
次の XML は、ユーザーを作成するためのサンプル リクエストを示しています。この XML は、ユーザー アカウントの更新にも使用できます。なお、<apps:quota> を使用してユーザーのディスク容量の割り当てを設定する機能は、すべてのパートナーに提供されているものではありません。ドメインでこの機能を使用できるかどうかについては、パートナー契約をご覧ください。パートナーが設定するフィールドは、すべて太字で示されています。
注: この XML フォーマットには、クライアント ライブラリで UserEntry オブジェクトに格納できるデータがすべて含まれています。
<?xml version="1.0" encoding="UTF-8"?> <atom:entry xmlns:atom="http://www.w3.org/2005/Atom" xmlns:apps="http://schemas.google.com/apps/2006"> <atom:category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/apps/2006#user"/> <apps:login userName="SusanJones-1321" password="123$$abc" suspended="false"/> <apps:quota limit="2048"/> <apps:name familyName="Jones" givenName="Susan"/> </atom:entry>
ユーザー アカウントの作成と更新のリクエストに同じ XML フォーマットが使用されても、これらのリクエストはいくつかの点で異なります。
ユーザーを作成するリクエストには、<apps:name> タグと属性 (familyName と givenName) が必要です。ユーザーを更新するリクエストには、ユーザーの姓または名前を更新するリクエストでない限り、このタグと属性を含める必要はありません。
ユーザーを作成するリクエストには <apps:login> タグが必要です。また、リクエストでは username と password 属性の値を指定する必要があります。ユーザーを更新するリクエストには、<apps:login> タグを含める必要はありません。なお、ユーザーのパスワードを更新するのでない限り、<apps:login> タグの password 属性の値を指定しないでください。
通常、<apps:login> タグの suspended 属性は更新リクエストのみに使用されます (デフォルトでは、新規作成されたアカウントは有効)。
次の XML は、ニックネームを作成するためのサンプル リクエストを示しています。この XML は <apps:nickname> タグでニックネームを指定し、<apps:login> タグでニックネームを割り当てるユーザーを指定します。パートナーが設定するフィールドは、太字で示されています。
注: この XML フォーマットには、クライアント ライブラリで NicknameEntry オブジェクトに格納できるデータがすべて含まれています。
<?xml version="1.0" encoding="UTF-8"?> <atom:entry xmlns:atom="http://www.w3.org/2005/Atom" xmlns:apps="http://schemas.google.com/apps/2006"> <atom:category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/apps/2006#nickname"/> <apps:nickname name="Susy-1321"/> <apps:login userName="SusanJones-1321"/> </atom:entry>
次の XML は、メーリング リストを作成するためのサンプル リクエストを示しています。この XML は <apps:emailList> タグでメーリング リストの名前を指定します。パートナーが設定するフィールドは、太字で示されています。
注: この XML フォーマットには、クライアント ライブラリで EmailListEntry オブジェクトに格納できるデータがすべて含まれています。
<?xml version="1.0" encoding="UTF-8"?> <atom:entry xmlns:atom="http://www.w3.org/2005/Atom" xmlns:apps="http://schemas.google.com/apps/2006"> <atom:category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/apps/2006#emailList"/> <apps:emailList name="us-sales"/> </atom:entry>
新規に作成されたメーリング リストには、登録者は含まれていません。この後は、さらに XML またはクライアント ライブラリ (Java、.NET、Python) を使用してメーリング リストに受信者を追加する方法について説明します。
次の XML は、メーリング リストにメール アドレスを登録するためのサンプル リクエストを示しています。この XML は、<gd:who> タグで追加するメール アドレスを指定します。パートナーが設定するフィールドは、太字で示されています。
注: この XML フォーマットには、クライアント ライブラリで EmailListRecipientEntry オブジェクトに格納できるデータがすべて含まれています。
<?xml version="1.0" encoding="UTF-8"?> <atom:entry xmlns:atom="http://www.w3.org/2005/Atom" xmlns:apps="http://schemas.google.com/apps/2006" xmlns:gd='http://schemas.google.com/g/2005"> <atom:category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/apps/2006#emailList.recipient"/> <gd:who xmlns="http://schemas.google.com/g/2005" email="SusanJones-6389@example.com"/> </atom:entry>
Google Apps Provisioning API は、API リクエストに基づいて 10 種類のレスポンスのいずれかを返します。以下に、レスポンスの種類とそのレスポンスを生成させる API リクエストの説明を示します。補足情報 C では、上から 9 番目までのレスポンスについて、それぞれの XML サンプルを示します (10 番目のレスポンス タイプは、XML を使用しません)。
注: 個別のレスポンス タイプの定義に使用する用語は、クライアント ライブラリで使用されるオブジェクト名に従います。たとえば、次のリストの UserEntry レスポンスは、単一のユーザーについての情報を含む XML ドキュメントとして定義されます。クライアント ライブラリは、この XML レスポンスを UserEntry オブジェクトに変換します。
UserEntry レスポンスには単一のユーザーについての情報が含まれます。ユーザーを作成、取得、更新、停止、復元、再開する API リクエストは、すべて UserEntry レスポンスを生成させます。
UserFeed レスポンスには、1 つまたは複数の一連の UserEntry XML 構造が含まれ、それぞれに単一ユーザーについての情報が含まれています。UserFeed レスポンスを生成する API リクエストは、ドメインの全ユーザー取得のリクエストのみです。
NicknameEntry レスポンスには、単一のニックネームについての情報が含まれます。これにより、ニックネームと、そのニックネームを割り当てるユーザーが示されます。ニックネームを作成する API リクエスト、取得する API リクエストは、いずれも NicknameEntry レスポンスを生成させます。
NicknameFeed レスポンスには、1 つまたは複数の一連の NicknameEntry XML 構造が含まれ、それぞれによってニックネームと、そのニックネームを割り当てるユーザーが示されます。ドメインの全ニックネームを取得する API リクエスト、特定ユーザーに割り当てられている全ニックネームを取得する API リクエストは、いずれも NicknameFeed レスポンスを生成させます。
EmailListEntry レスポンスには、単一のメーリング リストについての情報と、そのメーリング リストの受信者のリストを取得するリンクが含まれます。メーリングリストを作成する API リクエスト、取得する API リクエストは、いずれも EmailListEntry レスポンスを生成させます。
EmailListFeed レスポンスには、1 つまたは複数の一連の EmailListEntry レスポンスが含まれます。ドメインの全メーリング リストを取得する API リクエスト、特定ユーザーが受信する全メーリング リストを取得する API リクエストには、いずれも EmailListFeed レスポンスが返されます。
EmailListRecipientEntry レスポンスは、特定のメーリング リストに登録されている個別のユーザーを示します。メーリング リストに受信者を追加する API リクエストは、EmailListRecipientEntry レスポンスを生成させます。
EmailListRecipientFeed レスポンスには、1 つまたは複数の一連の EmailListRecipientEntry レスポンスが含まれ、それぞれによって特定のメーリング リストに登録しているユーザーが示されます。特定のメーリング リストの全受信者を取得する API リクエストは、EmailListRecipientFeed レスポンスを生成させます。
無効な API リクエストに対しては、API によってエラー の XML レスポンスが返されます。すべての API リクエストに、エラー レスポンスを発生させる可能性があります。レスポンスでは、<error> タグの値によって API リクエストが無効である理由が示されます。Java クライアント ライブラリと Python クライアント ライブラリは、Provisioning API からエラー レスポンスを受け取ると、AppsForYourDomainException を返します。.NET クライアント ライブラリは、AppsException オブジェクトを返します。このオブジェクトにはエラー情報が含まれます。また、クライアント ライブラリはエラーのタイプによって異なる例外をスローします。詳しくは、「API レスポンスに含まれるエラーの識別」のセクション (Java、.NET、Python) の説明をご覧ください。
HTTP DELETE リクエストが成功すると、いずれの場合も API から HTTP 200 レスポンス コードが返されます。これにはユーザー アカウント、ニックネーム、メーリング リストの削除と、メーリング リストからの受信者の削除が含まれます。
9 タイプの XML レスポンスのサンプルを補足情報 C - サンプル XML レスポンスに示します (最後の HTTP 200 レスポンス コードは、XML を使用しません)。
API リクエストによって UserFeed、NicknameFeed、EmailListFeed、EmailListRecipientFeed レスポンスが発生した場合、Provisioning API は最大 100 個のエントリを含む Atom XML フィードを返します。フィードに 100 を超えるエントリがある場合、API レスポンスには rel 属性が next となっている <atom:link> タグが含まれます。この <atom:link> タグの URL は、リクエストに対する結果の続きのページを指します。
以下の XML の抜粋では、結果の続きのページを示す <atom:link> タグを太字で強調してあります。
<?xml version="1.0" encoding="UTF-8"?> <atom:id> http://www.google.com/a/feeds/example.com/emailList/2.0 </atom:id> <atom:category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/apps/2006#emailList"/> <atom:title type="text">EmailLists</atom:title> <atom:link rel="next" type="application/atom+xml" href="http://www.google.com/a/feeds/example.com/emailList/2.0?startEmailListName=eng"/> <atom:link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://www.google.com/a/feeds/example.com/emailList/2.0"/> ...
全ユーザー、全ニックネーム、全メーリング リスト、メーリング リストの全受信者のいずれかを取得するリクエストが完了するまでの時間は、取得されるデータの量に直接関係します。たとえば、メーリング リストの登録者が 100 人ならば、クライアント ライブラリは 1 つの HTTP リクエストで全登録者のリストを取得できます。しかし、メーリング リストの登録者が 1,000 人の場合は、全登録者のリストを取得するために 10 の HTTP リクエストを作成しなければなりません。
Java、.NET、または Python クライアント ライブラリを使用しているのであれば、コードによって結果の追加ページを明示的に要求するか、またはすべての結果が得られるまで追加の結果を自動的に要求するかを選択できます。たとえば、retrievePageOfUsers メソッドで最大 100 ユーザーまでの HTTP リクエストを 1 つ作成し、retrieveAllUsers メソッドですべての結果が得られるまで追加の HTTP リクエストを自動的に発行することができます。
API レスポンスを処理するコードを自分で作成する場合は、必要に応じて結果の追加ページを要求するようなコードを作成する必要があります。
Google Apps を設定するには、ドメインの管理者アカウントとして機能する Google アカウントを作成する必要があります。既存の Google アカウントを使用することも可能です。ただし、アカウントの所有者はドメインのユーザー アカウントを作成、更新、削除できることになるので、個人の Google アカウントを使用するのではなく、新しい Google アカウントを作成することをお勧めします。
以下に、Google Apps を設定する手順を説明します。
Google Apps のホームページにアクセスし、説明に従って Google Apps Premier Edition (企業向け) または Google Apps Education Edition (教育機関向け) にサインアップします。
ドメイン名を入力します。または、新規ドメインの購入を指定します。新規ドメインを購入する場合は、次の手順に進む前に新規ドメインの登録フォームに入力する必要があります。
フォームに、所属組織と自分自身についての情報を入力します。

次のページのフォームに、購入するユーザー アカウントの数を指定して、利用規約に同意します。

Google Checkout を使用して、登録処理を終了します。

フォームに入力して、管理者アカウントを設定します。

説明に従って、ドメインの所有を確認します。
管理者アカウント用のメール アドレスとパスワードを使用して、ドメインの認証トークンを要求します。認証トークンは、Google に送信するすべての API リクエストに含まれて送信され、Google はその API リクエストの実行を認証するために認証トークンを使用します。
この補足情報では、Provisioning API リクエストとレスポンスで使用される XML タグの定義を説明します。
下記の定義では、サブタグの横に記号が表示されている場合があります。これらの記号は、それぞれ次のような意味があります。
| atom:feed | |
|---|---|
| 定義 | <atom:feed> タグは、特定のアカウントに関連する全ニックネームの取得、または特定のアカウントで登録している全メーリング リストの取得のリクエストに対する API レスポンスをカプセル化します。 |
| 例 | <atom:feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/"> |
| サブタグ | atom:id、atom:category、atom:link、openSearch:startIndex、openSearch:itemsPerPage、atom:entry |
| コンテンツ フォーマット | コンテナ |
| atom:entry | |
|---|---|
| 定義 | <atom:entry> タグは、API リクエストまたは API Atom レスポンスをカプセル化します。 |
| サブタグ | atom:id、atom:category、atom:title、atom:link、apps:login、apps:name、gd:feedLink、gd:who |
| コンテンツ フォーマット | コンテナ |
| atom:category | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 定義 | <atom:category> タグは、Atom リクエストまたはレスポンスに記述されるリソースのタイプを示します。 |
|||||||||||||||||
| 属性 |
|
|||||||||||||||||
| 上位のタグ | atom:entry | |||||||||||||||||
| コンテンツ フォーマット | 空 | |||||||||||||||||
| atom:title | |||||||
|---|---|---|---|---|---|---|---|
| 定義 | <atom:title> タグの値は、API レスポンスを示します。 |
||||||
| 属性 |
|
||||||
| 例 | <atom:title type="text">SusanJones-1321</atom:title> | ||||||
| 上位のタグ | atom:entry | ||||||
| コンテンツ フォーマット | 複合 | ||||||
| atom:id | |
|---|---|
| 定義 | <atom:id> タグの値は、フィードの恒久的でユニークな識別子を示します。このタグは API レスポンスに含まれます。また、ユーザー アカウント更新のリクエストにも含まれます。このタグを API リクエストに含めるときは、タグの値として API リクエストの送信先 URL を設定する必要があります。 |
| 例 | <atom:id>http://www.google.com/a/feeds/example.com/emailList/2.0/us-sales</atom:id> |
| 上位のタグ | atom:entry |
| コンテンツ フォーマット | 文字列 (IRI) |
| atom:link | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| 定義 | <atom:link> タグは、API 結果フィードまたはフィード内のリソースに関連する IRI リファレンスを提供します。 |
|||||||||
| 属性 |
|
|||||||||
| 例 | <atom:link rel="edit" type="application/atom+xml" href="http://www.google.com/a/feeds/example.com/emailList/2.0/us-sales"/> | |||||||||
| 上位のタグ | atom:entry | |||||||||
| コンテンツ フォーマット | 空 | |||||||||
| atom:updated | |
|---|---|
| 定義 | <atom:updated> タグは、Atom フィードに含まれるエントリが更新された日時を示します。Provisioning API のレスポンスにはこのタグが含まれるので、レスポンスは Atom の仕様に準拠しています。ただし、Provisioning API では、<atom:updated> タグの値は常に 1970年の日付となり、値は機能しません。 |
| 例 | <atom:updated>1970-01-01T00:00:00.000Z</atom:updated> |
| 上位のタグ | atom:feed、atom:entry |
| コンテンツ フォーマット | 日付 |
| apps:emailList | |||||||
|---|---|---|---|---|---|---|---|
| 定義 | <apps:emailList> タグは、メーリング リストを示します。 |
||||||
| 属性 |
|
||||||
| 例 | <apps:emailList name="us-sales"/> | ||||||
| 上位のタグ | atom:entry | ||||||
| コンテンツ フォーマット | 複合 | ||||||
| apps:login | |||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 定義 | <apps:login> タグはユーザー アカウントに関連するユーザー名を示します。パスワードを示すこともあります。 |
||||||||||||||||||||||||
| 属性 |
|
||||||||||||||||||||||||
| 例 | <apps:login userName="SusanJones" suspended="false" admin="false" changePasswordAtNextLogin="false" agreedToTerms="true"/> | ||||||||||||||||||||||||
| 上位のタグ | atom:entry | ||||||||||||||||||||||||
| コンテンツ フォーマット | 複合 | ||||||||||||||||||||||||
| apps:name | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| 定義 | <apps:name> タグは、アカウント所有者の姓と名を示します。姓と名に使用できる文字はスペース、英文字 (a~z)、数字 (0~9)、ダッシュ (-)、スラッシュ (/)、ピリオド (.) です。 |
|||||||||
| 属性 |
|
|||||||||
| 例 | <apps:name familyName="Jones" givenName="Susan"/> | |||||||||
| 上位のタグ | atom:entry | |||||||||
| コンテンツ フォーマット | 複合 | |||||||||
| apps:nickname | |||||||
|---|---|---|---|---|---|---|---|
| 定義 | <apps:nickname> タグは、ニックネームを示します。 |
||||||
| 属性 |
|
||||||
| 例 | <apps:nickname name="Jones"/> | ||||||
| 上位のタグ | atom:entry | ||||||
| コンテンツ フォーマット | 複合 | ||||||
| apps:quota | |||||||
|---|---|---|---|---|---|---|---|
| 定義 | <apps:quota> タグは、ユーザー アカウントに割り当てられるディスク容量を示します。Google では、ユーザー アカウントにデフォルトで 2 GB のディスク容量が割り当てられます。
|
||||||
| 属性 |
|
||||||
| 例 | <apps:quota limit="2048"/> | ||||||
| 上位のタグ | atom:entry | ||||||
| コンテンツ フォーマット | 複合 | ||||||
| gd:feedLink | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| 定義 | <gd:feedLink> タグには、論理的にネストされた API レスポンスに関連するフィードについての情報が指定されます。たとえば、ユーザー アカウントについての情報を取得する場合、API レスポンスには 2 つの <gd:feedLink> タグが指定されます。一方のタグには取得されたアカウントに関する、ニックネームのフィードの情報、もう一方のタグには、そのアカウントが登録しているメーリング リストのフィードに関する情報が指定されます。 |
|||||||||
| 属性 |
|
|||||||||
| 例 | <gd:feedLink rel="http://schemas.google.com/apps/2006#user.emailLists" href="http://www.google.com/a/feeds/example.com/emailList/2.0?recipient=us-sales@example.com"/> | |||||||||
| 上位のタグ | atom:entry | |||||||||
| コンテンツ フォーマット | 複合 | |||||||||
| gd:who | |||||||
|---|---|---|---|---|---|---|---|
| 定義 | <gd:who> タグは API レスポンスに関連付けられた個人を示します。このタグは、API リクエストで個人をメーリング リストに追加するために使用されます。また、API レスポンスでは、メーリング リストの更新または取得を要求するために使用されます。 |
||||||
| 属性 |
|
||||||
| 例 | <gd:who email="SusanJones-1321@example.com"/> | ||||||
| 上位のタグ | atom:entry | ||||||
| コンテンツ フォーマット | 複合 | ||||||
| openSearch:startIndex | |
|---|---|
| 定義 | <openSearch:startIndex> 値は、結果として返される最初の項目の、1 から始まるインデックスを示します。 |
| 例 | <openSearch:startIndex>1</openSearch:startIndex> |
| 上位のタグ | atom:feed |
| コンテンツ フォーマット | 整数値 |
| openSearch:itemsPerPage | |
|---|---|
| 定義 | <openSearch:itemsPerPage> 値は、API レスポンスに含まれる項目の総数を示します。 |
| 例 | <openSearch:itemsPerPage>10</openSearch:itemsPerPage> |
| 上位のタグ | atom:feed |
| コンテンツ フォーマット | 整数値 |
| AppsForYourDomainErrors | |
|---|---|
| 定義 | <AppsForYourDomainErrors> タグは、API リクエストが失敗した理由を示す <error> タグのリストをカプセル化します。 |
| 例 | <AppsForYourDomainErrors> |
| サブタグ | error |
| コンテンツ フォーマット | コンテナ |
| error | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 定義 | <error> タグには、Google が API リクエストの処理に失敗した理由を示す情報が指定されます。 |
||||||||||||
| 属性 |
|
||||||||||||
| 例 | <error errorCode="1301" reason="EntityDoesNotExist" invalidInput="Some-Nonexistent-User"/> | ||||||||||||
| 上位のタグ | AppsForYourDomainErrors | ||||||||||||
| コンテンツ フォーマット | 複合 | ||||||||||||
Provisioning API は、ユーザー アカウントの作成、取得、更新のいずれの場合も、同じフォーマットの Atom XML レスポンスを返します。以下の XML は、ユーザー アカウントの情報を変更する API レスポンスのサンプルです。クライアント ライブラリは、この XML を UserEntry オブジェクトに変換します。
<?xml version="1.0" encoding="UTF-8"?> <atom:entry xmlns:atom="http://www.w3.org/2005/Atom" xmlns:apps="http://schemas.google.com/apps/2006" xmlns:gd="http://schemas.google.com/g/2005"> <atom:id>https://www.google.com/a/feeds/example.com/user/2.0/SusanJones</atom:id> <atom:updated>1970-01-01T00:00:00.000Z</atom:updated> <atom:category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/apps/2006#user"/> <atom:title type="text">SusanJones</atom:title> <atom:link rel="self" type="application/atom+xml" href="https://www.google.com/a/feeds/example.com/user/2.0/SusanJones"/> <atom:link rel="edit" type="application/atom+xml" href="https://www.google.com/a/feeds/example.com/user/2.0/SusanJones"/> <apps:login userName="SusanJones" suspended="false" admin="false" changePasswordAtNextLogin="false" agreedToTerms="true"/> <apps:name familyName="Jones" givenName="Susan"/> <gd:feedLink rel="http://schemas.google.com/apps/2006#user.nicknames" href="https://www.google.com/a/feeds/example.com/nickname/2.0? username=Susy-1321"/> <gd:feedLink rel="http://schemas.google.com/apps/2006#user.emailLists" href="https://www.google.com/a/feeds/example.com/emailList/2.0? recipient=us-sales@example.com"/> </atom:entry>
ドメインの全ユーザーを取得するリクエストを送信すると、Provisioning API はユーザーのリストを含む Atom XML フィードを返します。これは、それぞれ <atom:entry> の XML ブロックに示されます。クライアント ライブラリは、このフィードを UserFeed オブジェクトに変換します。これには、一連の UserEntry オブジェクトが含まれます。
以下の XML は、ドメインの全ユーザーを取得するリクエストに対する API レスポンスのサンプルです。
<?xml version="1.0" encoding="UTF-8"?> <atom:feed xmlns:atom="http://www.w3.org/2005/Atom" xmlns:apps="http://schemas.google.com/apps/2006" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:gd="http://schemas.google.com/g/2005"> <atom:id> http://www.google.com/a/feeds/example.com/user/2.0 </atom:id> <atom:updated>1970-01-01T00:00:00.000Z</atom:updated> <atom:category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/apps/2006#user"/> <atom:title type="text">Users</atom:title> <atom:link rel="next" type="application/atom+xml" href="http://www.google.com/a/feeds/example.com/user/2.0?startUsername=john"/> <atom:link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://www.google.com/a/feeds/example.com/user/2.0"/> <atom:link rel="http://schemas.google.com/g/2005#post" type="application/atom+xml" href="http://www.google.com/a/feeds/example.com/user/2.0"/> <atom:link rel="self" type="application/atom+xml" href="http://www.google.com/a/feeds/example.com/user/2.0"/> <openSearch:startIndex>1</openSearch:startIndex> <atom:entry> <atom:id> http://www.google.com/a/feeds/example.com/user/2.0/SusanJones </atom:id> <atom:category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/apps/2006#user"/> <atom:title type="text">SusanJones</atom:title> <atom:link rel="self" type="application/atom+xml" href="http://www.google.com/a/feeds/example.com/user/2.0/SusanJones"/> <atom:link rel="edit" type="application/atom+xml" href="http://www.google.com/a/feeds/example.com/user/2.0/SusanJones"/> <gd:who rel="http://schemas.google.com/apps/2006#user.recipient" email="SusanJones@example.com"/> <apps:login userName="SusanJones" suspended="false" admin="false" changePasswordAtNextLogin="false" agreedToTerms="true"/> <apps:quota limit="2048"/> <apps:name familyName="Jones" givenName="Susan"/> <gd:feedLink rel="http://schemas.google.com/apps/2006#user.nicknames" href="http://www.google.com/a/feeds/example.com/nickname/2.0?username=SusanJones"/> <gd:feedLink rel="http://schemas.google.com/apps/2006#user.emailLists" href="http://www.google.com/a/feeds/example.com/emailList/2.0?recipient=SusanJones@example.com"/> </atom:entry> <atom:entry> <atom:id> http://www.google.com/a/feeds/example.com/user/2.0/JohnSmith </atom:id> <atom:category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/apps/2006#user"/> <atom:title type="text">JohnSmith</atom:title> <atom:link rel="self" type="application/atom+xml" href="http://www.google.com/a/feeds/example.com/user/2.0/JohnSmith"/> <atom:link rel="edit" type="application/atom+xml" href="http://www.google.com/a/feeds/example.com/user/2.0/JohnSmith"/> <gd:who rel="http://schemas.google.com/apps/2006#user.recipient" email="JohnSmith@example.com"/> <apps:login userName="JohnSmith" suspended="false" admin="false" changePasswordAtNextLogin="false" agreedToTerms="true"/> <apps:quota limit="2048"/> <apps:name familyName="Smith" givenName="John"/> <gd:feedLink rel="http://schemas.google.com/apps/2006#user.nicknames" href="http://www.google.com/a/feeds/example.com/nickname/2.0?username=JohnSmith"/> <gd:feedLink rel="http://schemas.google.com/apps/2006#user.emailLists" href="http://www.google.com/a/feeds/example.com/emailList/2.0?recipient=JohnSmith@example.com"/> </atom:entry> </atom:feed>
Provisioning API は、ニックネームの作成、取得のいずれの場合も、同じフォーマットの Atom XML レスポンスを返します。以下の XML は、ニックネームの作成、取得のリクエストに対する API レスポンスのサンプルです。クライアント ライブラリは、この XML を NicknameEntry オブジェクトに変換します。
<?xml version="1.0" encoding="UTF-8"?> <atom:entry xmlns:atom="http://www.w3.org/2005/Atom" xmlns:apps="http://schemas.google.com/apps/2006" xmlns:gd="http://schemas.google.com/g/2005"> <atom:id>https://www.google.com/a/feeds/example.com/nickname/2.0/Susy</atom:id> <atom:updated>1970-01-01T00:00:00.000Z</atom:updated> <atom:category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/apps/2006#nickname"/> <atom:title type="text">Susy</atom:title> <atom:link rel="self" type="application/atom+xml" href="https://www.google.com/a/feeds/example.com/nickname/2.0/Susy"/> <atom:link rel="edit" type="application/atom+xml" href="https://www.google.com/a/feeds/example.com/nickname/2.0/Susy"/> <apps:nickname name="Susy"/> <apps:login userName="SusanJones" suspended="false" admin="false" changePasswordAtNextLogin="false" agreedToTerms="true"/> </atom:entry>
ドメインの全ニックネーム、または特定のユーザーに割り当てられた全ニックネームを取得するリクエストを送信すると、Provisioning API はニックネームのリストを含む Atom XML フィードを返します。これは、それぞれ <atom:entry> の XML ブロックに示されます。クライアント ライブラリは、このフィードを NicknameFeed オブジェクトに変換します。これには、一連の NicknameEntry オブジェクトが含まれます。
以下の XML は、ユーザー名 SusanJones のすべてのニックネームを取得するリクエストに対する API レスポンスのサンプルです。
<?xml version="1.0" encoding="UTF-8"?> <atom:feed xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:apps="http://schemas.google.com/apps/2006"> <atom:id> http://www.google.com/a/feeds/example.com/nickname/2.0 </atom:id> <atom:updated>1970-01-01T00:00:00.000Z</atom:updated> <atom:category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/apps/2006#nickname"/> <atom:title type="text">Nicknames for user SusanJones</atom:title> <atom:link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://www.google.com/a/feeds/example.com/nickname/2.0"/> <atom:link rel="http://schemas.google.com/g/2005#post" type="application/atom+xml" href="http://www.google.com/a/feeds/example.com/nickname/2.0"/> <atom:link rel="self" type="application/atom+xml" href="http://www.google.com/a/feeds/example.com/nickname/2.0?username=SusanJones"/> <openSearch:startIndex>1</openSearch:startIndex> <openSearch:itemsPerPage>2</openSearch:itemsPerPage> <atom:entry> <atom:id> http://www.google.com/a/feeds/example.com/nickname/2.0/susy </atom:id> <atom:category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/apps/2006#nickname"/> <atom:title type="text">susy</atom:title> <atom:link rel="self" type="application/atom+xml" href="http://www.google.com/a/feeds/example.com/nickname/2.0/susy"/> <atom:link rel="edit" type="application/atom+xml" href="http://www.google.com/a/feeds/example.com/nickname/2.0/susy"/> <apps:nickname name="susy"/> <apps:login userName="SusanJones" suspended="false" admin="false" changePasswordAtNextLogin="false" agreedToTerms="true"/> </atom:entry> <atom:entry> <atom:id> http://www.google.com/a/feeds/example.com/nickname/2.0/suse </atom:id> <atom:category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/apps/2006#nickname"/> <atom:title type="text">suse</atom:title> <atom:link rel="self" type="application/atom+xml" href="http://www.google.com/a/feeds/example.com/nickname/2.0/suse"/> <atom:link rel="edit" type="application/atom+xml" href="http://www.google.com/a/feeds/example.com/nickname/2.0/suse"/> <apps:nickname name="suse"/> <apps:login userName="SusanJones" suspended="false" admin="false" changePasswordAtNextLogin="false" agreedToTerms="true"/> </atom:entry> </atom:feed>
メーリング リスト作成のリクエストを送信すると、Provisioning API は新規に作成されたリストを示す XML レスポンスを返します。クライアント ライブラリは、このレスポンスを EmailListEntry オブジェクトに変換します。このオブジェクトは、メーリング リストにアドレスを追加するリクエストの後、リクエストが成功したことを確認する目的以外で機能しません。
以下の XML は、メーリング リスト作成のリクエストに対する API レスポンスのサンプルです。
<?xml version="1.0" encoding="UTF-8"?> <atom:entry xmlns:atom="http://www.w3.org/2005/Atom" xmlns:apps="http://schemas.google.com/apps/2006" xmlns:gd="http://schemas.google.com/g/2005"> <atom:id>https://www.google.com/a/feeds/example.com/emailList/2.0/us-sales</atom:id> <atom:updated>1970-01-01T00:00:00.000Z</atom:updated> <atom:category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/apps/2006#emailList"/> <atom:title type="text">us-sales</atom:title> <atom:link rel="self" type="application/atom+xml" href="https://www.google.com/a/feeds/example.com/emailList/2.0/us-sales"/> <atom:link rel="edit" type="application/atom+xml" href="https://www.google.com/a/feeds/example.com/emailList/2.0/us-sales"/> <apps:emailList name="us-sales"/> <gd:feedLink rel="http://schemas.google.com/apps/2006#emailList.recipients" href="http://www.google.com/a/feeds/example.com/emailList/2.0/us-sales/recipient/"/> </atom:entry>
ドメインの全メーリング リスト、または特定のユーザーが登録している全メーリング リストを取得するリクエストを送信すると、Provisioning API はメーリング リストのリストを含む Atom XML フィードを返します。これは、それぞれ <atom:entry> の XML ブロックに示されます。クライアント ライブラリは、このフィードを EmailListFeed オブジェクトに変換します。これには、一連の EmailListEntry オブジェクトが含まれます。
以下の XML は、ドメインの全メーリング リストを取得するリクエストに対する API レスポンスのサンプルです。
<?xml version="1.0" encoding="UTF-8"?> <atom:feed xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:gd="http://schemas.google.com/g/2005"> <atom:id> http://www.google.com/a/feeds/example.com/emailList/2.0 </atom:id> <atom:updated>1970-01-01T00:00:00.000Z</atom:updated> <atom:category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/apps/2006#emailList"/> <atom:title type="text">EmailLists</atom:title> <atom:link rel="next" type="application/atom+xml" href="http://www.google.com/a/feeds/example.com/emailList/2.0?startEmailListName=john"/> <atom:link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://www.google.com/a/feeds/example.com/emailList/2.0"/> <atom:link rel="http://schemas.google.com/g/2005#post" type="application/atom+xml" href="http://www.google.com/a/feeds/example.com/emailList/2.0"/> <atom:link rel="self" type="application/atom+xml" href="http://www.google.com/a/feeds/example.com/emailList/2.0"/> <openSearch:startIndex>1</openSearch:startIndex> <atom:entry> <atom:id> http://www.google.com/a/feeds/example.com/emailList/2.0/us-sales </atom:id> <atom:updated>1970-01-01T00:00:00.000Z</atom:updated> <atom:category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/apps/2006#emailList"/> <atom:title type="text">us-sales</atom:title> <atom:link rel="self" type="application/atom+xml" href="http://www.google.com/a/feeds/example.com/emailList/2.0/us-sales"/> <atom:link rel="edit" type="application/atom+xml" href="http://www.google.com/a/feeds/example.com/emailList/2.0/us-sales"/> <apps:emailList name="us-sales"/> <gd:feedLink rel="http://schemas.google.com/apps/2006#emailList.recipients" href="http://www.google.com/a/feeds/example.com/emailList/2.0/us-sales/recipient/"/> </atom:entry> <atom:entry> <atom:id> http://www.google.com/a/feeds/example.com/emailList/2.0/us-eng </atom:id> <atom:updated>1970-01-01T00:00:00.000Z</atom:updated> <atom:category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/apps/2006#emailList"/> <atom:title type="text">us-eng</atom:title> <atom:link rel="self" type="application/atom+xml" href="http://www.google.com/a/feeds/example.com/emailList/2.0/us-eng"/> <atom:link rel="edit" type="application/atom+xml" href="http://www.google.com/a/feeds/example.com/emailList/2.0/us-eng"/> <apps:emailList name="us-eng"/> <gd:feedLink rel="http://schemas.google.com/apps/2006#emailList.recipients" href="http://www.google.com/a/feeds/example.com/emailList/2.0/us-eng/recipient/"/> </atom:entry> </atom:feed>
メール アドレスをメーリング リストに追加するリクエストを送信すると、Provisioning API は新規に追加されたアドレスを示す XML レスポンスを返します。クライアント ライブラリは、このレスポンスを EmailListRecipientEntry オブジェクトに変換します。このオブジェクトは、メーリング リストにアドレスを追加するリクエストの後、リクエストが成功したことを確認する目的以外で機能しません。
以下の XML は、特定のメーリング リストに登録されている特定の受信者を取得するリクエストに対する API レスポンスのサンプルです。
<?xml version="1.0" encoding="UTF-8"?> <atom:entry xmlns:atom="http://www.w3.org/2005/Atom" xmlns:apps="http://schemas.google.com/apps/2006" xmlns:gd="http://schemas.google.com/g/2005"> <atom:id>https://www.google.com/a/feeds/example.com/emailList/2.0/us-sales/recipient/SusanJones%40example.com</atom:id> <atom:updated>1970-01-01T00:00:00.000Z</atom:updated> <atom:category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/apps/2006#emailList.recipient"/> <atom:title type="text">SusanJones</atom:title> <atom:link rel="self" type="application/atom+xml" href="https://www.google.com/a/feeds/example.com/emailList/2.0/us-sales/recipient/SusanJones%40example.com"/> <atom:link rel="edit" type="application/atom+xml" href="https://www.google.com/a/feeds/example.com/emailList/2.0/us-sales/recipient/SusanJones%40example.com"/> <gd:who email="SusanJones@example.com"/> </atom:entry>
メーリング リストの全登録者を取得するリクエストを送信すると、Provisioning API は登録者のリストを含む Atom XML フィードを返します。これは、それぞれ atom:entry の XML ブロックに示されます。それぞれのブロックに含まれる <gd:who> タグには、登録されているメール アドレスが示されます。クライアント ライブラリは、このレスポンスを EmailListRecipientFeed オブジェクトに変換します。これには、一連の EmailListRecipientEntry オブジェクトが含まれます。
以下の XML は、メーリング リストの全登録者を取得するリクエストに対する API レスポンスのサンプルです。
<?xml version="1.0" encoding="UTF-8"?> <atom:feed xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:gd="http://schemas.google.com/g/2005"> <atom:id> http://www.google.com/a/feeds/example.com/emailList/2.0/us-sales/recipient </atom:id> <atom:updated>1970-01-01T00:00:00.000Z</atom:updated> <atom:category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/apps/2006#emailList.recipient"/> <atom:title type="text">Recipients for email list us-sales</atom:title> <atom:link rel="next" type="application/atom+xml" href="http://www.google.com/a/feeds/example.com/emailList/2.0/us-sales/recipient/?startRecipient=terry@example.com"/> <atom:link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://www.google.com/a/feeds/example.com/emailList/2.0/us-sales/recipient"/> <atom:link rel="http://schemas.google.com/g/2005#post" type="application/atom+xml" href="http://www.google.com/a/feeds/example.com/emailList/2.0/us-sales/recipient"/> <atom:link rel="self" type="application/atom+xml" href="http://www.google.com/a/feeds/example.com/emailList/2.0/us-sales/recipient"/> <openSearch:startIndex>1</openSearch:startIndex> <atom:entry> <atom:id> http://www.google.com/a/feeds/example.com/emailList/2.0/us-sales/recipient/joe%40example.com </atom:id> <atom:updated>1970-01-01T00:00:00.000Z</atom:updated> <atom:category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/apps/2006#emailList.recipient"/> <atom:title type="text">joe@example.com</atom:title> <atom:link rel="self" type="application/atom+xml" href="http://www.google.com/a/feeds/example.com/emailList/2.0/us-sales/recipient/joe%40example.com"/> <atom:link rel="edit" type="application/atom+xml" href="http://www.google.com/a/feeds/example.com/emailList/2.0/us-sales/recipient/joe%40example.com"/> <gd:who email="joe@example.com"/> </atom:entry> <atom:entry> <atom:id> http://www.google.com/a/feeds/example.com/emailList/2.0/us-sales/recipient/susan%40example.com </atom:id> <atom:updated>1970-01-01T00:00:00.000Z</atom:updated> <atom:category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/apps/2006#emailList.recipient"/> <atom:title type="text">susan@example.com</atom:title> <atom:link rel="self" type="application/atom+xml" href="http://www.google.com/a/feeds/example.com/emailList/2.0/us-sales/recipient/susan%40example.com"/> <atom:link rel="edit" type="application/atom+xml" href="http://www.google.com/a/feeds/example.com/emailList/2.0/us-sales/recipient/susan%40example.com"/> <gd:who email="susan@example.com"/> </atom:entry> </atom:feed>
以下の XML は、無効な API リクエストに対するレスポンスのサンプルです。errorCode 属性の有効値は、<error> タグで定義されます。Provisioning API からエラー レスポンスを受け取ると、Java と Python のクライアント ライブラリは AppsForYourDomainException を返し、.NET クライアント ライブラリは AppsException を返します。このオブジェクトはエラー情報によって生成されます。
<?xml version="1.0" encoding="UTF-8"?>
<AppsForYourDomainErrors> <error errorCode="1301" reason="EntityDoesNotExist" invalidInput="your-invalid-input"/> </AppsForYourDomainErrors>
注: クライアント ライブラリは、無効な XML やリクエスト送信先のパスのエラーなど、より一般的なタイプのエラーに対して他の例外を返す場合もあります。詳しくは、ServiceException のドキュメントをご覧ください。これは、Google Data API リクエストのエラーを識別するための基本的な例外クラスです。
以下のリストは、Google Apps XML レスポンスで受信する可能性があるさまざまなエラー コードの説明です (エラー コード番号順)。
UnknownError(1000) - リクエストは、不明な理由で失敗しました。
UserDeletedRecently(1100) - Google に対して新規ユーザーを作成するように指示するリクエストに、5 日以内に削除されたアカウントのユーザー名が指定されていました。
UserSuspended(1101) - リクエストで指定されたユーザーのアカウントは停止されています。
DomainUserLimitExceeded(1200) - 指定されたドメインは、既にユーザー アカウントの割り当てに達しています。
DomainAliasLimitExceeded(1201) - 指定されたドメインは、既にエイリアスの割り当てに達しています。エイリアスとは、ニックネームとメーリング リストです。
DomainSuspended(1202) - Google は、指定されたドメインの Google Apps へのアクセスを停止しています。
DomainFeatureUnavailable(1203) - 指定されたドメインでは、この特定の機能を使用できません。
EntityExists(1300) - リクエストで Google に作成を指示したエンティティは、既に存在しています。
EntityDoesNotExist(1301) - リクエストで Google に取得を要求したエンティティは存在しません。
EntityNameIsReserved(1302) - リクエストで Google に作成を指示したエンティティの名前は、確保されています (「abuse」、「postmaster」など)。
EntityNameNotValid(1303) - リクエストで指定されたリソース名は無効です。
InvalidGivenName(1400) - API リクエストの中に、ユーザーの名前として使用できない文字が含まれています。このフィールドで使用できる文字についてのヘルプをご覧ください。
InvalidFamilyName(1401) - API リクエストの中に、ユーザーの姓として使用できない文字が含まれています。このフィールドで使用できる文字についてのヘルプをご覧ください。
InvalidPassword(1402) - API リクエストのユーザー パスワードに、無効な数字か文字、または使用できない文字が含まれています。このフィールドで使用できる文字についてのヘルプをご覧ください。
InvalidUsername(1403) - API リクエストの中に、ユーザー名として使用できない文字が含まれています。このフィールドで使用できる文字についてのヘルプをご覧ください。
InvalidHashFunctionName(1404) - 指定されたハッシュ関数は無効です。
InvalidHashDigestLength(1405) - 指定されたパスワードは、指定されたハッシュ関数に従っていません。
InvalidEmailAddress(1406) - 指定されたメール アドレスは無効です。
InvalidQueryParameterValue(1407) - 指定されたクエリ パラメータ値は無効です。
TooManyRecipientsOnEmailList(1500) - リクエストは Google にメーリング リストへのユーザーの追加を指示しましたが、このリストは既に登録者数が上限 (1000) に達しています。
| 関数 | 入力パラメータ | 戻り値 |
|---|---|---|
| createUser | String username String givenName String familyName String password String passwordHashFunction (オプション) Integer quotaLimitInMB (オプション) |
UserEntry |
| retrieveUser | String username | UserEntry |
| retrieveAllUsers | なし | UserFeed |
| retrievePageOfUsers | String startUsername | UserFeed |
| updateUser | String username UserEntry userEntry |
UserEntry |
| suspendUser | String username | UserEntry |
| restoreUser | String username | UserEntry |
| deleteUser | String username | なし |
| createNickname | String username String nickname |
NicknameEntry |
| retrieveNickname | String nickname | NicknameEntry |
| retrieveNicknames (ユーザー用) | String username | NicknameFeed |
| retrieveAllNicknames (ドメイン内) | なし | NicknameFeed |
| retrievePageOfNicknames (ドメイン内) | String startNickname | NicknameFeed |
| deleteNickname | String nickname | なし |
| createEmailList | String emailList | EmailListEntry |
| retrieveEmailLists (ユーザー用) | String recipient | EmailListFeed |
| retrieveAllEmailLists | なし | EmailListFeed |
| retrievePageOfEmailLists | String startEmailListName | EmailListFeed |
| deleteEmailList | String emailList | なし |
| createUser | String username String givenName String familyName String password Integer quotaLimitInMB (オプション) |
UserEntry |
| addRecipientToEmailList | String recipientAddress、String emailList | EmailListRecipientEntry |
| retrieveAllRecipients | String emailList | EmailListRecipientFeed |
| retrievePageOfRecipients | String emailList、String startRecipient | EmailListRecipientFeed |
| removeRecipientFromEmailList | String recipientAddress String emailList |
なし |