Promoted_tweets


#1

Get service for promoted tweet returns empty data set when hit without optional parameters.
why is this so? the total count shows the correct number but the result data set is empty .
Data is returned only when optional parameters like line item id is specified.

The service is supposed to return all the promoted tweets if hit without optional parameters, right ?

Get : method
https://ads-api-sandbox.twitter.com/2/accounts/accountID/promoted_tweets?cursor=8yd3bv62s&line_item_ids=asd,asdf,qwe


#2

@arjunsdas95: Could you please provide two examples with the full request and response:

  1. GET accounts/:account_id/promoted_tweets
  2. GET accounts/:account_id/promoted_tweets?cursor=8yd3bv62s&line_item_ids=asd,asdf,qwe1

The first request should return all promoted_tweets (up to 1,000 per page; 200 by default). I’m noticing you’re using the sandbox. This could be a reason why you’re seeing this issue, but I’ll have to dig further after hearing back from you.


#3

https://ads-api-sandbox.twitter.com/2/accounts/gq192d/promoted_tweets

{
    "request": {
        "params": {
            "account_id": "gq192d"
        }
    },
    "next_cursor": null,
    "data": []
}

https://ads-api-sandbox.twitter.com/2/accounts/gq192d/promoted_tweets?with_total_count=true

{
    "request": {
        "params": {
            "account_id": "gq192d",
            "with_total_count": true
        }
    },
    "next_cursor": null,
    "data": [],
    "total_count": 299
}

https://ads-api-sandbox.twitter.com/2/accounts/gq192d/promoted_tweets?line_item_ids=weqe,qwes,dasw&count=5

{
    "request": {
        "params": {
            "count": 5,
            "account_id": "gq192d",
            "line_item_ids": [
                "weqe",
                "qwes",
                "dasw"
            ]
        }
    },
    "next_cursor": "8yb8au29s",
    "data": [
        {
            "line_item_id": "weqe",
            "id": "qweq",
            "entity_status": "ACTIVE",
            "created_at": "2017-11-10T12:45:07Z",
            "updated_at": "2017-11-10T12:45:07Z",
            "approval_status": "ACCEPTED",
            "tweet_id": "802116927275422222",
            "deleted": false
        },
        {
            "line_item_id": "qwes",
            "id": "edad",
            "entity_status": "ACTIVE",
            "created_at": "2017-12-06T06:13:52Z",
            "updated_at": "2017-12-06T06:13:52Z",
            "approval_status": "ACCEPTED",
            "tweet_id": "938284050380232222",
            "deleted": false
        },
        {
            "line_item_id": "qwes",
            "id": "wesa",
            "entity_status": "ACTIVE",
            "created_at": "2017-12-06T06:15:11Z",
            "updated_at": "2017-12-06T06:15:11Z",
            "approval_status": "ACCEPTED",
            "tweet_id": "938290662222222720",
            "deleted": false
        },
        {
            "line_item_id": "qwes",
            "id": "wdsa",
            "entity_status": "ACTIVE",
            "created_at": "2017-12-06T06:15:38Z",
            "updated_at": "2017-12-06T06:15:38Z",
            "approval_status": "ACCEPTED",
            "tweet_id": "938290222565894656",
            "deleted": false
        },
        {
            "line_item_id": "qwes",
            "id": "ucas",
            "entity_status": "ACTIVE",
            "created_at": "2017-12-06T06:15:57Z",
            "updated_at": "2017-12-06T06:15:57Z",
            "approval_status": "ACCEPTED",
            "tweet_id": "938290849222455552",
            "deleted": false
        }
    ]
}

When i give total count i can see that there is more than 200 data , but i am unable to fetch those when i give a request without line item ids.
The request without line item ids is supposed to fetch all data without any filter as per the api.
But this is not happening.

With line item id it is fetching all data with the filter (i have added count to restrict the response to 5.)


#4

Thanks for this, @arjunsdas95. We’ll take a look at this. Note that this is something we may not be able to resolve soon.