印刷する

ニュース/イベント

news > get

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

リクエストの構築

リクエストURLとGET変数

リクエスト固有のGET変数

変数説明
gonewsAPIセクション
dogetAPIアクション
iqNews IDニュース/イベントID

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

https://....../api.php?go=news&do=get&iq={news_id}&{required information}
POST変数

このリクエストにはPOST変数は必要ありません。

応答例

リクエストが成功した場合は、以下の内容のレスポンスを受け取ります。
data:ニュース/イベント情報
categories:ニュース/イベントに関連付けられているカテゴリーのリスト。
gallery_images:ニュース/イベントイメージ

{
    "data": {
        "allow_comments": "1",
        "date": "1390561980",
        "date_formatted": "24\/01\/2014 12:13:00 PM",
        "date_lastmod": "1414228089",
        "date_lastmod_formatted": "25\/10\/2014 11:08:09 AM",
        "description": "This is the news body... ",
        "description_seo": "This is the news body...",
        "id": "49",
        "id_import": null,
        "id_user": "1",
        "img_icon": "http:\/\/......\/uploads\/images\/news_49_1405010910_icon.jpg",
        "img_legend": "",
        "img_poster": "http:\/\/......\/uploads\/images\/news_49_1405010910_poster.jpg",
        "img_social": "http:\/\/......\/uploads\/images\/news_49_1405010910_social.jpg",
        "img_thumbnail": "http:\/\/......\/uploads\/images\/news_49_1405010910_thumb.jpg",
        "is_featured": "0",
        "socialize": "1",
        "status": "1",
        "tags": "tag1, tag2, tag3",
        "title": "The News title",
        "title_url": "the-news-title",
        "type": "0",
        "type_name": "news",
        "url": "http:\/\/......\/index.php\/news\/49\/the-news-title\/",
        "user_alias": "InterStream",
        "user_url": "http:\/\/......\/index.php\/portal\/user\/1\/inter-stream\/",
        "views_page": "80",
        "views_page_formatted": "80"
    },
    "categories": [{
        "id": 1,
        "title": "Movies",
        "breadcrumb": [{
            "id": 1,
            "title": "Movies"
        }]
    }],
    "gallery_images": [{
        "date": "1412746497",
        "date_formatted": "08\/10\/2014 07:34:57 AM",
        "date_lastmod": "1414228089",
        "date_lastmod_formatted": "25\/10\/2014 11:08:09 AM",
        "description": "",
        "id": "51",
        "id_gallery": "38",
        "img_icon": "http:\/\/......\/uploads\/images\/galleries\/gallery_38_image_51_1412746497_icon.jpg",
        "img_large": "http:\/\/......\/uploads\/images\/galleries\/gallery_38_image_51_1412746497_large.jpg",
        "img_thumbnail": "http:\/\/......\/uploads\/images\/galleries\/gallery_38_image_51_1412746497_thumb.jpg",
        "title": "Image 1"
    }, {
        "date": "1414227905",
        "date_formatted": "25\/10\/2014 11:05:05 AM",
        "date_lastmod": "1414228089",
        "date_lastmod_formatted": "25\/10\/2014 11:08:09 AM",
        "description": "",
        "id": "52",
        "id_gallery": "38",
        "img_icon": "http:\/\/......\/uploads\/images\/galleries\/gallery_38_image_52_1414227906_icon.jpg",
        "img_large": "http:\/\/......\/uploads\/images\/galleries\/gallery_38_image_52_1414227906_large.jpg",
        "img_thumbnail": "http:\/\/......\/uploads\/images\/galleries\/gallery_38_image_52_1414227906_thumb.jpg",
        "title": "Image 2"
    }, {
        "date": "1414227905",
        "date_formatted": "25\/10\/2014 11:05:05 AM",
        "date_lastmod": "1414228089",
        "date_lastmod_formatted": "25\/10\/2014 11:08:09 AM",
        "description": "",
        "id": "53",
        "id_gallery": "38",
        "img_icon": "http:\/\/......\/uploads\/images\/galleries\/gallery_38_image_53_1414227906_icon.jpg",
        "img_large": "http:\/\/......\/uploads\/images\/galleries\/gallery_38_image_53_1414227906_large.jpg",
        "img_thumbnail": "http:\/\/......\/uploads\/images\/galleries\/gallery_38_image_53_1414227906_thumb.jpg",
        "title": "Image 3"
    }]
}

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

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

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

REQUEST_ERROR | Invalid News/Event ID
ニュース/イベントIDが1未満かもしくは数値ではありません。

REQUEST_ERROR | News/Event not found or inactive
ニュース/イベントが見つからないか、もしくは非アクティブです。

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

PHPサンプルコード

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

// GET変数
$GET_VARS = array( 
					"go"        => "channels",
					"do"        => "get",
					"iq"        => 49
					);

// POST変数
$POST_VARS = array();