GET stats/accounts/:account_id/promoted_tweets in version 1?

api

#1

Hi, the function is deprecated and supported only till June 2016.
How do I respectively get list of promoted_tweets in v1?


#2

Hey @vladobet11 , this functionality has changed in v1 as you mentioned. This is how you would access it now:

Use Account Stats this endpoint for all stats purposes.

  "request": {
    "params": {
      "start_time": "2016-02-01T15:00:00Z",
      "entity_ids": "43gk6",
      "end_time": "2016-02-01T17:00:00Z",
      "placement": "ALL_ON_TWITTER",
      "granularity": "HOUR",
      "entity": "PROMOTED_TWEET",
      "metric_groups": [
        "BILLING"
      ]
    }
  }

This should do the trick. Just set your entity to PROMOTED_TWEET as shown in the request above.


#3

Hi @msbukkuri,
In your request entity_ids: “43gk6” is input parameter. How did you get it in v1? (in v0 i get it calling GET stats/accounts/:account_id/promoted_tweets).


#4

The entity_id for promoted_tweet, is the promoted_tweet’s id. You get that by calling GET accounts/%3Aaccount_id/promoted_tweets and provide a line_item_id.

Then you can call the endpoint in my previous message as I had.


#5

Hi @msbukkuri,

This is exactly what I asked at the beginning. As the request GET accounts/%3Aaccount_id/promoted_tweets is available only till 30.6.2016 (API v0) , I am asking how to I get promoted tweets (and also organic tweets) after that date.


#6

@vladobet11, you’re getting the stats endpoint confused with the actual retrieval endpoint.

GET accounts/%3Aaccount_id/promoted_tweets gets you the Promoted Tweets associated with your accounts. If you provide a line_item_id, it provides you with a list of promoted_tweets and their ids for that line item.

Now you take those promoted tweet ids (as entity_ids) and use the single stats end point to get your data for your promoted tweets.

"request": {
    "params": {
      "start_time": "2016-02-01T15:00:00Z",
      "entity_ids": "43gk6",
      "end_time": "2016-02-01T17:00:00Z",
      "placement": "ALL_ON_TWITTER",
      "granularity": "HOUR",
      "entity": "PROMOTED_TWEET",
      "metric_groups": [
        "BILLING"
      ]
    }
  }