印刷する

ニュース/イベント

news > list

ニュース/イベント一覧をリクエストします。

リクエストの構築

リクエストURLとGET変数

リクエスト固有のGET変数

変数説明
gonewsAPIセクション
dolistAPIアクション

リクエストURLは以下のようになります。必須情報(key, timestamp, salt, signature)を追加することを忘れないでください。

https://....../api.phpgo=news&do=list&{required information}
POST変数

以下のリストフィルターはPOST変数を使って利用できます。フィルターは複数同時に使用可能です。

変数説明
fields (string) "field1,field2,..." 結果に含めるフィールドを指定します。
"*" = すべてのフィールド(デフォルト)
"field1, field2, field3" = フィールドのサブセット(推奨/カンマ区切り)
可能なフィールド:
id, id_user, status, status_moderation, type, title, title_url, description, description_seo, tags, img_legend, img_poster, img_social, img_thumbnail, img_icon, date, date_end, views_page, socialize, allow_comments, notification, notification_link_type, notification_link, map, map_center_lat, map_center_lng, map_zoom, map_type, map_marker_lat, map_marker_lng, id_import, date_lastmod
ページングオプション
resultsPerPageFilter (int) n 1ページあたりの結果の数(何件表示か)
current_page (int) n 現在のページ数(何ページ目か)
paging (int) 0|1 ページングを有効/無効にする
limit (int) n 結果制限
※"resultsPerPageFilter"が未設定かつ"paging=0"の場合のみ
よく使われるフィルター
idUserFilter (int) author ID 指定したユーザーからのニュース/イベントを一覧表示します。
statusFilter (mixed) status 指定したステータスに一致するニュース/イベントを一覧表示します。
利用可能な値:0 (非アクティブ), 1 (アクティブ), "any"
注:ハッシュなしのリクエストではアクティブで承認済のニュース/イベントのみを返します。
sortByFilter (string) "option" リストを並べ替えます。
利用可能な値:"date" (デフォルト、日付の新しい順), "title","views_page","id","random","randomSeed","dateRevUp" (今後のイベント/開催日時の近い順), "date2" (日付の古い順)
typeFilter (mixed) type 指定したタイプのニュース/イベントを一覧表示
利用可能な値:"any", 0 (ニュース), 1 (イベント)
tagsFilter (string) "tag1,tag2,..." タグに従ってニュース/イベントを一覧表示します(カンマ区切り)。
利用可能な値:"any", "clips", "ads"
idFilter string) "ID1,ID2,..." IDが指定されたものと一致するニュース/イベントを一覧表示します(カンマ区切り)。
日付フィルター
dateStartFilter (int) timestamp 日付がタイムスタンプの日付と同じかそれより後であるニュース/イベントを一覧表示します(00:00:00から)。
dateStartMaxFilter (int) timestamp 日付がタイムスタンプの日付と同じかそれより前であるニュース/イベントを一覧表示します(00:00:00から)。
dateEndFilter (int) timestamp 「終了日」の日付がタイムスタンプの日付と同じかそれより前であるニュース/イベントを一覧表示します(23:59:59まで)。
カテゴリーフィルター
categoriesFilter (int) n カテゴリーに含まれるニュース/イベントを一覧表示します。
カテゴリーIDを指定するか、カテゴリーに関連付けられていないニュース/イベントに"-1"を指定します。
categoriesFilterStrict (int) 0|1 "categoriesFilter"により指定されたカテゴリーに直接関連付けられたニュース/イベントを一覧表示します。
カテゴリーの継承は無視されます。
検索フィルター
search (string) "term" 検索する用語
searchMode (string) "mode" システムが用語を検索する方法
利用可能な値:
標準モード(高速):完全に一致するものを探します。
"std1" = タイトル+タグで検索
"std2" = タイトル+タグ+短い説明で検索
"std3" (デフォルト) = タイトル検索+タグ+詳細説明で検索
単語モード(低速、より多く一致):用語を単語に分割し、それらの可能な組み合わせ全てを探して検索します。
"words1" = タイトル+タグで検索
"words2" = タイトル+タグ+短い説明で検索
"words3" = タイトル検索+タグ+詳細説明で検索

応答例

リクエストが成功した場合は、以下の内容のレスポンスを受け取ります。
list_total_found:(ページングの目的で)基準に一致した、見つかったアイテムの合計数。
list_total:返されたリストの項目数。これは通常"limit"もしくは"resultsPerPageFilter"の値と一致します。
list:アイテムリスト

{
    "list_total_found": "38",
    "list_total": 5,
    "list": [{
        "datesorthint": "1427355660",
        "id": "58",
        "img_poster": "http:\/\/...\/public\/common\/images\/_default_event_poster.gif",
        "title": "Company celebration",
        "type": "1",
        "type_name": "event",
        "user_alias": "InterStream"
    }, {
        "datesorthint": "1421622000",
        "id": "33",
        "img_poster": "http:\/\/...\/uploads\/images\/event_33_1405010853_poster.jpg",
        "title": "Live webcast",
        "type": "1",
        "type_name": "event",
        "user_alias": "InterStream"
    }, {
        "datesorthint": "1420109160",
        "id": "57",
        "img_poster": "http:\/\/...\/public\/common\/images\/_default_event_poster.gif",
        "title": "Anual meeting",
        "type": "1",
        "type_name": "event",
        "user_alias": "InterStream"
    }, {
        "datesorthint": "1420022700",
        "id": "56",
        "img_poster": "http:\/\/...\/public\/common\/images\/_default_event_poster.gif",
        "title": "Eastern party",
        "type": "1",
        "type_name": "event",
        "user_alias": "InterStream"
    }, {
        "datesorthint": "1419158700",
        "id": "55",
        "img_poster": "http:\/\/...\/public\/common\/images\/_default_event_poster.gif",
        "title": "Halloween party",
        "type": "1",
        "type_name": "event",
        "user_alias": "InterStream"
    }]
}

認証情報にGETの許可がない場合など、リクエストが失敗した場合のレスポンス

{
	"error"		 : "REQUEST_ERROR",
	"error_long" : "Permission error: GET"
}

このリクエストは以下のエラーを返す可能性があります。

REQUEST_ERROR | No News/Events were found
ニュース/_イベントが見つかりません。

その他のエラー内容に関しては一般的なエラーメッセージを確認してください。

PHPサンプルコード

GETおよびPOSTデータを準備します。

// GET変数
$GET_VARS = array( 
					"go"        => "news",
					"do"        => "list"
					);

// POST変数
$POST_VARS = array(					
					"fields"				=> "id,title,img_poster", // ID,タイトル,ポスター画像の各フィールド
					"paging"				=> 1, // ページング有効
					"resultsPerPageFilter"	=> 5, // 1ページにつき5件表示
					"current_page"			=> 1, // 1ページ目に戻る
					"sortByFilter"			=> "date", // 日付で並べ替え
					"typeFilter"			=> 1, // イベントのみ一覧表示
					"statusFilter"			=> "any" // 全てのステータスを表示
                    );