Search code examples
apitwitterads

Facing error while Creating Targeting Criteria using Twitter Ads API


Create a targeting profile associated with the line item. If I post this in postman, I am getting the below error: Can anyone look into this and provide the solution, please.

Note*: I have changed the value “xxx” to mask the values.

POST https://ads-api.twitter.com/9/accounts/XXXXXXXX/targeting_criteria?line_item_id=XXXX&targeting_type=LOCATION&targeting_value=3b77caf94bfc81fe

“errors”: [
{
“code”: “MISSING_PARAMETER”,
“message”: ““operator_type” is a required parameter”,
“parameter”: “operator_type”
}
],
“request”: {
“params”: {
“line_item_id”: “xxx”,
“targeting_type”: “LOCATION”,
“targeting_value”: “xxxxx”,
“account_id”: “xxxx”
}
}
}```

Solution

  • Thedocumentation states that operator_type is a required field. It should work passing in EQ

    POST https://ads-api.twitter.com/9/accounts/XXXXXXXX/targeting_criteria?line_item_id=XXXX&targeting_type=LOCATION&targeting_value=3b77caf94bfc81fe&operator_type=EQ