Skip to main content
POST
https://api-v2.adrop.io
/
property
Targeting Settings
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>"
}
'
{
    "code": 0,
    "msg": "OK"
}
Targeting allows you to display ads to specific user groups or contexts. The REST API supports both audience targeting and context targeting.

Audience Targeting

Target ads based on user properties.

Request Parameters

Authorization
string
required
App Key (found in adrop_service.json)
Content-Type
string
required
application/json
uid
string
required
User unique identifier
value
string
required
Property data (JSON string). Includes preset and custom properties.
platform
string
Platform. e.g., web, android, ios
adid
string
Advertising identifier (ADID/IDFA)

Response

code
integer
Response code. 0 indicates success.
msg
string
Response message
{
    "code": 0,
    "msg": "OK"
}

Preset Properties

Standard properties predefined by Adrop. The same format is used across all SDKs and REST API.

Birth Date (BIRTH)

KeyExample ValueFormat
BIRTH2024yyyy (year only)
BIRTH202401yyyyMM (year and month)
BIRTH20240101yyyyMMdd (full date)

Gender (GDR)

KeyValueMeaning
GDRMMale
GDRFFemale
GDROOther

Unknown Values

KeyValueDescription
*UUse to represent “unknown” for any property
Preset property keys use uppercase: BIRTH, GDR

Custom Properties

You can use custom properties defined in the console.

Setting Custom Properties

  1. Navigate to the Targeting menu in the Adrop Console
  2. Create custom properties in the Audience Targeting tab
  3. Send the property key-value pairs via API
const properties = {
    // Preset properties
    BIRTH: '19931225',
    GDR: 'M',

    // Custom properties (defined in console)
    membership: 'premium',
    lastPurchaseDate: '2024-01-15',
    favoriteCategory: 'electronics'
};
All custom property values must be STRING type.

Context Targeting

Target ads based on page or content context. Add the contextId parameter to ad requests.

Setting Up Context Targeting

  1. Navigate to the Targeting menu in the Adrop Console
  2. Create a context in the Context Targeting tab
  3. Use the contextId parameter when requesting ads

Applying Context to Ad Requests

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'  // Context ID created in console
    },
    headers: {
        'Authorization': 'YOUR_APP_KEY'
    }
};

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

Best Practices

Consistent User ID

Always use the same uid for the same user. Consistent IDs are key to accurate targeting.

Update Properties

Call the /property endpoint immediately when user information changes.

Follow Preset Formats

Use the exact specified formats for BIRTH and GDR properties.

Leverage Context

Use context targeting for page types like news, sports, shopping, etc.