リストおよびリスト アイテム REST API リファレンス
REST API のリスト、リスト アイテム、ビュー、および他のリスト関連リソースやエンドポイントについて説明します。
適用対象: apps for SharePoint | SharePoint Foundation 2013 | SharePoint Online | SharePoint Server 2013
この記事の内容
この記事の要求の例について
SharePoint 2013 リストおよびリスト アイテム REST 構文の探索
List リソース
ListCollection リソース
ListItem リソース
ListItemCollection リソース
リソースの表示
ViewCollection リソース
ViewFieldCollection のリソース
追加リソース
この記事の要求の例について
この記事の要求の例は、クロスドメイン要求を行うためにクロスドメイン ライブラリ (SP.RequestExecutor.js) を使用していることを前提としています。このため、エンドポイント URI で SP.AppContextSite を使用します。詳細については、「クロスドメイン ライブラリを使用してアドインから SharePoint 2013 のデータにアクセスする」を参照してください。
要求の例を使用する前に、次の操作を実行してください。
<アプリ web url>、<ホスト web url>、および ID、名前、SharePoint エンティティのパスなどその他プレースホルダーのデータを変更します。
クロスドメイン ライブラリを使用していない場合は、すべての POST 要求のフォーム ダイジェストの値を送信する X-RequestDigest ヘッダー、および要求本文でデータを送信する POST 要求のための content-length ヘッダーを含めます。
クロスドメイン要求を行わない場合は、SP.AppContextSite(@target) および ?@target='<host web url>' をエンドポイント URI から削除します。
OAuth を使用する場合は、Authorization ヘッダー ("Authorization": "Bearer " + <access token>) を含めて OAuth アクセス トークンを送信します。
要求の例の url および body プロパティ値から改行を削除します。改行は、例を分かりやすくするために追加されています。
サーバーが Atom 形式で応答を返すようにするには、"accept": "application/json; odata=verbose" ヘッダーを削除します。
クロスドメイン ライブラリ、OAuth、および SharePoint REST サービスの使用法についての詳細は、「その他の技術情報」を参照してください。要求形式についての詳細は、「環境によって異なる REST 要求の方法」および「REST 要求で使うプロパティ」を参照してください。
ヒント
SharePoint Online REST サービスは、OData $batch クエリ オプションを使用して複数の要求を、サービスに対する 1 つの呼び出しに結合できます。詳細とコード サンプルへのリンクについては、「REST API によりバッチ要求を発行する」をご覧ください。このオプションは、オンプレミスの SharePoint ではサポートされていません。
SharePoint 2013 リストおよびリスト アイテム REST 構文の探索
SharePoint 2013 リストおよびリスト アイテム REST 構文を視覚的に表示します。 その他の SharePoint REST 構文の図を探索します。 すべての SharePoint REST 構文の図が統合された PDF をダウンロードします。 |
注意
特定のリストのアイテムをクエリする場合、OData の $skip クエリ オプションは機能しません。リスト エンドポイントをクエリする場合は動作します。
List リソース
SharePoint リストを表します。リストは SP.SecurableObject の一種です。
エンドポイント URI | プロパティ | メソッド | OData 表現
エンドポイント URI
http://<site url>/web/lists(guid'<list id>')
サポートされる HTTP メソッド
GET | POST | DELETE | MERGE | PUT
要求の例
GET 要求の例: リストを取得します
executor.executeAsync({
url: "<app web url>/_api/SP.AppContextSite(@target)/web
/lists(guid'51925dd7-2108-481a-b1ef-4bfa4e69d48b')
?@target='<host web url>'",
method: "GET",
headers: { "accept": "application/json; odata=verbose" },
success: successHandler,
error: errorHandler
});
または、ListCollection リソースから GetByTitle メソッドを使用してタイトルごとにリストを取得できます。例: …/web/lists/getbytitle('Access Requests')
POST 要求の例: リストを作成します
executor.executeAsync({
url: "<app web url>/_api/SP.AppContextSite(@target)/web/lists
?@target='<host web url>'",
method: "POST",
body: "{ '__metadata': { 'type': 'SP.List' }, 'AllowContentTypes': true, 'BaseTemplate': 100,
'ContentTypesEnabled': true, 'Description': 'My list description', 'Title': 'Test title' }",
headers: { "content-type": "application/json;odata=verbose" },
success: successHandler,
error: errorHandler
});
MERGE 要求の例: リストを変更します
executor.executeAsync({
url: "<app web url>/_api/SP.AppContextSite(@target)/web
/lists(guid'51925dd7-2108-481a-b1ef-4bfa4e69d48b')
?@target='<host web url>'",
method: "POST",
body: "{ '__metadata': { 'type': 'SP.List' }, 'AllowContentTypes': true, 'BaseTemplate': 100,
'ContentTypesEnabled': true, 'Description': 'My list description', 'Title': 'Test title' }",
headers: {
"IF-MATCH”: "*",
"X-HTTP-Method": "MERGE",
"content-type": "application/json;odata=verbose"
},
success: successHandler,
error: errorHandler
});
DELETE 要求の例: リストを削除します
executor.executeAsync({
url: "<app web url>/_api/SP.AppContextSite(@target)/web
/lists(guid'51925dd7-2108-481a-b1ef-4bfa4e69d48b')
?@target='<host web url>'",
method: "POST",
headers: {
"IF-MATCH”: "*",
"X-HTTP-Method": "DELETE"
},
success: successHandler,
error: errorHandler
});
リストをリサイクルして、ごみ箱アイテムの GUID を取得する場合は、リストの Recycle メソッドを使用してファイルを削除します。
List プロパティ
プロパティを取得するには、以下の例に示されているように、GET 要求をプロパティ エンドポイントに送信します。
executor.executeAsync({
url: "<app web url>/_api/SP.AppContextSite(@target)/web
/lists(guid'51925dd7-2108-481a-b1ef-4bfa4e69d48b')/<property name>
?@target='<host web url>'",
method: "GET",
headers: { "accept": "application/json; odata=verbose" },
success: successHandler,
error: errorHandler
});
プロパティ |
型 |
R/W |
説明 |
|
---|---|---|---|---|
AllowContentTypes |
Boolean |
R |
はい |
リストがコンテンツ タイプをサポートしているかどうかを示す値を取得します。 |
BaseTemplate |
Int32 |
R |
はい |
リストの基になっているリスト定義の種類を取得します。ListTemplateType 値を表します。テンプレートの種類の値についての詳細は, .NET クライアント オブジェクト モデル リファレンスの ListTemplateType を参照してください。 |
BaseType |
Int32 |
R |
はい |
リストの基本型を取得します。SP.BaseType 値を表します。汎用リスト = 0、ドキュメント ライブラリ = 1、ディスカッション掲示板 = 3、調査 = 4、発行 = 5。 |
BrowserFileHandling |
Int32 |
R |
いいえ |
Web アプリケーションの BrowserFileHandling プロパティのオーバーライドをリスト レベルで指定する値を取得します。SP.BrowserFileHandling 値を表します。制限しない = 0、制限する = 1。 |
ContentTypes |
SP.ContentTypeCollection |
R |
いいえ |
リストに関連付けられているコンテンツ タイプを取得します。 |
ContentTypesEnabled |
Boolean |
RW |
はい |
コンテンツ タイプがリストで有効かどうかを指定する値を取得または設定します。 |
Created |
DateTime |
R |
はい |
リストが作成された日時を示す値を取得します。 |
DataSource |
R |
いいえ |
リストと関連付けられたデータ ソースを取得します。ただし、リストが仮想リストでない場合は null が取得されます。HasExternalDataSource プロパティが false の場合、null を返します。 |
|
DefaultContentApprovalWorkflowId |
GUID |
RW |
はい |
リストでのコンテンツ承認のための既定のワークフロー識別子を指定する値を取得または設定します。 既定のコンテンツの承認ワークフローがない場合、空の GUID を返します。 |
DefaultDisplayFormUrl |
String |
RW |
いいえ |
リストの既定の表示形式の場所を指定する値を取得または設定します。 クライアントはサーバー相対 URL を指定し、サーバーはサイト相対 URL を返します |
DefaultEditFormUrl |
String |
RW |
いいえ |
リスト内のリスト アイテムで使用する編集フォームの URL を指定する値を取得または設定します。 クライアントはサーバー相対 URL を指定し、サーバーはサイト相対 URL を返します。 |
DefaultNewFormUrl |
String |
RW |
いいえ |
リストの既定の新規フォームの場所を指定する値を取得または設定します。 クライアントはサーバー相対 URL を指定し、サーバーはサイト相対 URL を返します。 |
DefaultView |
R |
いいえ |
||
DefaultViewUrl |
String |
R |
いいえ |
リストの既定のビューの URL を取得します。 |
Description |
String |
RW |
はい |
リストの説明を指定する値を取得または設定します。 |
Direction |
String |
RW |
はい |
リストの読み取り方向を指定する値を取得または設定します。 "NONE"、"LTR"、または "RTL" を返します。 |
DocumentTemplateUrl |
String |
RW |
はい |
リストのドキュメント テンプレートのサーバー相対 URL を指定する値を取得または設定します。 基本型が DocumentLibrary の場合はサーバー相対 URL を返し、それ以外の場合は null を返します。 |
DraftVersionVisibility |
Int32 |
RW |
はい |
リスト内にマイナー バージョンやドラフトを表示するために必要な最小限のアクセス許可を指定する値を取得または設定します。SP.DraftVisibilityType 値を表します。読者 = 0、作成者 = 1、承認者 = 2。 |
EffectiveBasePermissions |
R |
いいえ |
現在のユーザーに割り当てられているリストに対する有効なアクセス許可を示す値を取得します。 |
|
EffectiveBasePermissionsForUI |
R |
いいえ |
||
EnableAttachments |
Boolean |
RW |
はい |
リスト アイテムの添付ファイルがリストで有効かどうかを指定する値を取得または設定します。 |
EnableFolderCreation |
Boolean |
RW |
はい |
新しいリスト フォルダーをリストに追加できるかどうかを指定する値を取得または設定します。 |
EnableMinorVersions |
Boolean |
RW |
はい |
マイナー バージョンがリストで有効かどうかを指定する値を取得または設定します。 |
EnableModeration |
Boolean |
RW |
はい |
コンテンツの承認がリストで有効かどうかを指定する値を取得または設定します。 |
EnableVersioning |
Boolean |
RW |
はい |
リスト アイテムおよびドキュメントの履歴バージョンをリスト内に作成できるかどうかを指定する値を取得または設定します。 |
EntityTypeName |
String |
R |
はい |
|
EventReceivers |
SP.EventReceiverDefinitionCollection |
R |
いいえ |
|
Fields |
R |
いいえ |
リスト内のすべてのフィールドのコレクションを示す値を取得します。 |
|
FirstUniqueAncestorSecurableObject |
SP.SecurableObject |
R |
いいえ |
このオブジェクトのロール割り当てが定義されたオブジェクトを取得します。 ロール割り当てが現在のオブジェクトで直接定義される場合は、現在のオブジェクトが返されます。 |
ForceCheckout |
Boolean |
RW |
はい |
強制チェックアウトがドキュメント ライブラリで有効かどうかを示す値を取得または設定します。 |
Forms |
SP.FormCollection |
R |
いいえ |
リスト内のすべてのリスト フォームのコレクションを示す値を取得します。 |
HasExternalDataSource |
Boolean |
R |
はい |
リストが外部リストであるかどうかを示す値を取得します。 |
HasUniqueRoleAssignments |
Boolean |
R |
いいえ |
ロールの割り当てがこのセキュリティ設定可能なオブジェクトで一意に定義されるか、それともセキュリティ設定可能な親オブジェクトから継承されるかを指定する値を取得します。 |
Hidden |
Boolean |
RW |
はい |
リストが非表示かどうかを指定するブール値を取得または設定します。true の場合、サーバーは OnQuickLaunch プロパティを false に設定します。 |
Id |
GUID |
R |
はい |
データベース内のリストを識別する GUID を取得します。 |
ImageUrl |
String |
R |
はい |
リストのアイコンの URI を示す値を取得します。 |
InformationRightsManagementSettings |
SP.InformationRightsManagementSettings |
R |
いいえ |
|
IrmEnabled |
Boolean |
RW |
はい |
|
IrmExpire |
Boolean |
RW |
はい |
|
IrmReject |
Boolean |
RW |
はい |
|
IsApplicationList |
Boolean |
RW |
はい |
クライアント アプリケーションがリストを表示するかどうかの決定に使用できるフラグを指定する値を取得または設定します。 |
IsCatalog |
Boolean |
R |
はい |
リストがギャラリーであるかどうかを示す値を取得します。 |
IsPrivate |
Boolean |
R |
はい |
|
IsSiteAssetsLibrary |
Boolean |
R |
いいえ |
ユーザーが自分の Wiki ページにアップロードしたイメージまたはその他のファイルの既定のアセットの場所としてリストが指定されているかどうかを示す値を取得します。 |
ItemCount |
Int32 |
R |
はい |
リスト内のリスト アイテム数を示す値を取得します。 |
Items |
R |
いいえ |
リストのすべてのアイテムを取得します。 OData クエリ操作を使用してアイテムをフィルター処理できます (例: …/lists(guid'51925dd7-2108-481a-b1ef-4bfa4e69d48b')/items?$filter=Status eq 'not started'&$select=Title&$top=5)。 |
|
LastItemDeletedDate |
DateTime |
R |
はい |
リストからリスト アイテムが最後に削除された日時を示す値を取得します。 |
LastItemModifiedDate |
DateTime |
RW |
はい |
リストのリスト アイテム、フィールド、またはプロパティが最後に変更された時刻を示す値を取得します。 |
ListItemEntityTypeFullName |
String |
R |
はい |
|
MultipleDataList |
Boolean |
RW |
はい |
会議ワークスペース サイト内のリストにサイト内の複数の会議インスタンスのデータが含まれるかどうかを指定する値を取得または設定します。 |
NoCrawl |
Boolean |
RW |
はい |
クローラーがリストをクロールしてはならないことを指定する値を取得または設定します。 |
OnQuickLaunch |
Boolean |
RW |
いいえ |
リストがサイトのサイド リンク バーに表示されるかどうかを指定する値を取得または設定します。true の場合、サーバーは Hidden プロパティを false に設定します。 |
ParentWeb |
R |
いいえ |
リストが含まれているサイトを示す値を取得します。 |
|
ParentWebUrl |
String |
R |
はい |
リストが含まれているサイトのサーバー相対 URL を示す値を取得します。 |
RoleAssignments |
R |
いいえ |
セキュリティ設定が可能なオブジェクトのロールの割り当てを取得します。 |
|
RootFolder |
R |
いいえ |
リスト内のファイルとすべての関連ファイルが格納されているルート フォルダーを取得します。 |
|
SchemaXml |
String |
R |
いいえ |
リストのリスト スキーマを示す値を取得します。 |
ServerTemplateCanCreateFolders |
Boolean |
R |
はい |
リスト内にフォルダーを作成できるかどうかを示す値を取得します。 |
TemplateFeatureId |
GUID |
R |
はい |
リストのリスト スキーマが含まれている機能の機能識別子を示す値を取得します。 機能にリスト スキーマが含まれない場合、空の GUID を返します。 |
Title |
String |
RW |
はい |
リストの表示タイトルを取得または設定します。 長さは <= 255 文字である必要があります。 |
UserCustomActions |
R |
いいえ |
リストのすべてのユーザー カスタム アクションのコレクションを示す値を取得します。 |
|
ValidationFormula |
String |
RW |
いいえ |
リスト アイテムのデータ検証基準を指定する値を取得または設定します。 長さは <= 1023 である必要があります。 |
ValidationMessage |
String |
RW |
いいえ |
リスト アイテムでデータ検証に失敗した場合に返されるエラー メッセージを指定する値を取得または設定します。 長さは <= 1023 である必要があります。 |
Views |
R |
いいえ |
リスト上のすべてのパブリック ビューとリスト上の現在のユーザーの個人用ビューのコレクションを示す値を取得します。 |
|
WorkflowAssociations |
SP.Workflow.WorkflowAssociationCollection |
R |
いいえ |
リストのすべてのワークフロー関連付けのコレクションを示す値を取得します。 |
List メソッド
AddItem
BreakRoleInheritance
DeleteObject
GetChanges
GetItemById
GetItems
GetListItemChangesSinceToken
GetRelatedFields
GetUserEffectivePermissions
GetView
Recycle
RenderListData
RenderListFormData
ReserveListItemId
ResetRoleInheritance
AddItem メソッド
例
BreakRoleInheritance メソッド
セキュリティ設定が可能なオブジェクトの一意なロール割り当てを作成します。
エンドポイント |
/breakroleinheritance(copyroleassignments, clearsubscopes) |
パラメーター |
|
HTTP method |
POST |
応答 |
なし |
要求の例
executor.executeAsync({
url: "<app web url>/_api/SP.AppContextSite(@target)/web/lists(guid'a290086b-2d43-4151-add4-893474a930a9')
/breakroleinheritance(copyroleassignments=false, clearsubscopes=true)
?@target='<host web url>'",
method: "POST",
success: successHandler,
error: errorHandler
});
DeleteObject メソッド
例
GetChanges メソッド
指定されたクエリに基づいて、リスト内で発生した変更のコレクションを変更ログから返します。
エンドポイント |
/getchanges |
パラメーター |
|
HTTP method |
POST |
応答 |
型: SP.ChangeCollection |
要求の例
var metadata = "{ 'query' : { '__metadata': { 'type': 'SP.ChangeQuery' },
'Add': 'True', 'Item': 'True' }}";
executor.executeAsync({
url: "<app web url>/_api/SP.AppContextSite(@target)/web/lists(guid'51925dd7-2108-481a-b1ef-4bfa4e69d48b')
/getchanges
?@target='<host web url>'",
method: "POST",
body: metadata,
headers: {
"accept": "application/json; odata=verbose",
"content-type": "application/json; odata=verbose"
},
success: successHandler,
error: errorHandler
});
応答の例
{"d":
{"results":[{
"__metadata":{
"id":"https://<site url>/_api/SP.ChangeItema7e7c6e9-2c41-47c3-aae9-2b4a63b7a087",
"uri":"https://<site url>/_api/SP.ChangeItem",
"type":"SP.ChangeItem"
},
"ChangeToken":{"__metadata":{"type":"SP.ChangeToken"}, "StringValue":"1;3;482e418a-0900-414b-8902-02248c2e44e8;634955266749500000;5749111"},
"ChangeType":1,
"SiteId":"ce11bfbb-cf9d-4b2b-a642-8673bd48cceb",
"Time":"2013-02-03T22:17:54Z",
"ItemId":1,
"ListId":"482e418a-0900-414b-8902-02248c2e44e8",
"WebId":"a975b994-fc67-4203-a519-b160175ca967"
}]
}}
GetItemById メソッド
指定されたリスト アイテム識別子を持つリスト アイテムを返します。
エンドポイント |
/getitembyid(<アイテム id>) |
パラメーター |
型: Int32 |
HTTP method |
GET |
応答 |
型: SP.ListItem |
要求の例
executor.executeAsync({
url: "<app web url>/_api/SP.AppContextSite(@target)/web/lists(guid'a290086b-2d43-4151-add4-893474a930a9')
/getitembyid(2)
?@target='<host web url>'",
method: "GET",
headers: { "accept": "application/json; odata=verbose" },
success: successHandler,
error: errorHandler
});
または、リスト アイテム ID を ListItemCollection リソースに渡すことができます。例: …/web/lists(guid'51925dd7-2108-481a-b1ef-4bfa4e69d48b')/items(2)
GetItems メソッド
指定されたクエリに基づいてリストからアイテムのコレクションを返します。
エンドポイント |
/getitems |
パラメーター |
|
HTTP method |
POST |
応答 |
型: SP.ListItemCollection |
要求の例
executor.executeAsync({
url: "<app web url>/_api/SP.AppContextSite(@target)/web/lists(guid'47f89cf2-359d-4792-9dc4-8da877a5050a')
/getitems
?@target='<host web url>'",
method: "POST",
body: "{ 'query' : {'__metadata': { 'type': 'SP.CamlQuery' }, "ViewXml": "<View><Query><Where><Contains><FieldRef Name='Status'/><Value Type='CHOICE'>in progress</Value></Contains></Where></Query></View>" } }",
headers: {
"accept": "application/json; odata=verbose",
"content-type": "application/json; odata=verbose"
},
success: successHandler,
error: errorHandler
});
GetListItemChangesSinceToken メソッド
エンドポイント |
/getlistitemchangessincetoken |
パラメーター |
|
HTTP method |
POST |
応答 |
型: GetListItemChangesSinceTokenResult |
要求の例
var metadata = "{ 'query': { '__metadata': { 'type': 'SP.ChangeLogItemQuery' },
'ChangeToken': '1;3;79cc20e6-adda-438e-8a96-792041b33168;635103901830230000;33050019' }}";
executor.executeAsync({
url: "<app web url>/_api/SP.AppContextSite(@target)/web/lists(guid'51925dd7-2108-481a-b1ef-4bfa4e69d48b')
/getlistitemchangessincetoken
?@target='<host web url>'",
method: "POST",
body: metadata,
headers: { "content-type": "application/json; odata=verbose" },
success: successHandler,
error: errorHandler
});
フィルタリングされたクエリの指定方法の例については、「REST サービスを使用して SharePoint アイテムを同期させる」をご覧ください。
応答の例
<?xml version="1.0" encoding="utf-8" ?>
<GetListItemChangesSinceTokenResult>
<listitems MinTimeBetweenSyncs='0' RecommendedTimeBetweenSyncs='180' MaxBulkDocumentSyncSize='500' MaxRecommendedEmbeddedFileSize='500' EffectivePermMask='FullMask' xmlns:s='uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882' xmlns:dt='uuid:C2F41010-65B3-11d1-A29F-00AA00C14882' xmlns:rs='urn:schemas-microsoft-com:rowset' xmlns:z='#RowsetSchema'>
<Changes LastChangeToken="1;3;79cc20e6-adda-438e-8a96-792041b33168;635110802324330000;33811711">
<List DocTemplateUrl="" DefaultViewUrl="/Lists/TestList/AllItems.aspx" MobileDefaultViewUrl="" ID="{79CC20E6-ADDA-438E-8A96-792041B33168}" Title="TestList" Description="" ImageUrl="/_layouts/15/images/itgen.png?rev=26" Name="{79CC20E6-ADDA-438E-8A96-792041B33168}" BaseType="0" FeatureId="00bfea71-de22-43b2-a848-c05709900100" ServerTemplate="100" Created="20130725 22:22:35" Modified="20130802 22:43:52" LastDeleted="20130725 22:22:35" Version="4" Direction="none" ThumbnailSize="" WebImageWidth="" WebImageHeight="" Flags="545263616" ItemCount="2" AnonymousPermMask="0" RootFolder="/Lists/TestList" ReadSecurity="1" WriteSecurity="1" Author="11" EventSinkAssembly="" EventSinkClass="" EventSinkData="" EmailAlias="" WebFullUrl="/" WebId="a975b994-fc67-4203-a519-b160175ca967" SendToLocation="" ScopeId="ad9949be-be16-4946-b5de-66c912eda54a" MajorVersionLimit="0" MajorWithMinorVersionsLimit="0" WorkFlowId="" HasUniqueScopes="False" NoThrottleListOperations="False" HasRelatedLists="" Followable="False" AllowDeletion="True" AllowMultiResponses="False" EnableAttachments="True" EnableModeration="False" EnableVersioning="False" HasExternalDataSource="False" Hidden="False" MultipleDataList="False" Ordered="False" ShowUser="True" EnablePeopleSelector="False" EnableResourceSelector="False" EnableMinorVersion="False" RequireCheckout="False" ThrottleListOperations="False" ExcludeFromOfflineClient="False" CanOpenFileAsync="True" EnableFolderCreation="False" IrmEnabled="False" IsApplicationList="False" PreserveEmptyValues="False" StrictTypeCoercion="False" EnforceDataValidation="False" MaxItemsPerThrottledOperation="5000">
<Fields>
<Field ID="{03e45e84-1992-4d42-9116-26f756012634}" RowOrdinal="0" Type="ContentTypeId" Sealed="TRUE" ReadOnly="TRUE" Hidden="TRUE" DisplayName="Content Type ID" Name="ContentTypeId" DisplaceOnUpgrade="TRUE" SourceID="https://schemas.microsoft.com/sharepoint/v3" StaticName="ContentTypeId" ColName="tp_ContentTypeId" FromBaseType="TRUE"/>
<Field ID="{fa564e0f-0c70-4ab9-b863-0177e6ddd247}" Type="Text" Name="Title" DisplayName="Title" Required="TRUE" SourceID="https://schemas.microsoft.com/sharepoint/v3" StaticName="Title" FromBaseType="TRUE" ColName="nvarchar1"/>
<Field ID="{34ad21eb-75bd-4544-8c73-0e08330291fe}" ReadOnly="TRUE" Type="Note" Name="_ModerationComments" DisplayName="Approver Comments" Hidden="TRUE" CanToggleHidden="TRUE" Filterable="FALSE" Sortable="FALSE" SourceID="https://schemas.microsoft.com/sharepoint/v3" StaticName="_ModerationComments" FromBaseType="TRUE" ColName="ntext1"/>
<Field ID="{39360f11-34cf-4356-9945-25c44e68dade}" ReadOnly="TRUE" Hidden="TRUE" Type="Text" Name="File_x0020_Type" DisplaceOnUpgrade="TRUE" DisplayName="File Type" SourceID="https://schemas.microsoft.com/sharepoint/v3" StaticName="File_x0020_Type" FromBaseType="TRUE" ColName="nvarchar2"/>
<Field ID="{fc2e188e-ba91-48c9-9dd3-16431afddd50}" Name="WorkAddress" SourceID="https://schemas.microsoft.com/sharepoint/v3" StaticName="WorkAddress" Group="Core Contact and Calendar Columns" DisplayName="Address" Type="Note" NumLines="2" Sortable="FALSE" ColName="ntext2" RowOrdinal="0"/>
<Field ID="{fce16b4c-fe53-4793-aaab-b4892e736d15}" Name="EMail" SourceID="https://schemas.microsoft.com/sharepoint/v3" StaticName="EMail" Group="Core Contact and Calendar Columns" DisplayName="E-Mail" ReadOnly="FALSE" Type="Text" FromBaseType="TRUE" AllowDeletion="TRUE" ColName="nvarchar3" RowOrdinal="0"/>
<Field Type="Lookup" DisplayName="anewishlisttitle" Required="FALSE" EnforceUniqueValues="FALSE" List="{482e418a-0900-414b-8902-02248c2e44e8}" ShowField="Title" UnlimitedLengthInDocumentLibrary="FALSE" RelationshipDeleteBehavior="None" ID="{9919f3f8-88fb-43fc-b4cb-658b1db1bfe3}" SourceID="{79cc20e6-adda-438e-8a96-792041b33168}" StaticName="anewishlisttitle" Name="anewishlisttitle" ColName="int1" RowOrdinal="0"/>
<Field Type="Lookup" DisplayName="Books title" Required="FALSE" EnforceUniqueValues="FALSE" List="{90146606-81fd-410d-9fdd-d03b6349fbcd}" ShowField="Title" UnlimitedLengthInDocumentLibrary="FALSE" RelationshipDeleteBehavior="None" ID="{879a1cba-91b6-4c0a-99fb-29f877aae3ea}" SourceID="{79cc20e6-adda-438e-8a96-792041b33168}" StaticName="Books_x0020_title" Name="Books_x0020_title" ColName="int2" RowOrdinal="0"/>
<Field ID="{1d22ea11-1e32-424e-89ab-9fedbadb6ce1}" ColName="tp_ID" RowOrdinal="0" ReadOnly="TRUE" Type="Counter" Name="ID" PrimaryKey="TRUE" DisplayName="ID" SourceID="https://schemas.microsoft.com/sharepoint/v3" StaticName="ID" FromBaseType="TRUE"/>
<Field ID="{c042a256-787d-4a6f-8a8a-cf6ab767f12d}" Type="Computed" DisplayName="Content Type" Name="ContentType" DisplaceOnUpgrade="TRUE" RenderXMLUsingPattern="TRUE" Sortable="FALSE" SourceID="https://schemas.microsoft.com/sharepoint/v3" StaticName="ContentType" Group="_Hidden" PITarget="MicrosoftWindowsSharePointServices" PIAttribute="ContentTypeID" FromBaseType="TRUE">
<FieldRefs>
<FieldRef Name="ContentTypeId"/>
</FieldRefs>
<DisplayPattern>
<MapToContentType>
<Column Name="ContentTypeId"/>
</MapToContentType>
</DisplayPattern>
</Field>
<…>
</Fields>
<RegionalSettings>
<Language>1033</Language>
<Locale>1033</Locale>
<AdvanceHijri>0</AdvanceHijri>
<CalendarType>1</CalendarType>
<Time24>False</Time24>
<TimeZone>480</TimeZone>
<SortOrder>2070</SortOrder>
<Presence>True</Presence>
</RegionalSettings>
<ServerSettings>
<ServerVersion>16.0.1810.1236</ServerVersion>
<RecycleBinEnabled>True</RecycleBinEnabled>
<ServerRelativeUrl>/</ServerRelativeUrl>
</ServerSettings>
</List>
</Changes>
<rs:data ItemCount="1">
<z:row ows_ContentTypeId='0x0100C8CFB1DE383F1B49A44ABD2EB9AC7322' ows_Title='<item title>' ows_ID='2' ows_ContentType='Item' ows_Modified='2013-07-25T23:21:50Z' ows_Created='2013-07-25T23:21:50Z' ows_Author='<author>' ows_Editor='<editor>' ows_owshiddenversion='1' ows_WorkflowVersion='1' ows__UIVersion='512' ows__UIVersionString='1.0' ows_Attachments='0' ows__ModerationStatus='0' ows_LinkTitleNoMenu='<item title>' ows_LinkTitle='<item title>' ows_LinkTitle2='<item title>' ows_SelectTitle='2' ows_Order='200.000000000000' ows_GUID='{D38981C3-2735-4FDF-9B41-91F3ADA8F3F0}' ows_FileRef='2;#Lists/TestList/2_.000' ows_FileDirRef='2;#Lists/TestList' ows_Last_x0020_Modified='2;#2013-07-25T23:21:50Z' ows_Created_x0020_Date='2;#2013-07-25T23:21:50Z' ows_FSObjType='2;#0' ows_SortBehavior='2;#0' ows_PermMask='0x7fffffffffffffff' ows_FileLeafRef='2;#2_.000' ows_UniqueId='2;#{4D719C3B-B8AB-46A0-A080-402DF6EE31C1}' ows_ProgId='2;#' ows_ScopeId='2;#{AD9949BE-BE16-4946-B5DE-66C912EDA54A}' ows__EditMenuTableStart='2_.000' ows__EditMenuTableStart2='2' ows__EditMenuTableEnd='2' ows_LinkFilenameNoMenu='2_.000' ows_LinkFilename='2_.000' ows_LinkFilename2='2_.000' ows_ServerUrl='/Lists/TestList/2_.000' ows_EncodedAbsUrl='https://<site url>.sharepoint.com/Lists/TestList/2_.000' ows_BaseName='2_' ows_MetaInfo='2;#' ows__Level='1' ows__IsCurrentVersion='1' ows_ItemChildCount='2;#0' ows_FolderChildCount='2;#0' ows_ServerRedirected='0' />
</rs:data>
</listitems>
</GetListItemChangesSinceTokenResult>
GetRelatedFields メソッド
このリストをデータ ソースとして使用し、FieldLookup.IsRelationship が true に設定されているルックアップ フィールドのコレクションを返します。
エンドポイント |
/getrelatedfields |
パラメーター |
なし |
HTTP method |
GET |
応答 |
型: SP.RelatedFieldCollection |
要求の例
executor.executeAsync({
url: "<app web url>/_api/SP.AppContextSite(@target)/web/lists(guid'51925dd7-2108-481a-b1ef-4bfa4e69d48b')
/getrelatedfields
?@target='<host web url>'",
method: "GET",
headers: { "accept": "application/json; odata=verbose" },
success: successHandler,
error: errorHandler
});
GetUserEffectivePermissions メソッド
エンドポイント |
/getusereffectivepermissions(@user)?@user='<ユーザー ログイン名>' |
パラメーター |
型: String |
HTTP method |
GET |
応答 |
型: SP.BasePermissions |
要求の例
executor.executeAsync({
url: "<app web url>/_api/SP.AppContextSite(@target)/web/lists(guid'51925dd7-2108-481a-b1ef-4bfa4e69d48b')
/getusereffectivepermissions(@user)?@user='i%3A0%23.f%7Cmembership%7Cuser%40domain.onmicrosoft.com'
&@target='<host web url>'",
method: "GET",
headers: { "accept": "application/json; odata=verbose" },
success: successHandler,
error: errorHandler
});
GetView メソッド
指定されたビュー識別子を持つリスト ビューを返します。
エンドポイント |
/getview('<ビュー id>') |
パラメーター |
型: String |
HTTP method |
GET |
応答 |
型: SP.View |
要求の例
executor.executeAsync({
url: "<app web url>/_api/SP.AppContextSite(@target)/web/lists(guid'51925dd7-2108-481a-b1ef-4bfa4e69d48b')
/getview('4814949d-3e17-444c-a1a3-cb69bc77e95f')
?@target='<host web url>'",
method: "GET",
headers: { "accept": "application/json; odata=verbose" },
success: successHandler,
error: errorHandler
});
または、単に ViewCollection リソースでビュー ID を指定できます。例: …/_api/web/lists(guid'51925dd7-2108-481a-b1ef-4bfa4e69d48b')/views('4814949d-3e17-444c-a1a3-cb69bc77e95f')
Recycle メソッド
リストをごみ箱に移動し、新しいごみ箱アイテムの識別子を返します。
エンドポイント |
/recycle |
パラメーター |
なし |
HTTP method |
POST |
応答 |
型: GUID |
要求の例
executor.executeAsync({
url: "<app web url>/_api/SP.AppContextSite(@target)/web/lists(guid'51925dd7-2108-481a-b1ef-4bfa4e69d48b')
/recycle
?@target='<host web url>'",
method: "POST",
headers: { "accept": "application/json; odata=verbose" },
success: successHandler,
error: errorHandler
});
RenderListData メソッド
エンドポイント |
/renderlistdata('<ビュー xml>') |
パラメーター |
型: String |
HTTP method |
POST |
応答 |
型: String |
要求の例
executor.executeAsync({
url: "<app web url>/_api/SP.AppContextSite(@target)/web/lists(guid'51925dd7-2108-481a-b1ef-4bfa4e69d48b')
/renderlistdata(@viewXml)?@viewXml='<View><RowLimit>10</RowLimit></View>'
&@target='<host web url>'",
method: "POST",
headers: { "accept": "application/json; odata=verbose" },
success: successHandler,
error: errorHandler
});
RenderListFormData メソッド
エンドポイント |
/renderlistformdata(itemid, formid, mode) |
パラメーター |
|
HTTP method |
POST |
応答 |
型: String |
要求の例
executor.executeAsync({
url: "<app web url>/_api/SP.AppContextSite(@target)/web/lists(guid'51925dd7-2108-481a-b1ef-4bfa4e69d48b')
/renderlistformdata(itemid=4, formid='e8b2f6e3-1081-4b18-833b-475f76473cde', mode=2)
?@target='<host web url>'",
method: "POST",
headers: { "accept": "application/json; odata=verbose" },
success: successHandler,
error: errorHandler
});
ReserveListItemId メソッド
idempotent リスト アイテム作成のリスト アイテム ID を予約します。
エンドポイント |
/reservelistitemid |
パラメーター |
なし |
HTTP method |
POST |
応答 |
型: Int32 |
要求の例
executor.executeAsync({
url: "<app web url>/_api/SP.AppContextSite(@target)/web/lists(guid'51925dd7-2108-481a-b1ef-4bfa4e69d48b')
/reservelistitemid
?@target='<host web url>'",
method: "POST",
headers: { "accept": "application/json; odata=verbose" },
success: successHandler,
error: errorHandler
});
ResetRoleInheritance メソッド
セキュリティ設定が可能なオブジェクトのロール継承をリセットし、ロールの割り当てをセキュリティ設定可能な親のオブジェクトから継承します。
エンドポイント |
/resetroleinheritance |
パラメーター |
なし |
HTTP method |
POST |
応答 |
なし |
要求の例
executor.executeAsync({
url: "<app web url>/_api/SP.AppContextSite(@target)/web
/lists(guid'a290086b-2d43-4151-add4-893474a930a9')/items(2)
/resetroleinheritance
?@target='<host web url>'",
method: "POST",
success: successHandler,
error: errorHandler
});
OData 表現
次の例は、JSON 形式での List リソースを表しています。
{"d":{
"__metadata":{
"id":"http://<site url>/_api/Web/Lists(guid'8ade7551-f53c-48c5-9d2b-e89f6528cf47')",
"uri":"http://<site url>/_api/Web/Lists(guid'8ade7551-f53c-48c5-9d2b-e89f6528cf47')",
"etag":"\"0\"",
"type":"SP.List"
},
"FirstUniqueAncestorSecurableObject":{"__deferred":{"uri":"http://<site url>/_api/Web/Lists(guid'8ade7551-f53c-48c5-9d2b-e89f6528cf47')/FirstUniqueAncestorSecurableObject"}},
"RoleAssignments":{"__deferred":{"uri":"http://<site url>/_api/Web/Lists(guid'8ade7551-f53c-48c5-9d2b-e89f6528cf47')/RoleAssignments"}},
"ContentTypes":{"__deferred":{"uri":"http://<site url>/_api/Web/Lists(guid'8ade7551-f53c-48c5-9d2b-e89f6528cf47')/ContentTypes"}},
"DefaultView":{"__deferred":{"uri":"http://<site url>/_api/Web/Lists(guid'8ade7551-f53c-48c5-9d2b-e89f6528cf47')/DefaultView"}},
"EventReceivers":{"__deferred":{"uri":"http://<site url>/_api/Web/Lists(guid'8ade7551-f53c-48c5-9d2b-e89f6528cf47')/EventReceivers"}},
"Fields":{"__deferred":{"uri":"http://<site url>/_api/Web/Lists(guid'8ade7551-f53c-48c5-9d2b-e89f6528cf47')/Fields"}},
"Forms":{"__deferred":{"uri":"http://<site url>/_api/Web/Lists(guid'8ade7551-f53c-48c5-9d2b-e89f6528cf47')/Forms"}},
"InformationRightsManagementSettings":{"__deferred":{"uri":"http://<site url>/_api/Web/Lists(guid'8ade7551-f53c-48c5-9d2b-e89f6528cf47')/InformationRightsManagementSettings"}},
"AllowContentTypes":true,
"BaseTemplate":100,
"BaseType":0,
"ContentTypesEnabled":false,
"Created":"2013-02-02T21:11:56Z",
"DefaultContentApprovalWorkflowId":"00000000-0000-0000-0000-000000000000",
"Description":"",
"Direction":"none",
"DocumentTemplateUrl":null,
"DraftVersionVisibility":0,
"EnableAttachments":true,
"EnableFolderCreation":false,
"EnableMinorVersions":false,
"EnableModeration":false,
"EnableVersioning":false,
"EntityTypeName":"ANewList",
"ForceCheckout":false,
"HasExternalDataSource":false,
"Hidden":false,
"Id":"8ade7551-f53c-48c5-9d2b-e89f6528cf47",
"ImageUrl":"/_layouts/15/images/itgen.png?rev=23",
"IrmEnabled":false,
"IrmExpire":false,
"IrmReject":false,
"IsApplicationList":false,
"IsCatalog":false,
"IsPrivate":false,
"ItemCount":1,
"LastItemDeletedDate":"2013-02-02T21:11:56Z",
"LastItemModifiedDate":"2013-02-03T22:17:55Z",
"ListItemEntityTypeFullName":"SP.Data.ANewListItem",
"MultipleDataList":false,
"NoCrawl":false,
"ParentWebUrl":"/",
"ServerTemplateCanCreateFolders":true,
"TemplateFeatureId":"00bfea71-de22-43b2-a848-c05709900100",
"Title":"ANewList"
}}
ListCollection リソース
リストのコレクションを表します。
エンドポイント URI | メソッド | OData 表現
エンドポイント URI
http://<site url>/web/lists
サポートされる HTTP メソッド
GET | POST
要求の例
GET 要求の例: ルート サイトでリストを取得します
executor.executeAsync({
url: "<app web url>/_api/SP.AppContextSite(@target)/web/lists
?@target='<host web url>'",
method: "GET",
headers: { "accept": "application/json; odata=verbose" },
success: successHandler,
error: errorHandler
});
GET 要求の例: タイトルでリストを取得します
executor.executeAsync({
url: "<app web url>/_api/SP.AppContextSite(@target)/web
/lists/getbytitle('Access Requests')
?@target='<host web url>'",
method: "GET",
headers: { "accept": "application/json; odata=verbose" },
success: successHandler,
error: errorHandler
});
GET 要求の例: ID でリストを取得します
executor.executeAsync({
url: "<app web url>/_api/SP.AppContextSite(@target)/web
/lists(guid'51925dd7-2108-481a-b1ef-4bfa4e69d48b')
?@target='<host web url>'",
method: "GET",
headers: { "accept": "application/json; odata=verbose" },
success: successHandler,
error: errorHandler
});
POST 要求の例: リストを作成します
executor.executeAsync({
url: "<app web url>/_api/SP.AppContextSite(@target)/web/lists
?@target='<host web url>'",
method: "POST",
body: "{ '__metadata': { 'type': 'SP.List' }, 'AllowContentTypes': true, 'BaseTemplate': 100,
'ContentTypesEnabled': true, 'Description': 'My list description', 'Title': 'Test title' }",
headers: { "content-type": "application/json;odata=verbose" },
success: successHandler,
error: errorHandler
});
ListCollection メソッド
EnsureSiteAssetsLibrary
EnsureSitePagesLibrary
GetById
GetByTitle
EnsureSiteAssetsLibrary メソッド
ユーザーが自分の Wiki ページにアップロードする、イメージまたはその他のファイルの既定のアセットの場所であるリストを取得します。
エンドポイント |
/ensuresiteassetslibrary |
パラメーター |
なし |
HTTP method |
POST |
応答 |
型: SP.List |
要求の例
executor.executeAsync({
url: "<app web url>/_api/SP.AppContextSite(@target)/web/lists
/ensuresiteassetslibrary
?@target='<host web url>'",
method: "POST",
headers: { "accept": "application/json; odata=verbose" },
success: successHandler,
error: errorHandler
});
EnsureSitePagesLibrary メソッド
Wiki ページの既定の場所であるリストを取得します。
エンドポイント |
/ensuresitepageslibrary |
パラメーター |
なし |
HTTP method |
POST |
応答 |
型: SP.List |
要求の例
executor.executeAsync({
url: "<app web url>/_api/SP.AppContextSite(@target)/web/lists
/ensuresitepageslibrary
?@target='<host web url>'",
method: "POST",
headers: { "accept": "application/json; odata=verbose" },
success: successHandler,
error: errorHandler
});
GetById メソッド
指定されたリスト識別子を持つリストを返します。
エンドポイント |
/getbyid |
パラメーター |
型: String |
HTTP method |
GET |
応答 |
型: SP.List |
要求の例
executor.executeAsync({
url: "<app web url>/_api/SP.AppContextSite(@target)/web/lists
/getbyid('51925dd7-2108-481a-b1ef-4bfa4e69d48b')
?@target='<host web url>'",
method: "GET",
headers: { "accept": "application/json; odata=verbose" },
success: successHandler,
error: errorHandler
});
または、単にリスト ID を ListCollection リソースに渡すことができます。例: …/web/lists(guid'51925dd7-2108-481a-b1ef-4bfa4e69d48b')
GetByTitle メソッド
指定されたタイトルを持つリストをコレクションから返します。
エンドポイント |
/getbytitle |
パラメーター |
型: String |
HTTP method |
GET |
応答 |
型: SP.List |
要求の例
executor.executeAsync({
url: "<app web url>/_api/SP.AppContextSite(@target)/web/lists
/getbytitle('Access Requests')
?@target='<host web url>'",
method: "GET",
headers: { "accept": "application/json; odata=verbose" },
success: successHandler,
error: errorHandler
});
OData 表現
次の例は、JSON 形式での ListCollection リソースを表しています。
{"d":{
"results":[{
"__metadata":{"id":"https://<site url>/_api/Web/Lists(guid'51925dd7-2108-481a-b1ef-4bfa4e69d48b')",
"uri":"https://<site url>/_api/Web/Lists(guid'51925dd7-2108-481a-b1ef-
4bfa4e69d48b')",
"etag":"\"6\"",
"type":"SP.List"
},
"FirstUniqueAncestorSecurableObject":{"__deferred":{"uri":"https://<site url>/_api/Web/Lists(guid'51925dd7-2108-481a-b1ef-4bfa4e69d48b')/FirstUniqueAncestorSecurableObject"}},
"RoleAssignments":{"__deferred":{"uri":"https://<site url>/_api/Web/Lists(guid'51925dd7-2108-481a-b1ef-4bfa4e69d48b')/RoleAssignments"}},
"ContentTypes":{"__deferred":{"uri":"https://<site url>/_api/Web/Lists(guid'51925dd7-2108-481a-b1ef-4bfa4e69d48b')/ContentTypes"}},
"DefaultView":{"__deferred":{"uri":"https://<site url>/_api/Web/Lists(guid'51925dd7-2108-481a-b1ef-4bfa4e69d48b')/DefaultView"}},
"EventReceivers":{"__deferred":{"uri":"https://<site url>/_api/Web/Lists(guid'51925dd7-2108-481a-b1ef-4bfa4e69d48b')/EventReceivers"}},
"Fields":{"__deferred":{"uri":"https://<site url>/_api/Web/Lists(guid'51925dd7-2108-481a-b1ef-4bfa4e69d48b')/Fields"}},
"Forms":{"__deferred":{"uri":"https://<site url>/_api/Web/Lists(guid'51925dd7-2108-481a-b1ef-4bfa4e69d48b')/Forms"}},
"InformationRightsManagementSettings":{"__deferred":{"uri":"https://<site url>/_api/Web/Lists(guid'51925dd7-2108-481a-b1ef-4bfa4e69d48b')/InformationRightsManagementSettings"}},
"Items":{"__deferred":{"uri":"https://<site url>/_api/Web/Lists(guid'51925dd7-2108-481a-b1ef-4bfa4e69d48b')/Items"}},
"ParentWeb":{"__deferred":{"uri":"https://<site url>/_api/Web/Lists(guid'51925dd7-2108-481a-b1ef-4bfa4e69d48b')/ParentWeb"}},
"RootFolder":{"__deferred":{"uri":"https://<site url>/_api/Web/Lists(guid'51925dd7-2108-481a-b1ef-4bfa4e69d48b')/RootFolder"}},
"UserCustomActions":{"__deferred":{"uri":"https://<site url>/_api/Web/Lists(guid'51925dd7-2108-481a-b1ef-4bfa4e69d48b')/UserCustomActions"}},
"Views":{"__deferred":{"uri":"https://<site url>/_api/Web/Lists(guid'51925dd7-2108-481a-b1ef-4bfa4e69d48b')/Views"}},
"WorkflowAssociations":{"__deferred":{"uri":"https://<site url>/_api/Web/Lists(guid'51925dd7-2108-481a-b1ef-4bfa4e69d48b')/WorkflowAssociations"}},
"AllowContentTypes":true,
"BaseTemplate":160,"BaseType":0,
"ContentTypesEnabled":true,
"Created":"2013-06-10T17:14:49Z",
"DefaultContentApprovalWorkflowId":"00000000-0000-0000-0000-000000000000",
"Description":"Use this list to track access requests to a site or uniquely permissioned items in the site.",
"Direction":"none",
"DocumentTemplateUrl":null,
"DraftVersionVisibility":0,
"EnableAttachments":false,
"EnableFolderCreation":false,
"EnableMinorVersions":false,
"EnableModeration":false,
"EnableVersioning":true,
"EntityTypeName":"Access_x0020_Requests",
"ForceCheckout":false,
"HasExternalDataSource":false,
"Hidden":true,
"Id":"51925dd7-2108-481a-b1ef-4bfa4e69d48b",
"ImageUrl":"/_layouts/15/images/itgen.gif?rev=26",
"IrmEnabled":false,
"IrmExpire":false,
"IrmReject":false,
"IsApplicationList":false,
"IsCatalog":false,
"IsPrivate":false,
"ItemCount":3,
"LastItemDeletedDate":"2013-06-10T17:14:49Z",
"LastItemModifiedDate":"2013-06-10T17:20:48Z",
"ListItemEntityTypeFullName":"SP.Data.Access_x0020_RequestsItem",
"MultipleDataList":false,
"NoCrawl":true,
"ParentWebUrl":"/",
"ServerTemplateCanCreateFolders":true,
"TemplateFeatureId":"a0f12ee4-9b60-4ba4-81f6-75724f4ca973",
"Title":"Access Requests"},
{
"__metadata":{
"id":"https://<site url>/_api/Web/Lists(guid'482e418a-0900-414b-8902-02248c2e44e8')",
"uri":"https://<site url>/_api/Web/Lists(guid'482e418a-0900-414b-8902-
02248c2e44e8')",
"etag":"\"1\"",
"type":"SP.List"
},
"FirstUniqueAncestorSecurableObject":{"__deferred":{"uri":"https://<site url>/_api/Web/Lists(guid'482e418a-0900-414b-8902-
02248c2e44e8')/FirstUniqueAncestorSecurableObject"}},
"RoleAssignments":{"__deferred":{"uri":"https://<site url>/_api/Web/Lists(guid'482e418a-0900-414b-8902-02248c2e44e8')/RoleAssignments"}},
"ContentTypes":{"__deferred":{"uri":"https://<site url>/_api/Web/Lists(guid'482e418a-0900-414b-8902-02248c2e44e8')/ContentTypes"}},
"DefaultView":{"__deferred":{"uri":"https://<site url>/_api/Web/Lists(guid'482e418a-0900-414b-8902-02248c2e44e8')/DefaultView"}},
"EventReceivers":{"__deferred":{"uri":"https://<site url>/_api/Web/Lists(guid'482e418a-0900-414b-8902-02248c2e44e8')/EventReceivers"}},
"Fields":{"__deferred":{"uri":"https://<site url>/_api/Web/Lists(guid'482e418a-0900-414b-8902-02248c2e44e8')/Fields"}},
"Forms":{"__deferred":{"uri":"https://<site url>/_api/Web/Lists(guid'482e418a-0900-414b-8902-02248c2e44e8')/Forms"}},
"InformationRightsManagementSettings":{"__deferred":{"uri":"https://<site url>/_api/Web/Lists(guid'482e418a-0900-414b-8902-02248c2e44e8')/InformationRightsManagementSettings"}},
"Items":{"__deferred":{"uri":"https://<site url>/_api/Web/Lists(guid'482e418a-0900-414b-8902-02248c2e44e8')/Items"}},
"ParentWeb":{"__deferred":{"uri":"https://<site url>/_api/Web/Lists(guid'482e418a-0900-414b-8902-02248c2e44e8')/ParentWeb"}},
"RootFolder":{"__deferred":{"uri":"https://<site url>/_api/Web/Lists(guid'482e418a-0900-414b-8902-02248c2e44e8')/RootFolder"}},
"UserCustomActions":{"__deferred":{"uri":"https://<site url>/_api/Web/Lists(guid'482e418a-0900-414b-8902-02248c2e44e8')/UserCustomActions"}},
"Views":{"__deferred":{"uri":"https://<site url>/_api/Web/Lists(guid'482e418a-0900-414b-8902-02248c2e44e8')/Views"}},
"WorkflowAssociations":{"__deferred":{"uri":"https://<site url>/_api/Web/Lists(guid'482e418a-0900-414b-8902-02248c2e44e8')/WorkflowAssociations"}},
"AllowContentTypes":true,
"BaseTemplate":100,
"BaseType":0,
"ContentTypesEnabled":false,
"Created":"2013-02-02T21:11:56Z",
"DefaultContentApprovalWorkflowId":"00000000-0000-0000-0000-000000000000",
"Description":"",
"Direction":"none",
"DocumentTemplateUrl":null,
"DraftVersionVisibility":0,
"EnableAttachments":true,
"EnableFolderCreation":false,
"EnableMinorVersions":false,
"EnableModeration":false,
"EnableVersioning":false,
"EntityTypeName":"AList",
"ForceCheckout":false,
"HasExternalDataSource":false,
"Hidden":false,
"Id":"482e418a-0900-414b-8902-02248c2e44e8",
"ImageUrl":"/_layouts/15/images/itgen.png?rev=23",
"IrmEnabled":false,
"IrmExpire":false,
"IrmReject":false,
"IsApplicationList":false,
"IsCatalog":false,
"IsPrivate":false,
"ItemCount":3,
"LastItemDeletedDate":"2013-02-02T21:11:56Z",
"LastItemModifiedDate":"2013-06-26T22:31:03Z",
"ListItemEntityTypeFullName":"SP.Data.AListListItem",
"MultipleDataList":false,
"NoCrawl":false,
"ParentWebUrl":"/",
"ServerTemplateCanCreateFolders":true,
"TemplateFeatureId":"00bfea71-de22-43b2-a848-c05709900100",
"Title":"AList"
}]
}}
ListItem リソース
リスト内のアイテムまたは行を表します。 リスト アイテムは SP.SecurableObject の一種です。
エンドポイント URI | プロパティ | メソッド | OData 表現
注意
OData の $skip クエリ オプションは、このエンドポイントでは機能しません。
エンドポイント URI
http://<site url>/web/lists(guid'<list id>')/items(<item id>)
http://<site url>/web/lists/getbytitle('<list title>')/items(<item id>)
サポートされる HTTP メソッド
GET | POST | DELETE | MERGE
要求の例
GET 要求の例: リスト アイテムを取得します
executor.executeAsync({
url: "<app web url>/_api/SP.AppContextSite(@target)/web
/lists(guid'a290086b-2d43-4151-add4-893474a930a9')/items(2)
?@target='<host web url>'",
method: "GET",
headers: { "accept": "application/json; odata=verbose" },
success: successHandler,
error: errorHandler
});
POST 要求の例: リスト アイテムを作成します
executor.executeAsync({
url: "<app web url>/_api/SP.AppContextSite(@target)/web
/lists(guid'a290086b-2d43-4151-add4-893474a930a9')/items
?@target='<host web url>'",
method: "POST",
body: "{ '__metadata': { 'type': 'SP.Data.Team_x0020_tasksListItem' },
'Title': 'Teams incorporate feedback', 'AssignedToId': {"results":[1]},
'StartDate':'2014-01-29T08:00:00Z', 'DueDate':'2014-01-31T08:00:00Z',
'PredecessorsId': {"results":[4]}}",
headers: {
"accept": "application/json;odata=verbose",
"content-type": "application/json;odata=verbose"
},
success: successHandler,
error: errorHandler
});
注意
リスト アイテムを作成または変更するには、リストの ListItemEntityTypeFullName プロパティを把握し、それを HTTP 要求の本文で type の値として渡す必要があります。
例
MERGE 要求の例: リスト アイテムを変更します
executor.executeAsync({
url: "<app web url>/_api/SP.AppContextSite(@target)/web
/lists(guid'a290086b-2d43-4151-add4-893474a930a9')/items(2)
?@target='<host web url>'",
method: "POST",
body: "{ '__metadata': { 'type': 'SP.Data.Team_x0020_tasksListItem' },
'Priority': '(1) High', 'Status': 'In Progress', 'PercentComplete': 0.3 }",
headers: {
"IF-MATCH": "*",
"content-type": "application/json;odata=verbose",
"X-HTTP-Method": "MERGE"
},
success: successHandler,
error: errorHandler
});
注意
リスト アイテムを作成または変更するには、リストの ListItemEntityTypeFullName プロパティを把握し、それを HTTP 要求の本文で type の値として渡す必要があります。
DELETE 要求の例: リスト アイテムを削除します
executor.executeAsync({
url: "<app web url>/_api/SP.AppContextSite(@target)/web
/lists(guid'a290086b-2d43-4151-add4-893474a930a9')/items(2)
?@target='<host web url>'",
method: "POST",
headers: {
"IF-MATCH”: "*",
"X-HTTP-Method": "DELETE"
},
success: successHandler,
error: errorHandler
});
リサイクル操作の GUID を取得するには、アイテムの Recycle メソッドを使用します。
ListItem のプロパティ
プロパティ |
型 |
R/W |
説明 |
|
---|---|---|---|---|
AttachmentFiles |
SP.AttachmentCollection |
R |
いいえ |
リスト アイテムに関連付けられた添付ファイルのコレクションを指定します。 |
ContentType |
SP.ContentType |
R |
いいえ |
リスト アイテムのコンテンツ タイプを示す値を取得します。 |
DisplayName |
String |
R |
はい (「Title」 値として表示されます) |
リスト アイテムの表示名を示す値を取得します。 |
EffectiveBasePermissions |
R |
はい |
現在のユーザーに割り当てられている、リスト アイテムに対する有効なアクセス許可を示す値を取得します。 |
|
EffectiveBasePermissionsForUI |
R |
はい |
UI に表示される、現在のユーザーの有効な基本的アクセス許可を取得します。 |
|
FieldValuesAsHtml |
SP.FieldStringValues |
R |
いいえ |
リスト アイテムに関する値を HTML として取得します。 |
FieldValuesAsText |
SP.FieldStringValues |
R |
いいえ |
リスト アイテムのフィールド値を文字列値のコレクションとして取得します。 |
FieldValuesForEdit |
SP.FieldStringValues |
R |
いいえ |
編集フォームに表示される書式設定された値を取得します。 |
File |
R |
いいえ |
アイテムによって表されるファイルをドキュメント ライブラリから取得します。 |
|
FileSystemObjectType |
Int32 |
R |
はい |
リスト アイテムがファイルであるかリスト フォルダーであるかを示す値を取得します。SP.FileSystemObjectType 値を表します。無効 = -1、ファイル = 0、フォルダー = 1、Web = 2。 |
FirstUniqueAncestorSecurableObject |
SP.SecurableObject |
R |
いいえ |
このオブジェクトのロール割り当てが定義されたオブジェクトを取得します。 ロール割り当てが現在のオブジェクトで直接定義される場合は、現在のオブジェクトが返されます。 |
Folder |
R |
いいえ |
フォルダー アイテムに関連付けられたフォルダー オブジェクトを取得します。 |
|
HasUniqueRoleAssignments |
Boolean |
R |
いいえ |
ロールの割り当てがこのセキュリティ設定可能なオブジェクトで一意に定義されるか、それともセキュリティ設定可能な親オブジェクトから継承されるかを指定する値を取得します。 |
Id |
Int32 |
R |
はい |
リスト アイテム識別子を示す値を取得します。 |
ParentList |
R |
いいえ |
リスト アイテムが含まれている親リストを取得します。 |
|
RoleAssignments |
R |
いいえ |
セキュリティ設定が可能なオブジェクトのロールの割り当てを取得します。 |
ListItem メソッド
BreakRoleInheritance
DeleteObject
GetUserEffectivePermissions
Recycle
ResetRoleInheritance
ValidateUpdateListItem
BreakRoleInheritance メソッド
セキュリティ設定が可能なオブジェクトの一意なロール割り当てを作成します。
エンドポイント |
/breakroleinheritance(copyroleassignments, clearsubscopes) |
パラメーター |
|
HTTP method |
POST |
応答 |
なし |
要求の例
executor.executeAsync({
url: "<app web url>/_api/SP.AppContextSite(@target)/web
/lists(guid'a290086b-2d43-4151-add4-893474a930a9')/items(2)
/breakroleinheritance(copyroleassignments=true, clearsubscopes=false)
?@target='<host web url>'",
method: "POST",
success: successHandler,par
error: errorHandler
});
DeleteObject メソッド
例
GetUserEffectivePermissions メソッド
指定されたユーザーがリスト アイテムに対して持っている有効なアクセス許可を取得します。
エンドポイント |
/getusereffectivepermissions(@v)?@v='<ユーザー ログイン名>' |
パラメーター |
型: String |
HTTP method |
GET |
応答 |
型: SP.BasePermissions |
要求の例
executor.executeAsync({
url: "<app web url>/_api/SP.AppContextSite(@target)/web
/lists(guid'a290086b-2d43-4151-add4-893474a930a9')/items(2)
/getusereffectivepermissions(@v)?@v='i%3A0%23.f%7Cmembership%7Cuser%40domain.onmicrosoft.com'
&@target='<host web url>'",
method: "GET",
headers: { "accept": "application/json; odata=verbose" },
success: successHandler,
error: errorHandler
});
Recycle メソッド
リスト アイテムをごみ箱に移動し、新しいごみ箱アイテムの識別子を返します。
エンドポイント |
/recycle |
パラメーター |
なし |
HTTP method |
POST |
応答 |
型: GUID |
要求の例
executor.executeAsync({
url: "<app web url>/_api/SP.AppContextSite(@target)/web
/lists(guid'a290086b-2d43-4151-add4-893474a930a9')/items(2)
/recycle
?@target='<host web url>'",
method: "POST",
headers: { "accept": "application/json; odata=verbose" },
success: successHandler,
error: errorHandler
});
ResetRoleInheritance メソッド
セキュリティ設定が可能なオブジェクトのロール継承をリセットし、ロールの割り当てをセキュリティ設定可能な親のオブジェクトから継承します。
エンドポイント |
/resetroleinheritance |
パラメーター |
なし |
HTTP method |
POST |
応答 |
なし |
要求の例
executor.executeAsync({
url: "<app web url>/_api/SP.AppContextSite(@target)/web
/lists(guid'a290086b-2d43-4151-add4-893474a930a9')/items(2)
/resetroleinheritance
?@target='<host web url>'",
method: "POST",
success: successHandler,
error: errorHandler
});
ValidateUpdateListItem メソッド
リスト アイテムのフィールドの指定されたコレクションの値を検証して設定します。
エンドポイント |
/validateupdatelistitem |
パラメーター |
|
HTTP method |
POST |
応答 |
型: SP.ListItemFormUpdateValue[] |
要求の例
executor.executeAsync({
url: "<app web url>/_api/SP.AppContextSite(@target)/web
/lists(guid'a290086b-2d43-4151-add4-893474a930a9')/items(2)
/validateupdatelistitem
?@target='<host web url>'",
method: "POST",
body: "{ 'formValues':[{'FieldName':'Status', 'FieldValue':'Deferred'},
{'FieldName':'StartDate', 'FieldValue':'12/31/2014'}], 'bNewDocumentUpdate': false }",
headers: {
"accept": "application/json; odata=verbose",
"content-type": "application/json;odata=verbose"
},
success: successHandler,
error: errorHandler
});
応答の例
{"d":{
"ValidateUpdateListItem":{"results":[
{
"__metadata":{"type":"SP.ListItemFormUpdateValue"},
"ErrorMessage":null,
"FieldName":"Status",
"FieldValue":"Deferred",
"HasException":false
},{
"__metadata":{"type":"SP.ListItemFormUpdateValue"},
"ErrorMessage":null,
"FieldName":"StartDate",
"FieldValue":"12/31/2014",
"HasException":false
}
]}
}}
OData 表現
次の例は、JSON 形式での ListItem リソースを表しています。リソースはそのフィールド値も返します。
{"d":{
"__metadata":{,
"id":"2bbdaee6-1172-4e36-9f90-ce35ec9b6207",
"uri":"http://<site url>/_api/Web/Lists(guid'a290086b-2d43-4151-add4-893474a930a9')/Items(2)",
"etag":"\"1\"",
"type":"SP.Data.Team_x0020_tasksListItem"
},
"FirstUniqueAncestorSecurableObject":{"__deferred":{"uri":"http://<site url>/_api/Web/Lists(guid'a290086b-2d43-4151-add4-893474a930a9')/Items(2)/FirstUniqueAncestorSecurableObject"}},
"RoleAssignments":{"__deferred":{"uri":"http://<site url>/_api/Web/Lists(guid'a290086b-2d43-4151-add4-893474a930a9')/Items(2)/RoleAssignments"}},
"AttachmentFiles":{"__deferred":{"uri":"http://<site url>/_api/Web/Lists(guid'a290086b-2d43-4151-add4-893474a930a9')/Items(2)/AttachmentFiles"}},
"ContentType":{"__deferred":{"uri":"http://<site url>/_api/Web/Lists(guid'a290086b-2d43-4151-add4-893474a930a9')/Items(2)/ContentType"}},
"FieldValuesAsHtml":{"__deferred":{"uri":"http://<site url>/_api/Web/Lists(guid'a290086b-2d43-4151-add4-893474a930a9')/Items(2)/FieldValuesAsHtml"}},
"FieldValuesAsText":{"__deferred":{"uri":"http://<site url>/_api/Web/Lists(guid'a290086b-2d43-4151-add4-893474a930a9')/Items(2)/FieldValuesAsText"}},
"FieldValuesForEdit":{"__deferred":{"uri":"http://<site url>/_api/Web/Lists(guid'a290086b-2d43-4151-add4-893474a930a9')/Items(2)/FieldValuesForEdit"}},
"File":{"__deferred":{"uri":"http://<site url>/_api/Web/Lists(guid'a290086b-2d43-4151-add4-893474a930a9')/Items(2)/File"}},
"Folder":{"__deferred":{"uri":"http://<site url>/_api/Web/Lists(guid'a290086b-2d43-4151-add4-893474a930a9')/Items(2)/Folder"}},
"ParentList":{"__deferred":{"uri":"http://<site url>/_api/Web/Lists(guid'a290086b-2d43-4151-add4-893474a930a9')/Items(2)/ParentList"}},
"FileSystemObjectType":0,
"Id":2,
"ID":2,
"ContentTypeId":"0x0108004F8963A897E4E64A83E990C1B6B65770",
"Title":"Assign teams",
"Modified":"2013-09-03T17:50:30Z",
"Created":"2013-09-03T17:50:30Z",
"AuthorId":1073741823,
"EditorId":1073741823,
"OData__UIVersionString":"1.0",
"Attachments":false,
"GUID":"ce6e516e-2da4-4a3e-9325-daf7d7f61490",
"PredecessorsId":{"results":[1]},
"Priority":"(2) Normal",
"Status":"Not Started",
"PercentComplete":0,
"AssignedToId":{"results":[1]},
"Body":null,
"StartDate":"2014-01-02T08:00:00Z",
"DueDate":"2014-01-02T08:00:00Z",
"Checkmark":"0",
"RelatedItems":null
}}
ListItemCollection リソース
ListItem リソースのコレクションを表します。
エンドポイント URI | メソッド | OData 表現
エンドポイント URI
http://<site url>/web/lists(guid'<list id>')/items
http://<site url>/web/lists/getbytitle('<list title>')/items
サポートされる HTTP メソッド
GET | POST
要求の例
GET 要求の例: リスト アイテムを取得します
executor.executeAsync({
url: "<app web url>/_api/SP.AppContextSite(@target)/web
/lists(guid'a290086b-2d43-4151-add4-893474a930a9')/items
?@target='<host web url>'",
method: "GET",
headers: { "accept": "application/json; odata=verbose" },
success: successHandler,
error: errorHandler
});
GET 要求の例: リスト アイテムを取得します
executor.executeAsync({
url: "<app web url>/_api/SP.AppContextSite(@target)/web
/lists(guid'a290086b-2d43-4151-add4-893474a930a9')/items(2)
?@target='<host web url>'",
method: "GET",
headers: { "accept": "application/json; odata=verbose" },
success: successHandler,
error: errorHandler
});
OData クエリ操作を使用して特定のアイテムをフィルター処理できます (例: …/lists(guid'51925dd7-2108-481a-b1ef-4bfa4e69d48b')/items?$filter=Status eq 'not started'&$select=Title&$top=5)。
POST 要求の例: リスト アイテムを作成します
executor.executeAsync({
url: "<app web url>/_api/SP.AppContextSite(@target)/web
/lists(guid'a290086b-2d43-4151-add4-893474a930a9')/items
?@target='<host web url>'",
method: "POST",
body: "{ '__metadata': { 'type': 'SP.Data.Team_x0020_tasksListItem' },
'Title': 'Teams incorporate feedback', 'AssignedToId': {"results":[1]},
'StartDate':'2014-01-29T08:00:00Z', 'DueDate':'2014-01-31T08:00:00Z',
'PredecessorsId': {"results":[4]} }",
headers: {
"accept": "application/json;odata=verbose",
"content-type": "application/json;odata=verbose"
},
success: successHandler,
error: errorHandler
});
注意
リスト アイテムを作成または変更するには、リストの ListItemEntityTypeFullName プロパティを把握し、それを HTTP 要求の本文で type の値として渡す必要があります。
例
ListItemCollection メソッド
GetById メソッド
指定されたリスト アイテム識別子を持つリスト アイテムを返します。
エンドポイント |
/getbyid(<アイテム id>) |
パラメーター |
型: Int32 |
HTTP method |
GET |
応答 |
型: SP.ListItem |
要求の例
executor.executeAsync({
url: "<app web url>/_api/SP.AppContextSite(@target)/web
/lists(guid'a290086b-2d43-4151-add4-893474a930a9')/items
/getbyid(2)
?@target='<host web url>'",
method: "GET",
headers: { "accept": "application/json; odata=verbose" },
success: successHandler,
error: errorHandler
});
または、単に ListItemCollection リソースでリスト アイテム ID を指定できます。例: …/_api/web/lists(guid'a290086b-2d43-4151-add4-893474a930a9')/items(2).
OData 表現
次の例は、 ListItem リソースのコレクションを返すJSON 形式での ListItemCollection リソースを表しています。
{"d":{
"results":[{
"__metadata":{
"id":"dd9ab60c-4653-4654-85de-1d090f0d416f",
"uri":"http://<site url>/_api/Web/Lists(guid'a290086b-2d43-4151-add4-893474a930a9')/Items(1)",
"etag":"\"1\"",
"type":"SP.Data.Team_x0020_tasksListItem"
},
"FirstUniqueAncestorSecurableObject":{"__deferred":{"uri":"http://<site url>/_api/Web/Lists(guid'a290086b-2d43-4151-add4-893474a930a9')/Items(1)/FirstUniqueAncestorSecurableObject"}},
"RoleAssignments":{"__deferred":{"uri":"http://<site url>/_api/Web/Lists(guid'a290086b-2d43-4151-add4-893474a930a9')/Items(1)/RoleAssignments"}},
"AttachmentFiles":{"__deferred":{"uri":"http://<site url>/_api/Web/Lists(guid'a290086b-2d43-4151-add4-893474a930a9')/Items(1)/AttachmentFiles"}},
"ContentType":{"__deferred":{"uri":"http://<site url>/_api/Web/Lists(guid'a290086b-2d43-4151-add4-893474a930a9')/Items(1)/ContentType"}},
"FieldValuesAsHtml":{"__deferred":{"uri":"http://<site url>/_api/Web/Lists(guid'a290086b-2d43-4151-add4-893474a930a9')/Items(1)/FieldValuesAsHtml"}},
"FieldValuesAsText":{"__deferred":{"uri":"http://<site url>/_api/Web/Lists(guid'a290086b-2d43-4151-add4-893474a930a9')/Items(1)/FieldValuesAsText"}},
"FieldValuesForEdit":{"__deferred":{"uri":"http://<site url>/_api/Web/Lists(guid'a290086b-2d43-4151-add4-893474a930a9')/Items(1)/FieldValuesForEdit"}},
"File":{"__deferred":{"uri":"http://<site url>/_api/Web/Lists(guid'a290086b-2d43-4151-add4-893474a930a9')/Items(1)/File"}},
"Folder":{"__deferred":{"uri":"http://<site url>/_api/Web/Lists(guid'a290086b-2d43-4151-add4-893474a930a9')/Items(1)/Folder"}},
"ParentList":{"__deferred":{"uri":"http://<site url>/_api/Web/Lists(guid'a290086b-2d43-4151-add4-893474a930a9')/Items(1)/ParentList"}},
"FileSystemObjectType":0,
"Id":1,
"ID":1,
"ContentTypeId":"0x0108004F8963A897E4E64A83E990C1B6B65770",
"Title":"Triage requests",
"Modified":"2013-09-03T17:49:26Z",
"Created":"2013-09-03T17:49:26Z",
"AuthorId":1073741823,
"EditorId":1073741823,
"OData__UIVersionString":"1.0",
"Attachments":false,
"GUID":"e132ef1b-698e-4d21-ba1b-29fa5c38fe8e",
"PredecessorsId":{"results":[]},
"Priority":"(2) Normal",
"Status":"Not Started",
"PercentComplete":0,
"AssignedToId":{"results":[1,21]},
"Body":null,
"StartDate":"2014-01-01T08:00:00Z",
"DueDate":"2014-01-02T08:00:00Z",
"Checkmark":"0",
"RelatedItems":null
},{
"__metadata":{
"id":"687e63a4-ed44-4bf2-881f-c83e5d3fd020",
"uri":"http://<site url>/_api/Web/Lists(guid'a290086b-2d43-4151-add4-893474a930a9')/Items(2)",
"etag":"\"5\"",
"type":"SP.Data.Team_x0020_tasksListItem"
},
"FirstUniqueAncestorSecurableObject":{"__deferred":{"uri":"http://<site url>/_api/Web/Lists(guid'a290086b-2d43-4151-add4-893474a930a9')/Items(2)/FirstUniqueAncestorSecurableObject"}},
"RoleAssignments":{"__deferred":{"uri":"http://<site url>/_api/Web/Lists(guid'a290086b-2d43-4151-add4-893474a930a9')/Items(2)/RoleAssignments"}},
"AttachmentFiles":{"__deferred":{"uri":"http://<site url>/_api/Web/Lists(guid'a290086b-2d43-4151-add4-893474a930a9')/Items(2)/AttachmentFiles"}},
"ContentType":{"__deferred":{"uri":"http://<site url>/_api/Web/Lists(guid'a290086b-2d43-4151-add4-893474a930a9')/Items(2)/ContentType"}},
"FieldValuesAsHtml":{"__deferred":{"uri":"http://<site url>/_api/Web/Lists(guid'a290086b-2d43-4151-add4-893474a930a9')/Items(2)/FieldValuesAsHtml"}},
"FieldValuesAsText":{"__deferred":{"uri":"http://<site url>/_api/Web/Lists(guid'a290086b-2d43-4151-add4-893474a930a9')/Items(2)/FieldValuesAsText"}},
"FieldValuesForEdit":{"__deferred":{"uri":"http://<site url>/_api/Web/Lists(guid'a290086b-2d43-4151-add4-893474a930a9')/Items(2)/FieldValuesForEdit"}},
"File":{"__deferred":{"uri":"http://<site url>/_api/Web/Lists(guid'a290086b-2d43-4151-add4-893474a930a9')/Items(2)/File"}},
"Folder":{"__deferred":{"uri":"http://<site url>/_api/Web/Lists(guid'a290086b-2d43-4151-add4-893474a930a9')/Items(2)/Folder"}},
"ParentList":{"__deferred":{"uri":"http://<site url>/_api/Web/Lists(guid'a290086b-2d43-4151-add4-893474a930a9')/Items(2)/ParentList"}},
"FileSystemObjectType":0,
"Id":2,
"ID":2,
"ContentTypeId":"0x0108004F8963A897E4E64A83E990C1B6B65770",
"Title":"Assign teams",
"Modified":"2013-09-03T19:24:51Z",
"Created":"2013-09-03T17:50:30Z",
"AuthorId":1073741823,
"EditorId":1073741823,
"OData__UIVersionString":"1.0",
"Attachments":false,
"GUID":"ce6e516e-2da4-4a3e-9325-daf7d7f61490",
"PredecessorsId":{"results":[1]},
"Priority":"(1) High",
"Status":"In Progress",
"PercentComplete":0.3,
"AssignedToId":{"results":[1]},
"Body":null,
"StartDate":"2014-01-02T08:00:00Z",
"DueDate":"2014-01-02T08:00:00Z",
"Checkmark":"0",
"RelatedItems":null
},{
…
}]
}}
リソースの表示
リスト ビューを指定します。
エンドポイント URI | プロパティ | メソッド | OData 表現
エンドポイント URI
http://<site url>/_api/web/lists(guid'<list id>')/views('<view id>')
サポートされる HTTP メソッド
GET | POST | DELETE | MERGE | PUT
要求の例
GET 要求の例: ビューを取得します
executor.executeAsync({
url: "<app web url>/_api/SP.AppContextSite(@target)/web
/lists(guid'da58632f-faf0-4a78-8219-99c307747741')
/views('0dc42244-4bae-4da9-b074-8b8e9d8e50bc')
?@target='<host web url>'",
method: "GET",
headers: { "accept": "application/json; odata=verbose" },
success: successHandler,
error: errorHandler
});
または、ViewCollection リソースから GetByTitle メソッドを使用してそのタイトル (大文字/小文字の区別が必要) を条件にしてビューを取得できます。例: …/web/lists(guid'da58632f-faf0-4a78-8219-99c307747741')/views/getbytitle('By Status')
MERGE 要求の例: ビューを変更します
executor.executeAsync({
url: "<app web url>/_api/SP.AppContextSite(@target)/web
/lists(guid'da58632f-faf0-4a78-8219-99c307747741')
/views('0dc42244-4bae-4da9-b074-8b8e9d8e50bc')
?@target='<host web url>'",
method: "POST",
body: "{ '__metadata': { 'type': 'SP.View' }, 'Title': 'New Mobile Default View',
'MobileDefaultView': true, 'RowLimit': 5 }",
headers: {
"content-type": "application/json;odata=verbose",
"X-HTTP-Method": "MERGE"
},
success: successHandler,
error: errorHandler
});
DELETE 要求の例: ビューを削除します
executor.executeAsync({
url: "<app web url>/_api/SP.AppContextSite(@target)/web
/lists(guid'da58632f-faf0-4a78-8219-99c307747741')
/views('0dc42244-4bae-4da9-b074-8b8e9d8e50bc')
?@target='<host web url>'",
method: "POST",
headers: { "X-HTTP-Method": "DELETE" },
success: successHandler,
error: errorHandler
});
例
View プロパティ
プロパティを取得するには、以下の例に示されているように、GET 要求をプロパティ エンドポイントに送信します。
executor.executeAsync({
url: "<app web url>/_api/SP.AppContextSite(@target)/web
/lists(guid'da58632f-faf0-4a78-8219-99c307747741')
/views('0dc42244-4bae-4da9-b074-8b8e9d8e50bc')/<property name>
?@target='<host web url>'",
method: "GET",
headers: { "accept": "application/json; odata=verbose" },
success: successHandler,
error: errorHandler
});
プロパティ |
型 |
R/W |
説明 |
|
---|---|---|---|---|
Aggregations |
String |
RW |
はい |
リスト ビューに表示される集計を定義するフィールドおよび関数を指定する値を取得または設定します。 null でない場合は、[MS-WSSCAML] に示されているように、XML は FieldRefDefinitionAggregation に適合する必要があります。 |
AggregationsStatus |
String |
RW |
はい |
集計がリスト ビューに表示されるかどうかを指定する値を取得または設定します。 |
BaseViewId |
String |
R |
はい |
リスト ビューのベース ビュー識別子を示す値を取得します。 |
ContentTypeId |
RW |
はい |
このコンテンツ タイプのフォルダーでのみ使用できるようにビューに関連付けられているコンテンツ タイプの識別子を取得または設定します。 |
|
DefaultView |
Boolean |
RW |
はい |
リスト ビューが既定のリスト ビューかどうかを指定する値を取得または設定します。 |
DefaultViewForContentType |
Boolean |
RW |
はい |
リスト ビューが contentTypeId によって指定されたコンテンツ タイプの既定のリストビューかどうかを指定する値を取得または設定します。 |
EditorModified |
Boolean |
RW |
はい |
リスト ビューがエディターで変更されたかどうかを示す値を取得または設定します。 |
Formats |
String |
RW |
はい |
リスト ビューの列および行の書式設定を指定する値を取得または設定します。 null でない場合は、[MS-WSSCAML] に示されているように、XML は ViewFormatDefinitions に適合する必要があります。 |
Hidden |
Boolean |
RW |
はい |
リスト ビューが非表示かどうかを指定する値を取得または設定します。 |
HtmlSchemaXml |
String |
R |
はい |
リスト ビューを表す XML ドキュメントを示す値を取得します。 |
Id |
GUID |
R |
はい |
リスト ビューのビュー識別子を示す値を取得します。 |
ImageUrl |
String |
R |
はい |
リスト ビューのイメージの URI (Uniform Resource Identifier) を示す値を取得します。 |
IncludeRootFolder |
Boolean |
RW |
はい |
現在のフォルダーがリスト ビューに表示されるかどうかを指定する値を取得または設定します。 |
JsLink |
String |
RW |
はい |
ビューに使われている JavaScript ファイルの名前を取得または設定します。 |
ListViewXml |
String |
RW |
はい |
ビューの XML を表す文字列を取得または設定します。 |
Method |
String |
RW |
はい |
リスト ビューの表示方法を指定する値を取得または設定します。 null でない場合は、[MS-WSSCAP] に示されているように、XML は メソッド に適合する必要があります。 |
MobileDefaultView |
Boolean |
RW |
はい |
リスト ビューが既定のモバイル リスト ビューかどうかを指定する値を取得または設定します。 |
MobileView |
Boolean |
RW |
はい |
リスト ビューがモバイル リスト ビューであるかどうかを指定する値を取得または設定します。 |
ModerationType |
String |
R |
はい |
リスト ビューのコンテンツ承認タイプを示す値を取得します。 |
OrderedView |
Boolean |
R |
はい |
リスト ビュー内でリスト アイテムを並べ替えることができるかどうかを示す値を取得します。 |
Paged |
Boolean |
RW |
はい |
リスト ビューがページ表示かどうかを指定する値を取得または設定します。 |
PersonalView |
Boolean |
R |
はい |
リスト ビューが個人用ビューかどうかを示す値を取得します。 |
ReadOnlyView |
Boolean |
R |
はい |
リスト ビューが読み取り専用かどうかを示す値を取得します。 |
RequiresClientIntegration |
Boolean |
R |
はい |
リスト ビューにクライアント統合の権利が必要かどうかを示す値を取得します。 |
RowLimit |
Int32 |
RW |
はい |
リスト ビューのビジュアル ページに表示するリスト アイテムの最大数を指定する値を取得または設定します。 |
Scope |
Int32 |
RW |
はい |
リスト ビューのスコープを指定する値を取得または設定します。ViewScope 値を表します。DefaultValue = 0、Recursive = 1、RecursiveAll = 2、FilesOnly = 3 です。 |
ServerRelativeUrl |
String |
R |
はい |
リスト ビュー ページのサーバー相対 URL を示す値を取得します。 |
StyleId |
String |
R |
はい |
リスト ビューのビュー スタイルの識別子を示す値を取得します。 |
Threaded |
Boolean |
R |
はい |
リスト ビューがスレッド ビューかどうかを示す値を取得します。 |
Title |
String |
RW |
はい |
リスト ビューの表示名を指定する値を取得または設定します。 |
Toolbar |
String |
RW |
はい |
リスト ビューのツール バーを指定する値を取得または設定します。 |
ToolbarTemplateName |
String |
R |
はい |
リスト ビューで使用されるツール バーのテンプレートの名前を指定する値を取得します。 |
ViewData |
String |
RW |
はい |
リスト ビューのビュー データを指定する値を取得または設定します。 null でない場合は、[MS-WSSCAML] に示されているように、XML は FieldRefDefinitionViewData に適合する必要があります。 |
ViewFields |
R |
いいえ |
リスト ビュー内のフィールドのコレクションを示す値を取得します。 |
|
ViewJoins |
String |
RW |
はい |
リスト ビューで使用される結合を指定する値を取得または設定します。 null でない場合は、[MS-WSSCAML] に示されているように、XML は ListJoinsDefinition に適合する必要があります。 |
ViewProjectedFields |
String |
RW |
はい |
リスト ビューによって使用される予測フィールドを指定する値を取得または設定します。 null でない場合は、[MS-WSSCAML] に示されているように、XML は ProjectedFieldsDefinitionType に適合する必要があります。 |
ViewQuery |
String |
RW |
はい |
リスト ビューによって使用されるクエリを指定する値を取得または設定します。 null でない場合は、[MS-WSSCAML] に示されているように、XML は CamlQueryRoot に適合する必要があります。 |
ViewType |
String |
R |
はい |
リスト ビューの種類を示す値を取得します。 HTML、グリッド、カレンダー、繰り返し、グラフ、またはガントを選ぶことができます。 |
View メソッド
DeleteObject メソッド
例
RenderAsHtml メソッド
リスト ビューを HTML として返します。
エンドポイント |
/renderashtml |
パラメーター |
なし |
HTTP method |
GET |
応答 |
型: String |
要求の例
executor.executeAsync({
url: "<app web url>/_api/SP.AppContextSite(@target)/web
/lists(guid'da58632f-faf0-4a78-8219-99c307747741')
/views('0dc42244-4bae-4da9-b074-8b8e9d8e50bc')
/renderashtml
?@target='<host web url>'",
method: "GET",
headers: { "accept": "application/json; odata=verbose" },
success: successHandler,
error: errorHandler
});
OData 表現
次の例は、JSON 形式による View リソースを表します。
{"d":{
"__metadata":{,
"id":"https://<site url>/_api/Web/Lists(guid'da58632f-faf0-4a78-8219-99c307747741')/Views(guid'0dc42244-4bae-4da9-b074-8b8e9d8e50bc')",
"uri":"https://<site url>/_api/Web/Lists(guid'da58632f-faf0-4a78-8219-99c307747741')/Views(guid'0dc42244-4bae-4da9-b074-8b8e9d8e50bc')",
"type":"SP.View"
},
"ViewFields":{"__deferred":{"uri":"https://<site url>/_api/Web/Lists(guid'da58632f-faf0-4a78-8219-99c307747741')/Views(guid'0dc42244-4bae-4da9-b074-8b8e9d8e50bc')/ViewFields"}},
"Aggregations":null,
"AggregationsStatus":null,
"BaseViewId":"2",
"ContentTypeId":{"__metadata":{"type":"SP.ContentTypeId"}, "StringValue":"0x"},
"DefaultView":false,
"DefaultViewForContentType":false,
"EditorModified":false,
"Formats":null,
"Hidden":false,
"HtmlSchemaXml":"<View Name=\"{0DC42244-4BAE-4DA9-B074-8B8E9D8E50BC}\" MobileView=\"TRUE\" Type=\"HTML\" DisplayName=\"Late Tasks\" Url=\"/Lists/Backlog items/late.aspx\" Level=\"1\" BaseViewID=\"2\" ContentTypeID=\"0x\" ImageUrl=\"/_layouts/15/images/issuelst.png?rev=31\"><JSLink>hierarchytaskslist.js</JSLink><XslLink Default=\"TRUE\">main.xsl</XslLink><RowLimit Paged=\"TRUE\">100</RowLimit><Toolbar Type=\"Standard\" /><ViewFields><FieldRef Name=\"Checkmark\" /><FieldRef Name=\"LinkTitle\" /><FieldRef Name=\"DueDate\" /><FieldRef Name=\"AssignedTo\" /></ViewFields><ViewData><FieldRef Name=\"PercentComplete\" Type=\"StrikeThroughPercentComplete\" /><FieldRef Name=\"DueDate\" Type=\"TimelineDueDate\" /></ViewData><Query><Where><And><Or><IsNull><FieldRef Name=\"PercentComplete\" /></IsNull><Neq><FieldRef Name=\"PercentComplete\" /><Value Type=\"Number\">1</Value></Neq></Or><Lt><FieldRef Name=\"DueDate\" /><Value Type=\"DateTime\"><Today /></Value></Lt></And></Where><OrderBy><FieldRef Name=\"DueDate\" /><FieldRef Name=\"Priority\" /></OrderBy></Query></View>",
"Id":"0dc42244-4bae-4da9-b074-8b8e9d8e50bc",
"ImageUrl":"/_layouts/15/images/issuelst.png?rev=31",
"IncludeRootFolder":false,
"ViewJoins":null,
"JSLink":"hierarchytaskslist.js",
"ListViewXml":"<View Name=\"{0DC42244-4BAE-4DA9-B074-8B8E9D8E50BC}\" MobileView=\"TRUE\" Type=\"HTML\" DisplayName=\"Late Tasks\" Url=\"/Lists/Backlog items/late.aspx\" Level=\"1\" BaseViewID=\"2\" ContentTypeID=\"0x\" ImageUrl=\"/_layouts/15/images/issuelst.png?rev=31\" ><Query><Where><And><Or><IsNull><FieldRef Name=\"PercentComplete\" /></IsNull><Neq><FieldRef Name=\"PercentComplete\" /><Value Type=\"Number\">1</Value></Neq></Or><Lt><FieldRef Name=\"DueDate\" /><Value Type=\"DateTime\"><Today /></Value></Lt></And></Where><OrderBy><FieldRef Name=\"DueDate\" /><FieldRef Name=\"Priority\" /></OrderBy></Query><ViewFields><FieldRef Name=\"Checkmark\" /><FieldRef Name=\"LinkTitle\" /><FieldRef Name=\"DueDate\" /><FieldRef Name=\"AssignedTo\" /></ViewFields><RowLimit Paged=\"TRUE\">100</RowLimit><JSLink>hierarchytaskslist.js</JSLink><XslLink Default=\"TRUE\">main.xsl</XslLink><Toolbar Type=\"Standard\"/></View>",
"Method":null,
"MobileDefaultView":false,
"MobileView":true,
"ModerationType":null,
"OrderedView":false,
"Paged":true,
"PersonalView":false,
"ViewProjectedFields":null,
"ViewQuery":"<Where><And><Or><IsNull><FieldRef Name=\"PercentComplete\" /></IsNull><Neq><FieldRef Name=\"PercentComplete\" /><Value Type=\"Number\">1</Value></Neq></Or><Lt><FieldRef Name=\"DueDate\" /><Value Type=\"DateTime\"><Today /></Value></Lt></And></Where><OrderBy><FieldRef Name=\"DueDate\" /><FieldRef Name=\"Priority\" /></OrderBy>",
"ReadOnlyView":false,
"RequiresClientIntegration":false,
"RowLimit":100,
"Scope":0,
"ServerRelativeUrl":"/Lists/Backlog items/late.aspx",
"StyleId":null,
"Threaded":false,
"Title":"Late Tasks",
"Toolbar":"",
"ToolbarTemplateName":null,
"ViewType":"HTML",
"ViewData":"<FieldRef Name=\"PercentComplete\" Type=\"StrikeThroughPercentComplete\" /><FieldRef Name=\"DueDate\" Type=\"TimelineDueDate\" />"
}}
ViewCollection リソース
View リソースのコレクションを表します。
エンドポイント URI | メソッド | OData 表現
エンドポイント URI
http://<site url>/_api/web/lists(guid'<list id>')/views
サポートされる HTTP メソッド
GET | POST
要求の例
GET 要求の例: リストのビューをすべて取得します
executor.executeAsync({
url: "<app web url>/_api/SP.AppContextSite(@target)/web
/lists(guid'da58632f-faf0-4a78-8219-99c307747741')/views
?@target='<host web url>'",
method: "GET",
headers: { "accept": "application/json; odata=verbose" },
success: successHandler,
error: errorHandler
});
GET 要求の例: 特定のビューを取得します
executor.executeAsync({
url: "<app web url>/_api/SP.AppContextSite(@target)/web
/lists(guid'da58632f-faf0-4a78-8219-99c307747741')
/views('0dc42244-4bae-4da9-b074-8b8e9d8e50bc')
?@target='<host web url>'",
method: "GET",
headers: { "accept": "application/json; odata=verbose" },
success: successHandler,
error: errorHandler
});
または、ViewCollection リソースから GetByTitle メソッドを使用してそのタイトル (大文字/小文字の区別が必要) を条件にしてビューを取得できます。例: …/web/lists(guid'da58632f-faf0-4a78-8219-99c307747741')/views/getbytitle('By Status')
POST 要求の例: ビューを作成します
executor.executeAsync({
url: "<app web url>/_api/SP.AppContextSite(@target)/web
/lists(guid'da58632f-faf0-4a78-8219-99c307747741')/views
?@target='<host web url>'",
method: "POST",
body: "{ '__metadata': { 'type': 'SP.View' }, 'Title': 'By Status',
'PersonalView': false }",
headers: {
"accept": "application/json;odata=verbose",
"content-type": "application/json;odata=verbose"
},
success: successHandler,
error: errorHandler
});
ビューを作成するときに、サーバーはビューを返します。新しいビューのビュー フィールドの追加、削除、または順序変更を行うには、ViewFieldCollection メソッドを使います。
ViewCollection メソッド
GetById メソッド
指定された ID を持つリスト ビューを取得します。
エンドポイント |
/getbyid('<ビュー id>') |
パラメーター |
型: String |
HTTP method |
GET |
応答 |
型: SP.View |
要求の例
executor.executeAsync({
url: "<app web url>/_api/SP.AppContextSite(@target)/web
/lists(guid'da58632f-faf0-4a78-8219-99c307747741')/views
/getbyid('0dc42244-4bae-4da9-b074-8b8e9d8e50bc')
?@target='<host web url>'",
method: "GET",
headers: { "accept": "application/json; odata=verbose" },
success: successHandler,
error: errorHandler
});
または、単にビュー ID を ViewCollection リソースに渡すことができます。例: …/web/lists(guid'51925dd7-2108-481a-b1ef-4bfa4e69d48b')/views('0dc42244-4bae-4da9-b074-8b8e9d8e50bc')
GetByTitle メソッド
指定されたタイトルを持つリスト ビューを取得します。
エンドポイント |
/getbytitle('<view title>') |
パラメーター |
型: String |
HTTP method |
GET |
応答 |
型: SP.View |
要求の例
executor.executeAsync({
url: "<app web url>/_api/SP.AppContextSite(@target)/web
/lists(guid'da58632f-faf0-4a78-8219-99c307747741')/views
/getbytitle('By Status')
?@target='<host web url>'",
method: "GET",
headers: { "accept": "application/json; odata=verbose" },
success: successHandler,
error: errorHandler
});
OData 表現
次の例は、JSON 形式による ViewCollection リソースを表します。
{"d":{
"results":[{
"__metadata":{
"id":"https://<site url>/_api/Web/Lists(guid'da58632f-faf0-4a78-8219-99c307747741')/Views(guid'0dc42244-4bae-4da9-b074-8b8e9d8e50bc')",
"uri":"https://<site url>/_api/Web/Lists(guid'da58632f-faf0-4a78-8219-99c307747741')/Views(guid'0dc42244-4bae-4da9-b074-8b8e9d8e50bc')",
"type":"SP.View"
},
"ViewFields":{"__deferred":{"uri":"https://<site url>/_api/Web/Lists(guid'da58632f-faf0-4a78-8219-99c307747741')/Views(guid'0dc42244-4bae-4da9-b074-8b8e9d8e50bc')/ViewFields"}},
"Aggregations":null,
"AggregationsStatus":null,
"BaseViewId":"1",
"ContentTypeId":{"__metadata":{"type":"SP.ContentTypeId"},"StringValue":"0x"},
"DefaultView":true,
"DefaultViewForContentType":false,
"EditorModified":false,
"Formats":null,
"Hidden":false,
"HtmlSchemaXml":"<View Name=\"{9824C4FF-14FD-4F24-B481-FA33D90F2D85}\" DefaultView=\"TRUE\" MobileView=\"TRUE\" MobileDefaultView=\"TRUE\" Type=\"HTML\" DisplayName=\"All Tasks\" Url=\"/Lists/Backlog items/AllItems.aspx\" Level=\"1\" BaseViewID=\"1\" ContentTypeID=\"0x\" ImageUrl=\"/_layouts/15/images/issuelst.png?rev=31\"><Toolbar Type=\"Standard\" /><ViewFields><FieldRef Name=\"Checkmark\" /><FieldRef Name=\"LinkTitle\" /><FieldRef Name=\"DueDate\" /><FieldRef Name=\"AssignedTo\" /><FieldRef Name=\"Status0\" /></ViewFields><JSLink>hierarchytaskslist.js</JSLink><XslLink Default=\"TRUE\">main.xsl</XslLink><RowLimit Paged=\"TRUE\">100</RowLimit><ViewData><FieldRef Name=\"PercentComplete\" Type=\"StrikeThroughPercentComplete\" /><FieldRef Name=\"DueDate\" Type=\"TimelineDueDate\" /></ViewData></View>"
"Id":"9824c4ff-14fd-4f24-b481-fa33d90f2d85",
"ImageUrl":"/_layouts/15/images/issuelst.png?rev=31",
"IncludeRootFolder":false,
"ViewJoins":null,
"JSLink":"hierarchytaskslist.js",
"ListViewXml":"<View Name=\"{9824C4FF-14FD-4F24-B481-FA33D90F2D85}\" DefaultView=\"TRUE\" MobileView=\"TRUE\" MobileDefaultView=\"TRUE\" Type=\"HTML\" DisplayName=\"All Tasks\" Url=\"/Lists/Backlog items/AllItems.aspx\" Level=\"1\" BaseViewID=\"1\" ContentTypeID=\"0x\" ImageUrl=\"/_layouts/15/images/issuelst.png?rev=31\" ><ViewFields><FieldRef Name=\"Checkmark\" /><FieldRef Name=\"LinkTitle\" /><FieldRef Name=\"DueDate\" /><FieldRef Name=\"AssignedTo\" /><FieldRef Name=\"Status0\" /></ViewFields><RowLimit Paged=\"TRUE\">100</RowLimit><JSLink>hierarchytaskslist.js</JSLink><XslLink Default=\"TRUE\">main.xsl</XslLink><Toolbar Type=\"Standard\"/></View>",
"Method":null,
"MobileDefaultView":true,
"MobileView":true,
"ModerationType":null,
"OrderedView":false,
"Paged":true,
"PersonalView":false,
"ViewProjectedFields":null,
"ViewQuery":null
"ReadOnlyView":false,
"RequiresClientIntegration":false,
"RowLimit":100,
"Scope":0,
"ServerRelativeUrl":"/Lists/Backlog items/AllItems.aspx",
"StyleId":null,
"Threaded":false,
"Title":"All Tasks",
"Toolbar":"",
"ToolbarTemplateName":null,
"ViewType":"HTML",
"ViewData":"<FieldRef Name=\"PercentComplete\" Type=\"StrikeThroughPercentComplete\" /><FieldRef Name=\"DueDate\" Type=\"TimelineDueDate\" />"}}"
},{
"__metadata":{
"id":"https://<site url>/_api/Web/Lists(guid'da58632f-faf0-4a78-8219-99c307747741')/Views(guid'0dc42244-4bae-4da9-b074-8b8e9d8e50bc')",
"uri":"https://<site url>/_api/Web/Lists(guid'da58632f-faf0-4a78-8219-99c307747741')/Views(guid'0dc42244-4bae-4da9-b074-8b8e9d8e50bc')",
"type":"SP.View"
},
"ViewFields":{"__deferred":{"uri":"https://<site url>/_api/Web/Lists(guid'da58632f-faf0-4a78-8219-99c307747741')/Views(guid'0dc42244-4bae-4da9-b074-8b8e9d8e50bc')/ViewFields"}},
"Aggregations":null,
"AggregationsStatus":null,
"BaseViewId":"2",
"ContentTypeId":{"__metadata":{"type":"SP.ContentTypeId"},"StringValue":"0x"},
"DefaultView":false,
"DefaultViewForContentType":false,
"EditorModified":false,
"Formats":null,
"Hidden":false,
"HtmlSchemaXml":"<View Name=\"{0DC42244-4BAE-4DA9-B074-8B8E9D8E50BC}\" MobileView=\"TRUE\" Type=\"HTML\" DisplayName=\"Late Tasks\" Url=\"/Lists/Backlog items/late.aspx\" Level=\"1\" BaseViewID=\"2\" ContentTypeID=\"0x\" ImageUrl=\"/_layouts/15/images/issuelst.png?rev=31\"><JSLink>hierarchytaskslist.js</JSLink><XslLink Default=\"TRUE\">main.xsl</XslLink><RowLimit Paged=\"TRUE\">100</RowLimit><Toolbar Type=\"Standard\" /><ViewFields><FieldRef Name=\"Checkmark\" /><FieldRef Name=\"LinkTitle\" /><FieldRef Name=\"DueDate\" /><FieldRef Name=\"AssignedTo\" /></ViewFields><ViewData><FieldRef Name=\"PercentComplete\" Type=\"StrikeThroughPercentComplete\" /><FieldRef Name=\"DueDate\" Type=\"TimelineDueDate\" /></ViewData><Query><Where><And><Or><IsNull><FieldRef Name=\"PercentComplete\" /></IsNull><Neq><FieldRef Name=\"PercentComplete\" /><Value Type=\"Number\">1</Value></Neq></Or><Lt><FieldRef Name=\"DueDate\" /><Value Type=\"DateTime\"><Today /></Value></Lt></And></Where><OrderBy><FieldRef Name=\"DueDate\" /><FieldRef Name=\"Priority\" /></OrderBy></Query></View>",
"Id":"0dc42244-4bae-4da9-b074-8b8e9d8e50bc",
"ImageUrl":"/_layouts/15/images/issuelst.png?rev=31",
"IncludeRootFolder":false,
"ViewJoins":null,
"JSLink":"hierarchytaskslist.js",
"ListViewXml":"<View Name=\"{0DC42244-4BAE-4DA9-B074-8B8E9D8E50BC}\" MobileView=\"TRUE\" Type=\"HTML\" DisplayName=\"Late Tasks\" Url=\"/Lists/Backlog items/late.aspx\" Level=\"1\" BaseViewID=\"2\" ContentTypeID=\"0x\" ImageUrl=\"/_layouts/15/images/issuelst.png?rev=31\" ><Query><Where><And><Or><IsNull><FieldRef Name=\"PercentComplete\" /></IsNull><Neq><FieldRef Name=\"PercentComplete\" /><Value Type=\"Number\">1</Value></Neq></Or><Lt><FieldRef Name=\"DueDate\" /><Value Type=\"DateTime\"><Today /></Value></Lt></And></Where><OrderBy><FieldRef Name=\"DueDate\" /><FieldRef Name=\"Priority\" /></OrderBy></Query><ViewFields><FieldRef Name=\"Checkmark\" /><FieldRef Name=\"LinkTitle\" /><FieldRef Name=\"DueDate\" /><FieldRef Name=\"AssignedTo\" /></ViewFields><RowLimit Paged=\"TRUE\">100</RowLimit><JSLink>hierarchytaskslist.js</JSLink><XslLink Default=\"TRUE\">main.xsl</XslLink><Toolbar Type=\"Standard\"/></View>",
"Method":null,
"MobileDefaultView":false,
"MobileView":true,
"ModerationType":null,
"OrderedView":false,
"Paged":true,
"PersonalView":false,
"ViewProjectedFields":null,
"ViewQuery":"<Where><And><Or><IsNull><FieldRef Name=\"PercentComplete\" /></IsNull><Neq><FieldRef Name=\"PercentComplete\" /><Value Type=\"Number\">1</Value></Neq></Or><Lt><FieldRef Name=\"DueDate\" /><Value Type=\"DateTime\"><Today /></Value></Lt></And></Where><OrderBy><FieldRef Name=\"DueDate\" /><FieldRef Name=\"Priority\" /></OrderBy>",
"ReadOnlyView":false,
"RequiresClientIntegration":false,
"RowLimit":100,
"Scope":0,
"ServerRelativeUrl":"/Lists/Backlog items/late.aspx",
"StyleId":null,
"Threaded":false,
"Title":"Late Tasks",
"Toolbar":"",
"ToolbarTemplateName":null,
"ViewType":"HTML",
"ViewData":"<FieldRef Name=\"PercentComplete\" Type=\"StrikeThroughPercentComplete\" /><FieldRef Name=\"DueDate\" Type=\"TimelineDueDate\" />"
},{
…
}]
}}
ViewFieldCollection のリソース
リスト ビュー内のフィールドのコレクションを表します。
エンドポイント URI | プロパティ | メソッド | OData 表現
エンドポイント URI
http://<site url>/_api/web/lists(guid'<list id>')/views('<view id>')/viewfields
サポートされる HTTP メソッド
GET | POST
要求の例
GET 要求の例: ビュー内のすべてのフィールドを取得します
executor.executeAsync({
url: "<app web url>/_api/SP.AppContextSite(@target)/web
/lists(guid'da58632f-faf0-4a78-8219-99c307747741')
/views('d82d3e67-f317-413c-8f27-590317a40f20')/viewfields
?@target='<host web url>'",
method: "GET",
headers: { "accept": "application/json; odata=verbose" },
success: successHandler,
error: errorHandler
});
ViewFieldCollection プロパティ
プロパティを取得するには、以下の例に示されているように、GET 要求をプロパティ エンドポイントに送信します。
executor.executeAsync({
url: "<app web url>/_api/SP.AppContextSite(@target)/web
/lists(guid'da58632f-faf0-4a78-8219-99c307747741')
/views('d82d3e67-f317-413c-8f27-590317a40f20')/viewfields/schemaxml
?@target='<host web url>'",
method: "GET",
headers: { "accept": "application/json; odata=verbose" },
success: successHandler,
error: errorHandler
});
プロパティ |
型 |
R/W |
説明 |
|
---|---|---|---|---|
SchemaXml |
String |
R |
はい |
コレクションを表す XML スキーマを示す値を取得します。 |
Items |
Collection(String) |
R |
はい |
フィールドのコレクションの XML スキーマを指定します。Items プロパティはリソースとともに返されますが、このプロパティには URI アドレスを指定可能なエンドポイントはありません。 |
ViewFieldCollection メソッド
AddViewField
MoveViewFieldTo
RemoveAllViewFields
RemoveViewField
AddViewField メソッド
指定されたフィールド内部名または表示名を持つフィールドをコレクションに追加します。
エンドポイント |
/addviewfield('<field name>') |
パラメーター |
型: String |
HTTP method |
POST |
応答 |
なし |
要求の例
executor.executeAsync({
url: "<app web url>/_api/SP.AppContextSite(@target)/web
/lists(guid'da58632f-faf0-4a78-8219-99c307747741')
/views('d82d3e67-f317-413c-8f27-590317a40f20')/viewfields
/addviewfield('AssignedTo')
?@target='<host web url>'",
method: "POST",
success: successHandler,
error: errorHandler
});
MoveViewFieldTo メソッド
指定されたフィールド内部名を持つフィールドをコレクション内の指定の位置に移動します。
エンドポイント |
/moveviewfieldto |
パラメーター |
|
HTTP method |
POST |
応答 |
なし |
要求の例
executor.executeAsync({
url: "<app web url>/_api/SP.AppContextSite(@target)/web
/lists(guid'da58632f-faf0-4a78-8219-99c307747741')
/views('d82d3e67-f317-413c-8f27-590317a40f20')/viewfields
/moveviewfieldto
?@target='<host web url>'",
method: "POST",
body: "{ 'field': 'DueDate', 'index': 0 }",
headers: { "content-type": "application/json;odata=verbose" },
success: successHandler,
error: errorHandler
});
RemoveAllViewFields メソッド
コレクションからすべてのフィールドを削除します。
エンドポイント |
/removeallviewfields |
パラメーター |
なし |
HTTP method |
POST |
応答 |
なし |
要求の例
executor.executeAsync({
url: "<app web url>/_api/SP.AppContextSite(@target)/web
/lists(guid'da58632f-faf0-4a78-8219-99c307747741')
/views('d82d3e67-f317-413c-8f27-590317a40f20')/viewfields
/removeallviewfields
?@target='<host web url>'",
method: "POST",
success: successHandler,
error: errorHandler
});
RemoveViewField メソッド
指定されたフィールド内部名を持つフィールドをコレクションから削除します。
エンドポイント |
/removeviewfield('<field name>') |
パラメーター |
型: String |
HTTP method |
POST |
応答 |
なし |
要求の例
executor.executeAsync({
url: "<app web url>/_api/SP.AppContextSite(@target)/web
/lists(guid'da58632f-faf0-4a78-8219-99c307747741')
/views('d82d3e67-f317-413c-8f27-590317a40f20')/viewfields
/removeviewfield('AssignedTo')
?@target='<host web url>'",
method: "POST",
success: successHandler,
error: errorHandler
});
OData 表現
次の例は、JSON 形式による ViewFieldCollection リソースを表します。
{"d":{
"__metadata":{
"id":"https://<site url>/_api/SP.AppContextSite(@target)/web/lists(guid'da58632f-faf0-4a78-8219-99c307747741')/views('d82d3e67-f317-413c-8f27-590317a40f20')/viewfields",
"uri":"https://<site url>/_api/SP.AppContextSite(@target)/web/lists(guid'da58632f-faf0-4a78-8219-99c307747741')/views('d82d3e67-f317-413c-8f27-590317a40f20')/viewfields",
"type":"SP.ViewFieldCollection"
},
"SchemaXml":"<FieldRef Name=\"Checkmark\" /><FieldRef Name=\"Status\" /><FieldRef Name=\"LinkTitle\" /><FieldRef Name=\"DueDate\" />",
"Items":{"results":["Checkmark", "Status", "LinkTitle", "DueDate"]}
}}