メインコンテンツへスキップ
POST
/
property
ターゲティング設定
curl --request POST \
  --url https://api-v2.adrop.io/property \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: <content-type>' \
  --data '
{
  "uid": "<string>",
  "value": "<string>",
  "platform": "<string>",
  "adid": "<string>"
}
'
import requests

url = "https://api-v2.adrop.io/property"

payload = {
"uid": "<string>",
"value": "<string>",
"platform": "<string>",
"adid": "<string>"
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "<content-type>"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': '<content-type>'},
body: JSON.stringify({uid: '<string>', value: '<string>', platform: '<string>', adid: '<string>'})
};

fetch('https://api-v2.adrop.io/property', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api-v2.adrop.io/property",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'uid' => '<string>',
'value' => '<string>',
'platform' => '<string>',
'adid' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: <content-type>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api-v2.adrop.io/property"

payload := strings.NewReader("{\n \"uid\": \"<string>\",\n \"value\": \"<string>\",\n \"platform\": \"<string>\",\n \"adid\": \"<string>\"\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Authorization", "<authorization>")
req.Header.Add("Content-Type", "<content-type>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api-v2.adrop.io/property")
.header("Authorization", "<authorization>")
.header("Content-Type", "<content-type>")
.body("{\n \"uid\": \"<string>\",\n \"value\": \"<string>\",\n \"platform\": \"<string>\",\n \"adid\": \"<string>\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api-v2.adrop.io/property")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = '<content-type>'
request.body = "{\n \"uid\": \"<string>\",\n \"value\": \"<string>\",\n \"platform\": \"<string>\",\n \"adid\": \"<string>\"\n}"

response = http.request(request)
puts response.read_body
{
    "code": 0,
    "msg": "OK"
}
ターゲティングを使用すると、特定のユーザーグループやコンテキストに合った広告を表示できます。REST APIではオーディエンスターゲティングとコンテキストターゲティングの両方をサポートしています。

オーディエンスターゲティング

ユーザー属性に基づいて広告をターゲティングします。

リクエストパラメータ

Authorization
string
必須
App Key(adrop_service.jsonで確認)
Content-Type
string
必須
application/json
uid
string
必須
ユーザー固有識別子
value
string
必須
属性データ(JSON文字列)。プリセットおよびカスタム属性を含む
platform
string
プラットフォーム。例:webandroidios
adid
string
広告識別子(ADID/IDFA)

レスポンス

code
integer
レスポンスコード。0は成功
msg
string
レスポンスメッセージ
{
    "code": 0,
    "msg": "OK"
}

プリセット属性

Adropで事前に定義された標準属性です。すべてのSDKとREST APIで同じ形式を使用します。

生年月日(BIRTH)

キー値の例形式
BIRTH2024yyyy(年のみ)
BIRTH202401yyyyMM(年月)
BIRTH20240101yyyyMMdd(完全な日付)

性別(GDR)

キー意味
GDRM男性(Male)
GDRF女性(Female)
GDRU不明(Unknown)

不明な値

キー説明
*Uすべての属性で「不明」を表す場合に使用
プリセット属性キーは大文字を使用します:BIRTHGDR

カスタム属性

コンソールで定義したカスタム属性を使用できます。

カスタム属性の設定

  1. Adropコンソールターゲティングメニューに移動
  2. オーディエンスターゲティングタブでカスタム属性を作成
  3. APIでそのキー・値で属性を送信
const properties = {
    // プリセット属性
    BIRTH: '19931225',
    GDR: 'M',

    // カスタム属性(コンソールで定義)
    membership: 'premium',
    lastPurchaseDate: '2024-01-15',
    favoriteCategory: 'electronics'
};
カスタム属性のすべての値は文字列(STRING)タイプです。

コンテキストターゲティング

ページやコンテンツのコンテキストに応じて広告をターゲティングします。広告リクエスト時にcontextIdパラメータを追加します。

コンテキストターゲティングの設定

  1. Adropコンソールターゲティングメニューに移動
  2. コンテキストターゲティングタブでコンテキストを作成
  3. 広告リクエスト時にcontextIdパラメータを使用

広告リクエストへのコンテキスト適用

GET https://api-v2.adrop.io/request?unit=YOUR_UNIT_ID&contextId=sport
const axios = require('axios');

const config = {
    method: 'get',
    baseURL: 'https://api-v2.adrop.io',
    url: '/request',
    params: {
        unit: 'YOUR_UNIT_ID',
        uid: 'USER_ID',
        pf: 'web',
        contextId: 'sport'  // コンソールで作成したコンテキストID
    },
    headers: {
        'Authorization': 'YOUR_APP_KEY'
    }
};

axios.request(config)
    .then((response) => {
        console.log(JSON.stringify(response.data));
    })
    .catch((error) => {
        console.log(error);
    });
import requests

url = "https://api-v2.adrop.io/request"
params = {
    "unit": "YOUR_UNIT_ID",
    "uid": "USER_ID",
    "pf": "web",
    "contextId": "sport"
}
headers = {
    "Authorization": "YOUR_APP_KEY"
}

response = requests.get(url, params=params, headers=headers)
print(response.json())
curl -X GET "https://api-v2.adrop.io/request?unit=YOUR_UNIT_ID&uid=USER_ID&pf=web&contextId=sport" \
  -H "Authorization: YOUR_APP_KEY"

ベストプラクティス

ユーザーIDの一貫性

同じユーザーには常に同じuidを使用してください。一貫したIDは正確なターゲティングの鍵です。

属性の更新

ユーザー情報が変更されたら、すぐに/propertyエンドポイントを呼び出して更新してください。

プリセット形式の遵守

BIRTHGDR属性は、定められた形式を正確に使用する必要があります。

コンテキストの活用

ニュース、スポーツ、ショッピングなどのページの特性に合ったコンテキストターゲティングを活用してください。

関連ドキュメント

オーディエンスターゲティング

コンソールでオーディエンスターゲティングを設定

コンテキストターゲティング

コンソールでコンテキストターゲティングを設定