Can't get deleted campaigns for some accounts


#1

Hi,

there seems to be a mismatch when using with_deleted query parameter. When we query:

twurl -H ads-api.twitter.com /1/accounts/18ce54fhamu/campaigns?with_deleted=true

the api responds only with campaigns that are deleted: false even though there is a deleted campaign for that account.

Then again, for a different account it works as expected:

twurl -H ads-api.twitter.com /1/accounts/18ce54at0mo/campaigns?with_deleted=true

Is this an error on your end or are we doing something incorrectly?


#2

@romanrostar: In this case, it looks like the fourth campaign for 18ce54fhamu was a draft campaign, so you’ll need to use both the draft_only and with_deleted parameters:

$ twurl -H ads-api.twitter.com "/1/accounts/18ce54fhamu/campaigns?with_deleted=true&draft_only=true" | jq
{
  "request": {
    "params": {
      "with_deleted": true,
      "account_id": "18ce54fhamu",
      "draft_only": true
    }
  },
  "data": [
    {
      "name": {name},
      "start_time": "2017-03-06T22:59:00Z",
      "reasons_not_servable": [
        "DELETED",
        "EXPIRED"
      ],
      "servable": false,
      "daily_budget_amount_local_micro": 476190000,
      "end_time": "2017-03-27T06:59:00Z",
      "funding_instrument_id": "n393c",
      "duration_in_days": null,
      "standard_delivery": true,
      "total_budget_amount_local_micro": 10000000000,
      "id": "7p4ll",
      "entity_status": "DRAFT",
      "paused": false,
      "account_id": "18ce54fhamu",
      "frequency_cap": null,
      "currency": "USD",
      "created_at": "2017-03-06T22:59:05Z",
      "updated_at": "2017-03-10T06:52:53Z",
      "deleted": true
    }
  ],
  "data_type": "campaign",
  "total_count": 1,
  "next_cursor": null
}

#3

@romanrostar: Following up to make sure this helped clarify things. Thanks!