XApiEx.Api.Media (x_api_ex v1.0.0)

API calls for all endpoints tagged Media.

Summary

Functions

Create Media Metadata Allows an authenticated user to add metadata to uploaded media. You can use this endpoint to attach alt text to media. The media_id parameter specifies the media, while the alt_text contains the descriptive text. For full details, see the API reference for this endpoint. To get started, sign up for the X API.

Create Media Subtitles Allows an authenticated user to add subtitles to uploaded media. You can use this endpoint to provide subtitles for media. The media_id parameter identifies the media, while additional parameters define the subtitle language and file content. For full details, see the API reference for this endpoint. To get started, sign up for the X API.

Delete Media Subtitles Allows an authenticated user to delete subtitles from uploaded media. You can use this endpoint to remove previously added subtitle information from media. The media_id parameter identifies the media, and specify other parameters to delete the subtitle. For full details, see the API reference for this endpoint. To get started, sign up for the X API.

Media Upload STATUS Allows an authenticated user to check the processing status of uploaded media. You can use this endpoint to monitor the status of video. The media_id parameter is from the the uploaded media, and the command=STATUS parameter retrieves information about whether the processing status is pending, in progress, or complete. For full details, see the API reference for this endpoint. To get started, sign up for the X API.

Upload Media Allows an authenticated user to upload media. You can use this endpoint to upload videos before attaching them to Tweets. The media_type parameter specifies the type of media, while the command parameter controls the upload process by initializing, appending and finalizing the upload. For full details, see the API reference for this endpoint. To get started, sign up for the X API.

Functions

create_media_metadata(connection, opts \\ [])

@spec create_media_metadata(
  Tesla.Env.client(),
  keyword()
) ::
  {:ok, XApiEx.Model.ApiError.t()}
  | {:ok, XApiEx.Model.CreateMediaMetadata200Response.t()}
  | {:ok, XApiEx.Model.ApiError.t()}
  | {:error, Tesla.Env.t()}

Create Media Metadata Allows an authenticated user to add metadata to uploaded media. You can use this endpoint to attach alt text to media. The media_id parameter specifies the media, while the alt_text contains the descriptive text. For full details, see the API reference for this endpoint. To get started, sign up for the X API.

Parameters

  • connection (XApiEx.Connection): Connection to server
  • opts (keyword): Optional parameters
    • :body (CreateMediaMetadataRequest):

Returns

  • {:ok, XApiEx.Model.CreateMediaMetadata200Response.t} on success
  • {:error, Tesla.Env.t} on failure

create_media_subtitles(connection, opts \\ [])

@spec create_media_subtitles(
  Tesla.Env.client(),
  keyword()
) ::
  {:ok, XApiEx.Model.ApiError.t()}
  | {:ok, XApiEx.Model.CreateMediaSubtitles200Response.t()}
  | {:ok, XApiEx.Model.ApiError.t()}
  | {:error, Tesla.Env.t()}

Create Media Subtitles Allows an authenticated user to add subtitles to uploaded media. You can use this endpoint to provide subtitles for media. The media_id parameter identifies the media, while additional parameters define the subtitle language and file content. For full details, see the API reference for this endpoint. To get started, sign up for the X API.

Parameters

  • connection (XApiEx.Connection): Connection to server
  • opts (keyword): Optional parameters
    • :body (CreateMediaSubtitlesRequest):

Returns

  • {:ok, XApiEx.Model.CreateMediaSubtitles200Response.t} on success
  • {:error, Tesla.Env.t} on failure

delete_media_subtitles(connection, opts \\ [])

@spec delete_media_subtitles(
  Tesla.Env.client(),
  keyword()
) ::
  {:ok, XApiEx.Model.ApiError.t()}
  | {:ok, XApiEx.Model.ApiError.t()}
  | {:ok, XApiEx.Model.DeleteAPost200Response.t()}
  | {:error, Tesla.Env.t()}

Delete Media Subtitles Allows an authenticated user to delete subtitles from uploaded media. You can use this endpoint to remove previously added subtitle information from media. The media_id parameter identifies the media, and specify other parameters to delete the subtitle. For full details, see the API reference for this endpoint. To get started, sign up for the X API.

Parameters

  • connection (XApiEx.Connection): Connection to server
  • opts (keyword): Optional parameters
    • :body (DeleteMediaSubtitlesRequest):

Returns

  • {:ok, XApiEx.Model.DeleteAPost200Response.t} on success
  • {:error, Tesla.Env.t} on failure

media_upload_status(connection, opts \\ [])

@spec media_upload_status(
  Tesla.Env.client(),
  keyword()
) ::
  {:ok, XApiEx.Model.ApiError.t()}
  | {:ok, XApiEx.Model.MediaUploadStatus200Response.t()}
  | {:ok, XApiEx.Model.ApiError.t()}
  | {:error, Tesla.Env.t()}

Media Upload STATUS Allows an authenticated user to check the processing status of uploaded media. You can use this endpoint to monitor the status of video. The media_id parameter is from the the uploaded media, and the command=STATUS parameter retrieves information about whether the processing status is pending, in progress, or complete. For full details, see the API reference for this endpoint. To get started, sign up for the X API.

Parameters

  • connection (XApiEx.Connection): Connection to server
  • opts (keyword): Optional parameters
    • :media_id (String.t): Media id for the requested media upload status.
    • :command (String.t): The command for the media upload request.

Returns

  • {:ok, XApiEx.Model.MediaUploadStatus200Response.t} on success
  • {:error, Tesla.Env.t} on failure

upload_media(connection, opts \\ [])

@spec upload_media(
  Tesla.Env.client(),
  keyword()
) ::
  {:ok, nil}
  | {:ok, XApiEx.Model.ApiError.t()}
  | {:ok, XApiEx.Model.UploadMedia202Response.t()}
  | {:ok, XApiEx.Model.UploadMedia200Response.t()}
  | {:ok, XApiEx.Model.ApiError.t()}
  | {:error, Tesla.Env.t()}

Upload Media Allows an authenticated user to upload media. You can use this endpoint to upload videos before attaching them to Tweets. The media_type parameter specifies the type of media, while the command parameter controls the upload process by initializing, appending and finalizing the upload. For full details, see the API reference for this endpoint. To get started, sign up for the X API.

Parameters

  • connection (XApiEx.Connection): Connection to server
  • opts (keyword): Optional parameters
    • :media_type (String.t): Specifies the MIME type of the media being uploaded
    • :command (String.t): command : Specifies the current step in the media upload process. Allowed values: INIT, APPEND, FINALIZE, STATUS
    • :media (String.t):

Returns

  • {:ok, XApiEx.Model.UploadMedia200Response.t} on success
  • {:error, Tesla.Env.t} on failure