Can't retrieve drafted line items when assigning campaign_ids

api

#1

I am currently developing api to retrieve campaigns and line items.
But I find out when using the API below to retrieve drafted line_items,
I get the “data”:[] result.
But actually I can find this line_item on the ads.twitter.com website.

https://ads-api.twitter.com/2/accounts/:account_id/line_items

twurl -H ads-api.twitter.com /2/accounts/{account_id}/line_items?campaign_ids={campaign_id}&draft_only=true

But when I do not assign the campaign_ids parameter and trying to retrieve all the drafted line items, I definitely can find the drafted line item I want to find in the list.
(I retrieve all the drafted line_items in this account at this time)

twurl -H ads-api.twitter.com /2/accounts/{account_id}/line_items?draft_only=true

If there is any bug when assigning the campaign_ids parameter(cannot retrieve drafted line=item) Or maybe I forget to assign another parameter.

Thank you and wait for your reply.


#2

@neplove: Could you please provide additional information? Is this what you’re looking for?

Line item in draft mode:

$ twurl -H ads-api.twitter.com "/2/accounts/18ce54d4x5t/line_items/8h73g"
{
  "request": {
    "params": {
      "line_item_id": "8h73g",
      "account_id": "18ce54d4x5t"
    }
  },
  "data": {
    "bid_type": "MAX",
    "advertiser_user_id": 756201191646691300,
    "name": "Untitled",
    "placements": [
      "TWITTER_PROFILE",
      "TWITTER_TIMELINE"
    ],
    "start_time": null,
    "bid_amount_local_micro": 2000000,
    "automatically_select_bid": false,
    "advertiser_domain": null,
    "target_cpa_local_micro": null,
    "primary_web_event_tag": null,
    "charge_by": "ENGAGEMENT",
    "product_type": "PROMOTED_TWEETS",
    "end_time": null,
    "bid_unit": "ENGAGEMENT",
    "total_budget_amount_local_micro": null,
    "objective": "TWEET_ENGAGEMENTS",
    "id": "8h73g",
    "entity_status": "DRAFT",
    "account_id": "18ce54d4x5t",
    "optimization": "DEFAULT",
    "categories": [],
    "currency": "USD",
    "created_at": "2017-04-14T18:50:48Z",
    "tracking_tags": [],
    "updated_at": "2017-04-14T18:50:48Z",
    "include_sentiment": "POSITIVE_ONLY",
    "campaign_id": "845dj",
    "creative_source": "MANUAL",
    "deleted": false
  }
}

Looking up the line item by specifying the campaign ID:

$ twurl -H ads-api.twitter.com "/2/accounts/18ce54d4x5t/line_items?campaign_ids=845dj&draft_only=true"
{
  "request": {
    "params": {
      "account_id": "18ce54d4x5t",
      "campaign_ids": [
        "845dj"
      ],
      "draft_only": true
    }
  },
  "next_cursor": null,
  "data": [
    {
      "bid_type": "MAX",
      "advertiser_user_id": 756201191646691300,
      "name": "Untitled",
      "placements": [
        "TWITTER_PROFILE",
        "TWITTER_TIMELINE"
      ],
      "start_time": null,
      "bid_amount_local_micro": 2000000,
      "automatically_select_bid": false,
      "advertiser_domain": null,
      "target_cpa_local_micro": null,
      "primary_web_event_tag": null,
      "charge_by": "ENGAGEMENT",
      "product_type": "PROMOTED_TWEETS",
      "end_time": null,
      "bid_unit": "ENGAGEMENT",
      "total_budget_amount_local_micro": null,
      "objective": "TWEET_ENGAGEMENTS",
      "id": "8h73g",
      "entity_status": "DRAFT",
      "account_id": "18ce54d4x5t",
      "optimization": "DEFAULT",
      "categories": [],
      "currency": "USD",
      "created_at": "2017-04-14T18:50:48Z",
      "tracking_tags": [],
      "updated_at": "2017-04-14T18:50:48Z",
      "include_sentiment": "POSITIVE_ONLY",
      "campaign_id": "845dj",
      "creative_source": "MANUAL",
      "deleted": false
    }
  ]
}

#3

Thank you for your kind reply.
I can retrieve the line items now.
Maybe I make some mistakes in my request.

Thank you very much!:grinning:


#4

Thanks for letting us know. Glad to help!