- createSubtitles
 - deleteSubtitles
 - createMetadata
 - getByKey
 - getByKeys
 - finalizeUpload
 - getUploadStatus
 - upload
 - appendUpload
 
Constructors
constructor
• new MediaClient(client): MediaClient
Creates a new media client instance
Parameters
| Name | Type | Description | 
|---|---|---|
client | Client | The main X API client instance | 
Returns
MediaClient
Defined in
media/client.ts:181Methods
getAnalytics
▸ getAnalytics(mediaKeys, endTime, startTime, granularity, options?): Promise<MediaAnalytics>
Get Media analytics
Retrieves analytics data for media.
Parameters
| Name | Type | Description | 
|---|---|---|
mediaKeys | any[] | A comma separated list of Media Keys. Up to 100 are allowed in a single request. | 
endTime | string | YYYY-MM-DDTHH:mm:ssZ. The UTC timestamp representing the end of the time range. | 
startTime | string | YYYY-MM-DDTHH:mm:ssZ. The UTC timestamp representing the start of the time range. | 
granularity | string | The granularity for the search counts results. | 
options | GetAnalyticsOptions | - | 
Returns
Promise<MediaAnalytics>
Promise resolving to the API response
Defined in
media/client.ts:210initializeUpload
▸ initializeUpload(options?): Promise<MediaUploadResponse>
Initialize media upload
Initializes a media upload.
Parameters
| Name | Type | 
|---|---|
options | InitializeUploadOptions | 
Returns
Promise<MediaUploadResponse>
Promise resolving to the API response
Defined in
media/client.ts:273createSubtitles
▸ createSubtitles(options?): Promise<SubtitlesCreateResponse>
Create Media subtitles
Creates subtitles for a specific Media file.
Parameters
| Name | Type | 
|---|---|
options | CreateSubtitlesOptions | 
Returns
Promise<SubtitlesCreateResponse>
Promise resolving to the API response
Defined in
media/client.ts:314deleteSubtitles
▸ deleteSubtitles(options?): Promise<SubtitlesDeleteResponse>
Delete Media subtitles
Deletes subtitles for a specific Media file.
Parameters
| Name | Type | 
|---|---|
options | DeleteSubtitlesOptions | 
Returns
Promise<SubtitlesDeleteResponse>
Promise resolving to the API response
Defined in
media/client.ts:355createMetadata
▸ createMetadata(options?): Promise<MetadataCreateResponse>
Create Media metadata
Creates metadata for a Media file.
Parameters
| Name | Type | 
|---|---|
options | CreateMetadataOptions | 
Returns
Promise<MetadataCreateResponse>
Promise resolving to the API response
Defined in
media/client.ts:396getByKey
▸ getByKey(mediaKey, options?): Promise<Get2MediaMediaKeyResponse>
Get Media by media key
Retrieves details of a specific Media file by its media key.
Parameters
| Name | Type | Description | 
|---|---|---|
mediaKey | string | A single Media Key. | 
options | GetByKeyOptions | - | 
Returns
Promise<Get2MediaMediaKeyResponse>
Promise resolving to the API response
Defined in
media/client.ts:441getByKeys
▸ getByKeys(mediaKeys, options?): Promise<Get2MediaResponse>
Get Media by media keys
Retrieves details of Media files by their media keys.
Parameters
| Name | Type | Description | 
|---|---|---|
mediaKeys | any[] | A comma separated list of Media Keys. Up to 100 are allowed in a single request. | 
options | GetByKeysOptions | - | 
Returns
Promise<Get2MediaResponse>
Promise resolving to the API response
Defined in
media/client.ts:491finalizeUpload
▸ finalizeUpload(id): Promise<MediaUploadResponse>
Finalize Media upload
Finalizes a Media upload request.
Parameters
| Name | Type | Description | 
|---|---|---|
id | string | The media id of the targeted media to finalize. | 
Returns
Promise<MediaUploadResponse>
Promise resolving to the API response
Defined in
media/client.ts:543getUploadStatus
▸ getUploadStatus(mediaId, options?): Promise<MediaUploadResponse>
Get Media upload status
Retrieves the status of a Media upload by its ID.
Parameters
| Name | Type | Description | 
|---|---|---|
mediaId | any | Media id for the requested media upload status. | 
options | GetUploadStatusOptions | - | 
Returns
Promise<MediaUploadResponse>
Promise resolving to the API response
Defined in
media/client.ts:581upload
▸ upload(options?): Promise<MediaUploadResponse>
Upload media
Uploads a media file for use in posts or other content.
Parameters
| Name | Type | 
|---|---|
options | UploadOptions | 
Returns
Promise<MediaUploadResponse>
Promise resolving to the API response
Defined in
media/client.ts:629appendUpload
▸ appendUpload(id, options?): Promise<MediaUploadAppendResponse>
Append Media upload
Appends data to a Media upload request.
Parameters
| Name | Type | Description | 
|---|---|---|
id | string | The media identifier for the media to perform the append operation. | 
options | AppendUploadOptions | - | 
Returns
Promise<MediaUploadAppendResponse>
Promise resolving to the API response