Can NOT get promoted tweets of draft campaigns


#1

Can NOT get promoted tweets of draft campaigns.

twurl -H "ads-api.twitter.com" -X GET "/4/accounts/18ce54iditw/promoted_tweets?line_item_ids=dfr20" | jq .
{
  "request": {
    "params": {
      "account_id": "18ce54iditw",
      "line_item_ids": [
        "dfr20"
      ]
    }
  },
  "next_cursor": null,
  "data": []
}

While other campaigns are OK.

twurl -H "ads-api.twitter.com" -X GET "/4/accounts/18ce54iditw/promoted_tweets?line_item_ids=dfqwf" | jq .
{
  "request": {
    "params": {
      "account_id": "18ce54iditw",
      "line_item_ids": [
        "dfqwf"
      ]
    }
  },
  "next_cursor": null,
  "data": [
    {
      "line_item_id": "dfqwf",
      "id": "2j6hd2",
      "entity_status": "ACTIVE",
      "created_at": "2019-01-10T00:39:14Z"

#2

We found that it worked when requested the API with draft_only=true.
But according to the V3 docs, it have been removed from the API.

  `draft_only`  parameter has been removed from the following endpoints as these entities can never be in a draft state:

* [GET accounts/:account_id/targeting_criteria ](https://developer.twitter.com/en/docs/ads/campaign-management/api-reference/targeting-criteria#get-accounts-account-id-targeting-criteria)
* [GET accounts/:account_id/promoted_tweets ](https://developer.twitter.com/en/docs/ads/campaign-management/api-reference/promoted-tweets#get-accounts-account-id-promoted-tweets)
* [GET accounts/:account_id/promoted_accounts ](https://developer.twitter.com/en/docs/ads/campaign-management/api-reference/promoted-accounts#get-accounts-account-id-promoted-accounts)
* [GET accounts/:account_id/media_creatives ](https://developer.twitter.com/en/docs/ads/campaign-management/api-reference/media-creatives#get-accounts-account-id-media-creatives)
* [GET accounts/:account_id/preroll_call_to_actions ](https://developer.twitter.com/en/docs/ads/creatives/api-reference/preroll-call-to-actions#get-accounts-account-id-preroll-call-to-actions)
twurl -H "ads-api.twitter.com" -X GET "/4/accounts/18ce54iditw/promoted_tweets?line_item_ids=dfr20&draft_only=true" | jq .

#3

Hi @wenping.wang,

Sorry about the confusion. We re-introduced that parameter after that. See this post: Announcement: Draft campaigns now accessible via the API

Sorry this was wrong.

Best,
Shohei


#4

Hey @wenping.wang,

Can you confirm if the draft_only=true param does indeed solve the issue? I’ve tried to reproduce the issue and still get an empty result:

twurl_ads -X GET  "/4/accounts/18ce54iditw/promoted_tweets?line_item_ids=dfr20&draft_only=true" | jq .
{
  "request": {
    "params": {
      "account_id": "18ce54iditw",
      "line_item_ids": [
        "dfr20"
      ]
    }
  },
  "next_cursor": null,
  "data": []
}

#5

YES, I can get data with draft_only=true included,

twurl -H "ads-api.twitter.com" -X GET "/4/accounts/18ce54iditw/promoted_tweets?line_item_ids=dfr20&draft_only=true" | jq .
{
  "request": {
    "params": {
      "account_id": "18ce54iditw",
      "line_item_ids": [
        "dfr20"
      ]
    }
  },
  "next_cursor": null,
  "data": [
    {
      "line_item_id": "dfr20",
      "id": "2j6hmv",
      "entity_status": "ACTIVE",
      "created_at": "2019-01-10T00:50:55Z",
      "updated_at": "2019-01-10T00:57:32Z",
      "approval_status": "ACCEPTED",
      "tweet_id": "1075974140186619905",
      "deleted": false
    },
...

while nothing returned not including draft_only=true.

twurl -H "ads-api.twitter.com" -X GET "/4/accounts/18ce54iditw/promoted_tweets?line_item_ids=dfr20" | jq .
{
  "request": {
    "params": {
      "account_id": "18ce54iditw",
      "line_item_ids": [
        "dfr20"
      ]
    }
  },
  "next_cursor": null,
  "data": []
}

#6

Thanks for your reply.

You mean that draft_only=true is needed to be included when request data for DRAFT campaigns, line items and ads?


#8

@jrsyo How about status of this one?
Thanks in advance.


#10

@wenping.wang,

Sorry to keep you waiting, but we’re still checking this internally.
I’ll keep you updated. Thank you for your patience.

Best,
Shohei