Hi,

We have succesfully subscribed webhooks for one our testing accounts. The webhooks provide the data in wrong format though, except the direct messages.

For example, when creating a new tweet, the format is NOT like described here: https://developer.twitter.com/en/docs/accounts-and-users/subscribe-account-activity/guides/account-activity-data-objects#tweet_create_events but in the “old” format:

{
  "id": "7df1adaa77eaf3a018d95e393ef45a54",
  "user": {
    "id": 1,
    "url": null,
    "lang": "en",
    "name": "Iron Test",
    "id_str": "2",
    "location": null,
    "verified": false,
    "following": null,
    "protected": false,
    "time_zone": null,
    "created_at": "Fri May 27 09:13:48 +0000 2016",
    "utc_offset": null,
    "description": null,
    "geo_enabled": false,
    "screen_name": "johndoe",
    "listed_count": 0,
    "friends_count": 6,
    "is_translator": false,
    "notifications": null,
    "statuses_count": 38,
    "default_profile": true,
    "followers_count": 2,
    "translator_type": "none",
    "favourites_count": 4,
    "profile_image_url": "http://abs.twimg.com/sticky/default_profile_images/default_profile_normal.png",
    "profile_link_color": "1DA1F2",
    "profile_text_color": "333333",
    "follow_request_sent": null,
    "contributors_enabled": false,
    "default_profile_image": false,
    "profile_background_tile": false,
    "profile_image_url_https": "https://abs.twimg.com/sticky/default_profile_images/default_profile_normal.png",
    "profile_background_color": "F5F8FA",
    "profile_sidebar_fill_color": "DDEEF6",
    "profile_background_image_url": "",
    "profile_sidebar_border_color": "C0DEED",
    "profile_use_background_image": true,
    "profile_background_image_url_https": ""
  },
  "created_at": "Thu Jun 07 13:27:21 +0000 2018",
  "timestamp_ms": 1528378041844,
  "favorited_status": {
    "id": 3,
    "geo": null,
    "lang": "en",
    "text": "@johndoe Whats up dude?",
    "user": {
      "id": 4340188875,
      "url": null,
      "lang": "en",
      "name": "Yo!",
      "id_str": "4340188875",
      "location": null,
      "verified": false,
      "following": null,
      "protected": false,
      "time_zone": null,
      "created_at": "Tue Dec 01 13:38:40 +0000 2015",
      "utc_offset": null,
      "description": null,
      "geo_enabled": false,
      "screen_name": "JaneDoe",
      "listed_count": 0,
      "friends_count": 1,
      "is_translator": false,
      "notifications": null,
      "statuses_count": 45,
      "default_profile": true,
      "followers_count": 2,
      "translator_type": "none",
      "favourites_count": 1,
      "profile_image_url": "http://abs.twimg.com/sticky/default_profile_images/default_profile_normal.png",
      "profile_link_color": "1DA1F2",
      "profile_text_color": "333333",
      "follow_request_sent": null,
      "contributors_enabled": false,
      "default_profile_image": false,
      "profile_background_tile": false,
      "profile_image_url_https": "https://abs.twimg.com/sticky/default_profile_images/default_profile_normal.png",
      "profile_background_color": "C0DEED",
      "profile_sidebar_fill_color": "DDEEF6",
      "profile_background_image_url": "http://abs.twimg.com/images/themes/theme1/bg.png",
      "profile_sidebar_border_color": "C0DEED",
      "profile_use_background_image": true,
      "profile_background_image_url_https": "https://abs.twimg.com/images/themes/theme1/bg.png"
    },
    "place": null,
    "id_str": "3",
    "source": "<a href=\"http://twitter.com\" rel=\"nofollow\">Twitter Web Client</a>",
    "entities": {
      "urls": [],
      "symbols": [],
      "hashtags": [],
      "user_mentions": [
        {
          "id": 1,
          "name": "Iron Test",
          "id_str": "2",
          "indices": [
            0,
            11
          ],
          "screen_name": "johndoe"
        }
      ]
    },
    "favorited": false,
    "retweeted": false,
    "truncated": false,
    "created_at": "Thu Jun 07 12:09:24 +0000 2018",
    "coordinates": null,
    "quote_count": 0,
    "reply_count": 2,
    "contributors": null,
    "filter_level": "low",
    "retweet_count": 0,
    "favorite_count": 1,
    "is_quote_status": false,
    "in_reply_to_user_id": 1,
    "in_reply_to_status_id": null,
    "in_reply_to_screen_name": "johndoe",
    "in_reply_to_user_id_str": "2",
    "in_reply_to_status_id_str": null
  }
}

From this format is not easily detected what type of an event that is. Is that a bug on a current system, and are those that are documented something that will follow later on?

Best Regards,
Iiro saukkonen

Hi @1ron,

The Tweet creation event should look like what is outlined on the documentation page you linked to. When I create a new Tweet using the account I am subscribed to, I am seeing the payload as documented. Could you try unsubscribing then resubscribing to this account and creating a new Tweet with it?

{
	"for_user_id": "2244994945",
	"tweet_create_events": [
	  { 
[Tweet Object]
}]}

Best,
Kevin

Hi,

It works now properly. The mistake was at our end, how we processed the event prematurely :slight_smile:

Sorry for the noise!

1 Like