GET scoped_timeline


#1

I have a trouble when getting scoped timeline.

I followed https://dev.twitter.com/ads/reference/get/accounts/%3Aaccount_id/scoped_timeline

Request:

twurl -H ads-api.twitter.com “/0/accounts/ftr8ac/scoped_timeline?as_user_id=95671956”

Response:

{“data_type”:“status”,“data”:[],“next_cursor”:“1447150850-664024909463445504”,“request”:{“params”:{“account_id”:“ftr8ac”}}}

I don’t know why the return of data was empty. Actually, my timeline still have tweets.
I need your help !!!
Thanks.


#2

Your first issue is you are using as_user_id, which is not an accepted parameter on that endpoint, so that just gets ignored. You should be using user_id.

Running the same twurl request but using user_id instead does not get you the results you expect either though:

Request

twurl -H "ads-api.twitter.com" "/0/accounts/ftr8ac/scoped_timeline?user_id=95671956" | jq .

Response

{
  "errors": [
    {
      "code": "INVALID_PARAMETER",
      "message": "Expected user ids to be promotable users, got \"95671956\" for user_ids",
      "parameter": "user_ids"
    }
  ],
  "request": {
    "params": {
      "user_id": "95671956",
      "account_id": "ftr8ac"
    }
  }
}

You should read up on what a promotable user is, which also covers how to check promotable users available to an Ads account, if this is not clear to you.


#4

So sorry about my silly mistake.
I tried again with twurl request and used correct user_id but the result still was empty.

Request

twurl -H “ads-api.twitter.com” “/0/accounts/ftr8ac/scoped_timeline?user_id=956971956”

Response

{“data_type”:“status”,“data”:[],“next_cursor”:“1447150850-664024909463445504”,“request”:{“params”:{“user_id”:“956971956”,“account_id”:“ftr8ac”}}}

I got user_id from the link mentioned above.

Request

twurl -H “ads-api.twitter.com” “/0/accounts/ftr8ac/promotable_users”

Response

{“request”:{“params”:{“account_id”:“ftr8ac”}},“data”:[{“user_id”:“956971956”,“id”:“ngef”,“account_id”:“ftr8ac”,“created_at”:“2012-11-27T11:00:39Z”,“updated_at”:“2012-11-27T11:00:39Z”,“deleted”:false,“promotable_user_type”:“FULL”}],“data_type”:“promotable_user”,“total_count”:1,“next_cursor”:null}

Sorry to bother you. I’m looking forward to hearing from you again.
Thanks.


#5

No worries at all @themoon287 - and no need to apologize!

From the looks of things, 956971956's Tweets are protected, which I believe is the reason behind this. Try this endpoint with a promotable_user whose Tweets are not protected.


POST promoted_tweets
#6

If you have a look at this page on “About eligibility for Twitter Ads”, under the Overall Account Status section you will find the following quote:

Protected Tweets - Twitter users can protect their Tweets in order to control who can view them. This setting is not currently supported within Twitter Ads. If your Tweets are protected and you are interested in advertising, you will first need to make your Tweets public from your Settings page.


#7

I have got it. Thank you so much ! :slightly_smiling: