Skip to content

Add and View Targeting

Request

Add and view targeting

Security
Auth0(Required scopes: offline_accessmanage:services)
Bodyapplication/json
strategy_idArray of integers, (int32)required
Example:
[ 87 ]
targetingobject(targeting_base)
POST
/targeting
curl -i -X POST \
  https://api.mediamath.com/api/v3.0/targeting \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "strategy_id": [
      87
    ],
    "targeting": {
      "audience": {
        "include": [
          {
            "operator": "AND",
            "audience_segment_ids": [
              32
            ]
          }
        ],
        "exclude": [
          {
            "operator": "AND",
            "audience_segment_ids": [
              32
            ]
          }
        ]
      },
      "contextual": {
        "include": [
          {
            "code": "string",
            "operator": "AND",
            "target_value_ids": [
              33
            ]
          }
        ],
        "exclude": [
          {
            "code": "string",
            "operator": "AND",
            "target_value_ids": [
              3
            ]
          }
        ]
      },
      "my_data": {
        "include": {
          "pixel_bundle_ids": [
            88
          ],
          "operator": "AND"
        },
        "exclude": {
          "pixel_bundle_ids": [
            32
          ]
        }
      },
      "location": {
        "include": [
          {
            "code": "string",
            "operator": "AND",
            "target_value_ids": [
              33
            ]
          }
        ],
        "exclude": [
          {
            "code": "string",
            "operator": "AND",
            "target_value_ids": [
              3
            ]
          }
        ]
      },
      "technology": {
        "include": [
          {
            "code": "string",
            "operator": "AND",
            "target_value_ids": [
              33
            ]
          }
        ],
        "exclude": [
          {
            "code": "string",
            "operator": "AND",
            "target_value_ids": [
              3
            ]
          }
        ]
      },
      "day_parts": [
        {
          "user_time": true,
          "start_hour": 1,
          "end_hour": 5,
          "days": [
            "M",
            "T",
            "W",
            "S",
            "U"
          ]
        }
      ]
    }
  }'

Responses

Add and view response

Bodyapplication/json
dataobject
metaobjectrequired
errorsArray of any or null
Response
{ "data": { "location": [] }, "meta": { "status": "string", "count": 0 }, "errors": [ null ] }