App Asset サービス
注:
このサービスは現在、限られた一連のクライアントと Microsoft の従業員のみが利用できます。
これは、Xandr の担当者がアプリ関連のイメージを Akamai に追加できるようにする管理専用サービスです。 このサービスは、Apps Marketplace のサブスクライバーまたは開発者は利用できません。
REST API
HTTP メソッド | エンドポイント | 説明 |
---|---|---|
POST |
https://api.appnexus.com/app-asset |
イメージを追加する |
GET |
https://api.appnexus.com/app-asset |
すべての画像を表示する |
GET |
https://api.appnexus.com/app-asset?id=ID |
特定の画像を表示する |
GET |
https://api.appnexus.com/app-asset?plugin_id=PLUGIN_ID |
特定のアプリに関連付けられているすべての画像を表示する |
DELETE |
https://api.appnexus.com/app-asset?id=ID |
イメージを削除する |
JSON フィールド
フィールド | 種類 | 説明 |
---|---|---|
id |
int | 各イメージの一意の ID。 必須: PUT および DELETE 、querystring。 |
plugin_id |
int | このイメージが関連付けられているプラグインの unque ID 値。 必須: POST |
description |
string | アプリ資産を表すテキスト。 既定値: null |
category |
列挙 | アプリ資産が属するカテゴリ。 使用可能な値: - "big_icon" - "icon" - "favicon" - "screenshot" 既定値: null 必須: POST |
width |
int | アプリ資産の幅 (ピクセル単位)。 既定値: null |
height |
int | アプリ資産の高さ (ピクセル単位)。 これは少なくとも 400 である必要があります。 既定値: null |
file_type |
列挙 | 読み取り専用。 アプリ資産のイメージの種類。 使用可能な値は次のいずれかです: - "png" - "jpg" - "gif" .既定値: null |
last_modified |
timestamp | 読み取り専用。 イメージが最後に変更された日時。 |
media_url |
string | 読み取り専用。 ホストされているアプリ資産の URL。 既定値: null |
content |
string | アプリ資産の Base 64 でエンコードされたコンテンツ。 このフィールドは、コマンドの実行時には GET 表示されません。 必須: POST |
size_in_bytes |
int | 読み取り専用。 アプリ資産のサイズ (バイト単位)。 これは 2 MB を超えることはできません。 既定値: 0 |
イメージの要件
- は
plugin_id
、プラグイン サービスの有効な 1 つである必要があります。 - 各plugin_idのアプリ資産の数は、プラグイン サービスで指定された
allowed_asset_count
制限を超えることはできません。 既定値は 5 です。 - イメージ サイズは 2 MB を超えることはできません。
- イメージの種類は、 .jpg、 gif、または .pngである必要があります。
- イメージは Base 64 でエンコードされている必要があります。
- 画像の高さは 400px 以上である必要があります。
- これらの
category
型には、次のディメンションが必要です。- big_icon: 150 x 175
- アイコン: 96 x 96
- favicon: 16 x 16
- スクリーンショット: 640 x 400
例
イメージを追加する
$ cat add-image.json
{
"app-asset": {
"id": "3466",
"plugin_id": "91"
}
}
$ curl -b cookies -c cookies -X PUT -d @add-image.json 'https://api.appnexus.com/app-asset'
{
"response":{
"status":"OK",
"count":1,
"id":"3467",
"start_element":null,
"num_elements":null,
"app-asset":{
"id":3467,
"plugin_id":92,
"description":null,
"category":"screenshot",
"width":640,
"height":400,
"file_type":"jpeg",
"media_url":"http:\/\/cdn.sand-08.adnxs.net\/s\/app_asset\/11\/d7\/55\/bc\/11d755bce0f9e7539b57408de1799204.jpeg",
"size_in_bytes":49354
},
}
}
特定の画像を表示する
$ curl -b cookies -c cookies 'https://api.appnexus.com/app-asset?id=3464'
{
"response":{
"status":"OK",
"count":1,
"start_element":null,
"num_elements":null,
"app-asset":{
"id":3467,
"plugin_id":92,
"description":null,
"category":"screenshot",
"width":640,
"height":400,
"file_type":"jpeg",
"media_url":"http:\/\/cdn.sand-08.adnxs.net\/s\/app_asset\/11\/d7\/55\/bc\/11d755bce0f9e7539b57408de1799204.jpeg",
"size_in_bytes":49354
}
}
}
すべての画像を表示する
$ curl -b cookies -c cookies 'https://api.appnexus.com/app-asset'
{
"response":{
"status":"OK",
"count":3,
"start_element":null,
"num_elements":null,
"app-assets":[
{
"id":3467,
"plugin_id":92,
"description":null,
"category":"screenshot",
"width":640,
"height":400,
"file_type":"jpeg",
"media_url":"http:\/\/cdn.sand-08.adnxs.net\/s\/app_asset\/11\/d7\/55\/bc\/11d755bce0f9e7539b57408de1799204.jpeg",
"size_in_bytes":49354
},
{
"id":3468,
"plugin_id":91,
"description":"This is a description of the screenshot",
"category":"screenshot",
"width":640,
"height":400,
"file_type":"jpeg",
"media_url":"http:\/\/cdn.sand-08.adnxs.net\/s\/app_asset\/11\/d7\/55\/bc\/11d755bce0f9e7539b57408de1799204.jpeg",
"size_in_bytes":49354
},
{
"id":3469,
"plugin_id":47,
"description":null,
"category":"icon",
"width":96,
"height":96,
"file_type":"png",
"media_url":"http:\/\/cdn.sand-08.adnxs.net\/s\/app_asset\/1b\/65\/02\/14\/1b6502147d7fa34f5a75d722fb46e4f3.png",
"size_in_bytes":15250
}
]
}}
特定のアプリに関連付けられているすべての画像を表示する
$ curl -b cookies -c cookies 'http://sand.api.appnexus.com/app-asset?plugin_id=91' | json-pp
{
"response":{
"status":"OK",
"count":1,
"start_element":null,
"num_elements":null,
"app-assets":[
{
"id":3468,
"plugin_id":91,
"description":"This is a description of the screenshot",
"category":"screenshot",
"width":640,
"height":400,
"file_type":"jpeg",
"media_url":"http:\/\/cdn.sand-08.adnxs.net\/s\/app_asset\/11\/d7\/55\/bc\/11d755bce0f9e7539b57408de1799204.jpeg",
"size_in_bytes":49354
}
]
}
}
イメージを削除する
$ curl -b cookies -c cookies -X DELETE 'https://api.appnexus.com/app-asset?id=3468' |
{
"response":{
"status":"OK",
}
}