Account Activity API Migration Guide

This guide is designed to help you migrate from legacy User Streams and Site Streams APIs to their replacement, the Account Activity API. Below you will find a summary of the changes, new features list, as well as key differences and considerations to help with the transition. The new AAAPI is in beta and can be applied for here. For guidance in migrating from basic DM endpoints, please refer to the Direct Message migration guide.

Summary of Changes

On June 19th, 2018 the following User Streams and Site Streams endpoints will be unavailable and will result in a 404 response. The most apparent change from US and SS to the AAAPI is that data is now sent via webhooks as opposed to a streaming connection. There are several important changes as a result, most importantly how users are added to your application and how data is delivered. Please see the following deprecated endpoints as well as their replacements below

Deprecated endpoints

GET site

GET user

Replacement endpoints

Enterprise Account Activity API - All Activities

Standard Account Activity API - All Activities

New Features

The Account Activity API offers many new features, most notably that data is now delivered via webhooks as opposed to streaming. Webhooks offer many benefits compared to streaming, but the most prominent is speed. The API will send you data in for form of JSON events as they become available and you will no longer need to maintain an active connection or poll the endpoint. This limits the need for redundancy features and increases efficiency overall. More information on webhooks can be found in the technical documentation.

Managing subscriptions

There are currently two product versions of Account Activity API. The two product versions allow you to separate subscription types between All Activities and Direct Messages. This means, you are able quickly get set up with the product and level of data your use case demands. It also means you can track subscriptions, as they pertain to your subscription limits, independently and across both products uniquely.

Differences & Migration Considerations

The new Account Activity API operates differently than UserStreams and SiteStreams. You will need to significantly alter your application to receive data with webhooks. You can find more information on webhooks here.

Another key difference you will notice in regards to data being delivered is that Twitter will no longer send events from people that you follow on Twitter. This was an intentional change and is not something we plan to alter going forward.

Deprecated message types

Blank lines

Blank lines will no longer be delivered in the Account Activity API as they were used as keep-alive messages in UserStreams and SiteStreams.

Limit notices

Limit notices will not longer be sent to a given webhook.  Instead, users can call the API to get current usage of available handles . This will be included in the developer portal at some time in the future.

Disconnect messages

Disconnect notices will no longer be necessary as webhooks do not rely on an active connection.

Stall warnings

Stall warnings will no longer be necessary as webhooks do not rely on an active connection being able to handle large numbers of incoming messages.

Friends list

Friends lists will no longer be sent proactively. There will now be a REST endpoint to get this information.


Deprecated Event Types

Description

Event Name

Source

Target

Target Object

User unfavorites a Tweet

unfavorite

Current user

Tweet author

Tweet

User’s Tweet is unfavorited

unfavorite

Unfavoriting user

Current user

Tweet

User unfollows someone

unfollow

Current user

Followed user

Null

User creates a list

list_created

Current user

Current user

List

User deletes a list

list_destroyed

Current user

Current user

List

User edits a list

list_updated

Current user

Current user

List

User adds someone to a list

list_member_added

Current user

Added user

List

User is added to a list

list_member_added

Adding user

Current user

List

User removes someone from a list

list_member_removed

Current user

Removed user

List

User is removed from a list

list_member_removed

Removing user

Current user

List

User subscribes to a list

list_user_subscribed

Current user

List owner

List

User’s list is subscribed to

list_user_subscribed

Subscribing user

Current user

List

User unsubscribes from a list

list_user_unsubscribed

Current user

List owner

List

User’s list is unsubscribed from

list_user_unsubscribed

Unsubscribing user

Current user

List

User updates their profile

user_update

Current user

Current user

Null

User updates their protected status

user_update

Current user

Current user

Null