ギャラリー
galleries > get
ギャラリー情報をリクエストします。
リクエストの構築
リクエストURLとGET変数
リクエスト固有のGET変数
| 変数 | 値 | 説明 |
|---|---|---|
| go | galleries | APIセクション |
| do | get | APIアクション |
| iq | Gallery ID | ギャラリーID |
リクエストURLは以下のようになります。必須情報(key, timestamp, salt, signature)を追加することを忘れないでください。
https://....../api.php?go=galleries&do=get&iq={gallery_id}&{required information}
POST変数
このリクエストにはPOST変数は必要ありません。
応答例
リクエストが成功した場合は、以下の内容のレスポンスを受け取ります。
・data:ギャラリー情報
・categories:ギャラリーに関連付けられているカテゴリーのリスト。
・gallery_images:ギャラリーイメージ
{
"data": {
"allow_comments": "1",
"date": "1394707840",
"date_formatted": "13\/03\/2014 11:50:40 AM",
"date_lastmod": "1426932169",
"date_lastmod_formatted": "21\/03\/2015 11:02:49 AM",
"description": "The gallery description",
"description_seo": "The gallery description",
"id": "37",
"id_channel": null,
"id_news": null,
"id_user": "1",
"img_icon": "http:\/\/......\/uploads\/images\/gallery_37_1382608290_icon.jpg",
"img_poster": "http:\/\/......\/uploads\/images\/gallery_37_1382608290_poster.jpg",
"img_social": "http:\/\/......\/uploads\/images\/gallery_37_1382608290_social.jpg",
"img_thumbnail": "http:\/\/......\/uploads\/images\/gallery_37_1382608290_thumb.jpg",
"is_featured": "0",
"privacy": "0",
"privacy_access_level": "99",
"socialize": "1",
"status": "1",
"tags": "tag1, tag2",
"title": "My Gallery",
"title_url": "my-gallery",
"url": "http:\/\/......\/index.php\/gallery\/37\/my-galley\/",
"user_alias": "InterStream",
"user_url": "http:\/\/......\/index.php\/portal\/user\/1\/inter-stream\/",
"views_page": "101",
"views_page_formatted": "101"
},
"categories": [{
"id": 1,
"title": "Movies",
"breadcrumb": [{
"id": 1,
"title": "Movies"
}]
}, {
"id": 18,
"title": "Animation",
"breadcrumb": [{
"id": "1",
"title": "Movies"
}, {
"id": "18",
"title": "Animation"
}]
}],
"gallery_images": [{
"date": "1382608240",
"date_formatted": "24\/10\/2013 11:50:40 AM",
"date_lastmod": "1426932169",
"date_lastmod_formatted": "21\/03\/2015 11:02:49 AM",
"description": "",
"id": "34",
"id_gallery": "37",
"img_icon": "http:\/\/......\/uploads\/images\/galleries\/gallery_37_image_34_1383812218_icon.jpg",
"img_large": "http:\/\/......\/uploads\/images\/galleries\/gallery_37_image_34_1383812218_large.jpg",
"img_thumbnail": "http:\/\/......\/uploads\/images\/galleries\/gallery_37_image_34_1383812218_thumb.jpg",
"title": "Image 1"
}, {
"date": "1382608240",
"date_formatted": "24\/10\/2013 11:50:40 AM",
"date_lastmod": "1426932169",
"date_lastmod_formatted": "21\/03\/2015 11:02:49 AM",
"description": "",
"id": "35",
"id_gallery": "37",
"img_icon": "http:\/\/......\/uploads\/images\/galleries\/gallery_37_image_35_1385451866_icon.jpg",
"img_large": "http:\/\/......\/uploads\/images\/galleries\/gallery_37_image_35_1385451866_large.jpg",
"img_thumbnail": "http:\/\/......\/uploads\/images\/galleries\/gallery_37_image_35_1385451866_thumb.jpg",
"title": "Image 2"
}, {
"date": "1382608240",
"date_formatted": "24\/10\/2013 11:50:40 AM",
"date_lastmod": "1426932169",
"date_lastmod_formatted": "21\/03\/2015 11:02:49 AM",
"description": "",
"id": "36",
"id_gallery": "37",
"img_icon": "http:\/\/......\/uploads\/images\/galleries\/gallery_37_image_36_1385451867_icon.jpg",
"img_large": "http:\/\/......\/uploads\/images\/galleries\/gallery_37_image_36_1385451867_large.jpg",
"img_thumbnail": "http:\/\/......\/uploads\/images\/galleries\/gallery_37_image_36_1385451867_thumb.jpg",
"title": "Image 3"
}]
}
認証情報にGETの許可がない場合など、リクエストが失敗した場合のレスポンス
{
"error" : "REQUEST_ERROR",
"error_long" : "Permission error: GET"
}
このリクエストは以下のエラーを返す可能性があります。
・REQUEST_ERROR | Invalid Gallery ID
ギャラリーIDが1未満かもしくは数値ではありません。
・REQUEST_ERROR | Gallery not found, inactive or restricted
ギャラリーが見つからない、非アクティブ、もしくは公開制限されています。
その他のエラー内容に関しては一般的なエラーメッセージを確認してください。
PHPサンプルコード
GETおよびPOSTデータを準備します。
// GET変数 $GET_VARS = array( "go" => "galleries", "do" => "get", "iq" => 37 ); // POST変数 $POST_VARS = array();