Hi,

I’m experimenting around with the Twitter Ads API and am trying to send a Push-to-Device preview, but keep getting a FORBIDDEN error.

{
  "errors": [
    {
      "code": "FORBIDDEN",
      "message": "Your user account is not permitted to access this feature"
    }
  ],
  "request": {
    "params": {}
  }
}

First, I created a Draft Tweet…

twurl -H ads-api.twitter.com -X POST "/4/accounts/18ce54h6ntv/draft_tweets?text=Test push-to-device preview&card_uri=card://1054883101480906752&as_user_id=825082408299028480"
{
  "request": {
    "params": {
      "text": "Test push-to-device preview",
      "as_user_id": 825082408299028500,
      "card_uri": "card://1054883101480906752"
    }
  },
  "data": {
    "id_str": "1087926031334498305",
    "text": "Test push-to-device preview",
    "user_id": "825082408299028480",
    "id": 1087926031334498300,
    "media_ids": [],
    "nullcast": true,
    "created_at": "2019-01-23T04:12:33Z",
    "card_uri": "card://1054883101480906752",
    "updated_at": "2019-01-23T04:12:33Z",
    "media_keys": []
  }
}

Then I attempted to send a notification to my device…

twurl -H ads-api.twitter.com -X POST "/4/accounts/18ce54h6ntv/draft_tweets/preview/1087926031334498305"

This is when I get the error.

{
  "errors": [
    {
      "code": "FORBIDDEN",
      "message": "Your user account is not permitted to access this feature"
    }
  ],
  "request": {
    "params": {}
  }
}

I’ve tried different solutions to see if maybe I actually had an error, but I can’t seem to find where it would be? I’ve checked the account permission level via the accounts/:account_id/authenticated_user_access endpoint and I am the Account Admin. Does this feature require whitelisting of some sort?

Thanks!

Thanks, @SamSchmir. Some ads accounts are currently seeing this issue. We’re working to resolve. We’ll let you know once it’s fixed.

1 Like

@SamSchmir: Could you please try again?

Success! Thanks so much, @juanshishido.

Draft

twurl -H ads-api.twitter.com -X POST "/4/accounts/18ce54h6ntv/draft_tweets?text=Test Push-to-Device Preview&card_uri=card://1054883101480906752&as_user_id=825082408299028480"
{
  "request": {
    "params": {
      "text": "Test Push-to-Device Preview",
      "as_user_id": 825082408299028500,
      "card_uri": "card://1054883101480906752"
    }
  },
  "data": {
    "id_str": "1089027147266748418",
    "text": "Test Push-to-Device Preview",
    "user_id": "825082408299028480",
    "id": 1089027147266748400,
    "media_ids": [],
    "nullcast": true,
    "created_at": "2019-01-26T05:07:59Z",
    "card_uri": "card://1054883101480906752",
    "updated_at": "2019-01-26T05:07:59Z",
    "media_keys": []
  }
}

Push to Device

`twurl -H ads-api.twitter.com -X POST "/4/accounts/18ce54h6ntv/draft_tweets/preview/1089027147266748418"
{
  "request": {
    "params": {
      "account_id": "18ce54h6ntv",
      "draft_tweet_id": "1089027147266748418"
    }
  },
  "message": "See @Hooray's notifications in the Twitter app to preview your Tweet."
}

1 Like

Let’s see a screenshot! Haha

Glad to hear it’s working. Thanks again for reporting.

Although I personally won’t really have a good use for this feature, it’s pretty neat! Definitely will be handy for big advertisers.

1 Like

Great to see!

1 Like