twitter-api-client
Version:
Node.js / JavaScript client for Twitter API
437 lines (407 loc) • 17.6 kB
TypeScript
export interface FavoritesListParams {
/**
* The ID of the user for whom to return results.
*/
'user_id'?: string | number;
/**
* The screen name of the user for whom to return results.
*/
'screen_name'?: string;
/**
* Specifies the number of records to retrieve. Must be less than
or equal to 200; defaults to 20. The value of count is best thought of as
a limit to the number of Tweets to return because suspended or deleted content
is removed after the count has been applied.
*/
'count'?: string | number;
/**
* Returns results with an ID greater than (that is, more recent
than) the specified ID. There are limits to the number of Tweets which can
be accessed through the API. If the limit of Tweets has occured since the
since_id, the since_id will be forced to the oldest ID available.
*/
'since_id'?: string | number;
/**
* Returns results with an ID less than (that is, older than) or
equal to the specified ID.
*/
'max_id'?: string | number;
/**
* The entities node will be omitted when set to false .
*/
'include_entities'?: boolean;
/**
* This parameter enables developers to request a series of different extended fields introduced in the years since statuses/show and statuses/lookup were introduced. It has been replaced with the fields and expansions functionality.
*/
'tweet_mode'?: string;
}
export interface StatusesLookupParams {
/**
* A comma separated list of Tweet IDs, up to 100 are allowed in a single request.
*/
'id': string;
/**
* The entities node that may appear within embedded statuses will
not be included when set to false.
*/
'include_entities'?: boolean;
/**
* When set to either true , t or 1 , each Tweet returned in a timeline
will include a user object including only the status authors numerical ID.
Omit this parameter to receive the complete user object.
*/
'trim_user'?: boolean;
/**
* When using the map parameter, Tweets that do not exist or cannot
be viewed by the current user will still have their key represented but
with an explicitly null value paired with it
*/
'map'?: boolean;
/**
* If alt text has been added to any attached media entities, this
parameter will return an ext_alt_text value in the top-level key for the
media entity. If no value has been set, this will be returned as null
*/
'include_ext_alt_text'?: boolean;
/**
* When set to either true , t or 1 , each Tweet returned will include
a card_uri attribute when there is an ads card attached to the Tweet and
when that card was attached using the card_uri value.
*/
'include_card_uri'?: boolean;
/**
* This parameter enables developers to request a series of different extended fields introduced in the years since statuses/show and statuses/lookup were introduced. It has been replaced with the fields and expansions functionality.
*/
'tweet_mode'?: string;
}
export interface StatusesRetweetersIdsParams {
/**
* The numerical ID of the desired status.
*/
'id': string | number;
/**
* Specifies the number of records to retrieve. Must be less than or equal to 100.
*/
'count'?: string | number;
/**
* Causes the list of IDs to be broken into pages of no more than 100 IDs at a time.
The number of IDs returned is not guaranteed to be 100 as suspended users are
filtered out after connections are queried. If no cursor is provided, a value
of -1 will be assumed, which is the first "page." The response from the API
will include a previous_cursor and next_cursor to allow paging back and forth.
See our cursor docs for more information. While this method supports the cursor parameter,
the entire result set can be returned in a single cursored collection. Using the count
parameter with this method will not provide segmented cursors for use with this parameter.
*/
'cursor'?: string | number;
/**
* Many programming environments will not consume Tweet ids due to their size.
Provide this option to have ids returned as strings instead.
*/
'stringify_ids'?: boolean;
}
export interface StatusesRetweetsByIdParams {
/**
* The numerical ID of the desired status.
*/
'id': string | number;
/**
* Specifies the number of records to retrieve. Must be less than or equal to 100.
*/
'count'?: string | number;
/**
* When set to either true, t or 1 , each tweet returned in a timeline
will include a user object including only the status authors numerical ID.
Omit this parameter to receive the complete user object.
*/
'trim_user'?: boolean;
/**
* This parameter enables developers to request a series of different extended fields introduced in the years since statuses/show and statuses/lookup were introduced. It has been replaced with the fields and expansions functionality.
*/
'tweet_mode'?: string;
}
export interface StatusesRetweetsOfMeParams {
/**
* Specifies the number of records to retrieve. Must be less than
or equal to 100. If omitted, 20 will be assumed.
*/
'count'?: string | number;
/**
* Returns results with an ID greater than (that is, more recent
than) the specified ID. There are limits to the number of Tweets which can
be accessed through the API. If the limit of Tweets has occured since the
since_id, the since_id will be forced to the oldest ID available.
*/
'since_id'?: string | number;
/**
* Returns results with an ID less than (that is, older than) or equal to the specified ID.
*/
'max_id'?: string | number;
/**
* When set to either true , t or 1 , each tweet returned in a timeline
will include a user object including only the status authors numerical ID.
Omit this parameter to receive the complete user object.
*/
'trim_user'?: boolean;
/**
* The tweet entities node will not be included when set to false .
*/
'include_entities'?: boolean;
/**
* The user entities node will not be included when set to false.
*/
'include_user_entities'?: boolean;
/**
* This parameter enables developers to request a series of different extended fields introduced in the years since statuses/show and statuses/lookup were introduced. It has been replaced with the fields and expansions functionality.
*/
'tweet_mode'?: string;
}
export interface StatusesShowParams {
/**
* The numerical ID of the desired Tweet.
*/
'id': string | number;
/**
* When set to either true , t or 1 , each Tweet returned in a timeline
will include a user object including only the status authors numerical ID.
Omit this parameter to receive the complete user object.
*/
'trim_user'?: boolean;
/**
* When set to either true , t or 1 , any Tweets returned that have
been retweeted by the authenticating user will include an additional current_user_retweet
node, containing the ID of the source status for the retweet.
*/
'include_my_retweet'?: boolean;
/**
* The entities node will not be included when set to false.
*/
'include_entities'?: boolean;
/**
* If alt text has been added to any attached media entities, this
parameter will return an ext_alt_text value in the top-level key for the
media entity. If no value has been set, this will be returned as null
*/
'include_ext_alt_text'?: boolean;
/**
* When set to either true , t or 1 , the retrieved Tweet will include a card_uri attribute when there is an ads card attached to the Tweet and when that card was attached using the card_uri value.
*/
'include_card_uri'?: boolean;
/**
* This parameter enables developers to request a series of different extended fields introduced in the years since statuses/show and statuses/lookup were introduced. It has been replaced with the fields and expansions functionality.
*/
'tweet_mode'?: string;
}
export interface FavoritesCreateParams {
/**
* The numerical ID of the Tweet to like.
*/
'id': string | number;
/**
* The entities node will be omitted when set to false .
*/
'include_entities'?: boolean;
/**
* This parameter enables developers to request a series of different extended fields introduced in the years since statuses/show and statuses/lookup were introduced. It has been replaced with the fields and expansions functionality.
*/
'tweet_mode'?: string;
}
export interface FavoritesDestroyParams {
/**
* The numerical ID of the Tweet to un-like
*/
'id': string | number;
/**
* The entities node will be omitted when set to false .
*/
'include_entities'?: boolean;
/**
* This parameter enables developers to request a series of different extended fields introduced in the years since statuses/show and statuses/lookup were introduced. It has been replaced with the fields and expansions functionality.
*/
'tweet_mode'?: string;
}
export interface StatusesDestroyByIdParams {
/**
* The numerical ID of the desired status.
*/
'id': string | number;
/**
* When set to either true, t or 1, each tweet returned in a timeline will include a user object including only the status authors numerical ID. Omit this parameter to receive the complete user object.
*/
'trim_user'?: boolean;
/**
* This parameter enables developers to request a series of different extended fields introduced in the years since statuses/show and statuses/lookup were introduced. It has been replaced with the fields and expansions functionality.
*/
'tweet_mode'?: string;
}
export interface StatusesOembedParams {
/**
* The URL of the Tweet to be embedded.
*/
'url': string;
/**
* The maximum width of a rendered Tweet in whole pixels. A supplied value under or over the allowed range will be returned as the minimum or maximum supported width respectively; the reset width value will be reflected in the returned width property. Note that Twitter does not support the oEmbed maxheight parameter. Tweets are fundamentally text, and are therefore of unpreditable height that cannot be scaled like an image or video. Relatedly, the oEmbed response will not provide a value for height. Implementations that need consistent heights for Tweets should refer to the hide_thread and hide_media parameters below.
*/
'maxwidth'?: string | number;
/**
* When set to true, "t", or 1 links in a Tweet are not expanded to photo, video, or link previews.
*/
'hide_media'?: boolean;
/**
* When set to true, "t", or 1 a collapsed version of the previous Tweet in a conversation thread will not be displayed when the requested Tweet is in reply to another Tweet.
*/
'hide_thread'?: boolean;
/**
* When set to true, "t", or 1 the <script> responsible for loading widgets.js will not be returned. Your webpages should include their own reference to widgets.js for use across all Twitter widgets including Embedded Tweets.
*/
'omit_script'?: boolean;
/**
* Specifies whether the embedded Tweet should be floated left, right, or center in the page relative to the parent element.
*/
'align'?: string;
/**
* A comma-separated list of Twitter usernames related to your content. This value will be forwarded to Tweet action intents if a viewer chooses to reply, like, or retweet the embedded Tweet.
*/
'related'?: string;
/**
* Request returned HTML and a rendered Tweet in the specified Twitter Language supported by embedded Tweets.
*/
'lang'?: string;
/**
* When set to dark, the Tweet is displayed with light text over a dark background.
*/
'theme'?: string;
/**
* Adjust the color of the Tweet text links with a hexadecimal color value.
*/
'link_color'?: string;
/**
* Set to video to return a Twitter Video embed for the given Tweet.
*/
'widget_type'?: string;
/**
* When set to true, the Tweet and its embedded page on your site are not used for purposes that included personalized suggestions and personalized ads.
*/
'dnt'?: boolean;
}
export interface StatusesRetweetByIdParams {
/**
* The numerical ID of the desired status.
*/
'id': string | number;
/**
* When set to either true , t or 1 , each tweet returned in a timeline
will include a user object including only the status authors numerical ID.
Omit this parameter to receive the complete user object.
*/
'trim_user'?: boolean;
}
export interface StatusesUnretweetByIdParams {
/**
* The numerical ID of the desired status.
*/
'id': string | number;
/**
* When set to either true , t or 1 , each Tweet returned in a timeline will include a user object including only the status authors numerical ID. Omit this parameter to receive the complete user object.
*/
'trim_user'?: boolean;
/**
* This parameter enables developers to request a series of different extended fields introduced in the years since statuses/show and statuses/lookup were introduced. It has been replaced with the fields and expansions functionality.
*/
'tweet_mode'?: string;
}
export interface StatusesUpdateParams {
/**
* The text of the status update. URL encode as necessary. t.co link wrapping will affect character counts.
*/
'status': string;
/**
* The text of the status update. URL encode as necessary. t.co link wrapping will affect character counts.
*/
'in_reply_to_status_id'?: string | number;
/**
* If set to true and used with in_reply_to_status_id, leading @mentions will be looked
up from the original Tweet, and added to the new Tweet from there.
This wil append @mentions into the metadata of an extended Tweet as a reply chain grows,
until the limit on @mentions is reached. In cases where the original
Tweet has been deleted, the reply will fail.
*/
'auto_populate_reply_metadata'?: boolean;
/**
* When used with auto_populate_reply_metadata, a comma-separated list of user
ids which will be removed from the server-generated @mentions prefix on an
extended Tweet. Note that the leading @mention cannot be removed as it would
break the in-reply-to-status-id semantics. Attempting to remove it will be
silently ignored.
*/
'exclude_reply_user_ids'?: string | number;
/**
* In order for a URL to not be counted in the status body of an extended Tweet,
provide a URL as a Tweet attachment. This URL must be a Tweet permalink, or Direct Message deep link.
Arbitrary, non-Twitter URLs must remain in the status text. URLs passed to the
attachment_url parameter not matching either a Tweet permalink or Direct Message
deep link will fail at Tweet creation and cause an exception.
*/
'attachment_url'?: string;
/**
* A comma-delimited list of media_ids to associate with the Tweet.
You may include up to 4 photos or 1 animated GIF or 1 video in a Tweet.
See Uploading Media for further details on uploading media.
*/
'media_ids'?: string | number;
/**
* If you upload Tweet media that might be considered sensitive
content such as nudity, or medical procedures, you must set this value
to true. See Media setting and best practices for more context.
*/
'possibly_sensitive'?: boolean;
/**
* The latitude of the location this Tweet refers to.
This parameter will be ignored unless it is inside the range
-90.0 to +90.0 (North is positive) inclusive. It will also be
ignored if there is no corresponding long parameter.
*/
'lat'?: string | number;
/**
* The longitude of the location this Tweet refers to.
The valid ranges for longitude are -180.0 to +180.0 (East is positive) inclusive.
This parameter will be ignored if outside that range, if it is not a number,
if geo_enabled is disabled, or if there no corresponding lat parameter.
*/
'long'?: string | number;
/**
* A place in the world.
*/
'place_id'?: string;
/**
* Whether or not to put a pin on the exact coordinates a Tweet has been sent from.
*/
'display_coordinates'?: boolean;
/**
* When set to either true , t or 1 , the response will include a user
object including only the author's ID. Omit this parameter
to receive the complete user object.
*/
'trim_user'?: boolean;
/**
* When set to true, enables shortcode commands for sending Direct Messages
as part of the status text to send a Direct Message to a user. When set
to false, disables this behavior and includes any leading characters in
the status text that is posted
*/
'enable_dmcommands'?: boolean;
/**
* When set to true, causes any status text that starts with shortcode commands
to return an API error. When set to false, allows shortcode commands
to be sent in the status text and acted on by the API.
*/
'fail_dmcommands'?: boolean;
/**
* Associate an ads card with the Tweet using the card_uri value from any ads card response.
*/
'card_uri'?: string;
/**
* This parameter enables developers to request a series of different extended fields introduced in the years since statuses/show and statuses/lookup were introduced. It has been replaced with the fields and expansions functionality.
*/
'tweet_mode'?: string;
}