Response to PUT targeting criteria is missing the total_count


#1

I want to report a problem with the PUT method for adding a targeting criterion to a line item. I am using the method that is documented at https://dev.twitter.com/ads/reference/put/accounts/%3Aaccount_id/targeting_criteria. The example on that page shows that the total_count field will be present in the response. But in my test case, where I am only adding one targeting criterion, the total_count field is absent.

The URL for the PUT request looked like this:

https://ads-api.twitter.com/0/accounts/2aio14/targeting_criteria?broad_keywords=hockey&line_item_id=349bk

And the response came back as follows, with no total_count or cursor fields present, as I would have expected based on the documentation.

{
 "data_type":"targeting_criterion",
 "data":[
    {"line_item_id":"349bk","name":"hockey","id":"4wg09t","account_id":"2aio14","created_at":"2015-09-10T00:34:42Z","targeting_value":"hockey","updated_at":"2015-09-10T00:34:42Z","deleted":false,"targeting_type":"BROAD_KEYWORD"}
 ],
 "request": {
   "params":{
     "line_item_id":"349bk",
     "broad_keywords":"hockey",
     "account_id":"2aio14"
    }
  }
}

Is this a documentation error, or an Ads API defect, or something else?


#2

Hi @dodnert

I’ve checked my own request table where I’ve all request params and responses and I confirm that I haven’t got “total_count” param

Hopefully, some Twitter Ads Staff member will answer this and tell us if is a documentation mistake or an error.

Regards!


#3

Thanks for flagging this. Both total_count and next_cursor are not valid attributes for responses to the PUT accounts/:account_id/targeting_criteria so we’ll fix that sample response.