ネイティブ レイアウト サービス
このサービスを使用すると、販売者はネイティブ クリエイティブのレイアウトを指定できます。 レイアウトがデータベース内に配置されたら、 を使用して取得し、その後で をlayout_id
使用してrenderer_id
取得できます。
REST API
HTTP メソッド | エンドポイント | 説明 |
---|---|---|
POST |
https://api.appnexus.com/native-layout?member_id=456 |
新しいレイアウトを作成します。 |
PUT |
https://api.appnexus.com/native-layout?id=16&member_id=456 |
既存のレイアウトを編集します。 |
DELETE |
https://api.appnexus.com/native-layout?id=123&member_id=456 |
レイアウトを削除します。 |
JSON フィールド
フィールド | 種類 | 説明 |
---|---|---|
data_assets |
オブジェクトの配列 | ネイティブ クリエイティブの属性。 詳細については 、以下の「データ資産 」を参照してください。 |
image_assets |
オブジェクトの配列 | 個々のイメージに必要な属性を指定します。 詳細については、「 イメージアセット 」を参照してください。 |
renderer |
object | 販売者のレンダラー ID。 この配列に を id 入力します。 例:"renderer":{"id":1} |
イメージアセット
オブジェクトには image_assets
、次のフィールドが含まれます。
フィールド | 種類 | 説明 |
---|---|---|
aspect_ratios |
オブジェクトの配列 | 画像の種類に必要な縦横比を icon 定義します。 必要な値は、 min_width ratio_width と ratio_height です。 「 例」を参照してください。 |
image_type |
string | イメージの形式。 次の値を指定できます。 - main_image - icon_image |
required |
int | イメージが必要かどうかを指定します。 使用可能な値: 1 - 必須 |
sizes |
オブジェクトの配列 | イメージのサイズ。 と の両方 width を指定します height 。 「 例」を参照してください。 |
の例 aspect_ratios
"aspect_ratios": [
{
"min_width" : 100,
"ratio_width": 1,
"ratio_height": 2
}
]
の例 sizes
Example:
"sizes": [
{
"width": 300,
"height": 500
}
]
データ資産
オブジェクトには data_assets
、次のフィールドが含まれます。
フィールド | 種類 | 説明 |
---|---|---|
data_type |
string | ネイティブ クリエイティブのアセットの種類。 使用可能な値: - sponsored_by - title - description - rating - call_to_action - display_url - likes - downloads - price - sale_price - phone - address - additional_description |
required |
int | 必要な場合、値は である 1 必要があります。 |
maximum_length |
int | データ資産の最大長。 |
例
新しいネイティブ レイアウト プロトコルを作成する
$ cat native_layout
{
"native-layout": {
"renderer": {
"id": 1
},
"image_assets":[
{
"image_type": "main_image", //depends on api.native_asset_image_type.name
"required": 1,
"sizes": [
{
"width": 300,
"height": 500
}
]
},
{
"image_type": "icon_image",
"aspect_ratios": [
{
"minimum_width" : 100,
"ratio_width": 1,
"ratio_height": 2
}
]
}
],
"data_assets": [
{
"data_type": "title", //depends on api.native_asset_data_type.name
"required": 1,
"maximum_length": 100
}
]
}
}
$ curl -b cookies -c cookies -X POST -d @native_layout 'https://api.appnexus.com/native-layout?member_id=456'
{
"response": {
"status": "OK",
"start_element": 0,
"num_elements": 100,
"native-layout": {
"id": 2,
"member_id": 7,
"renderer": {
"id": 1
},
"data_assets": [
{
"required": true,
"data_type": "title",
"maximum_length": 100
}
],
"image_assets": [
{
"required": true,
"image_type": "main_image",
"sizes": [
{
"width": 300,
"height": 500
}
],
"aspect_ratios": null
},
{
"required": false,
"image_type": "icon_image",
"sizes": null,
"aspect_ratios": [
{
"minimum_width": 100,
"ratio_width": 1,
"ratio_height": 2
}
]
}
]
},
...
}
}