uploadInit

fun Media.uploadInit(    totalBytes: Int,     mediaType: MediaType,     mediaCategory: MediaCategory = MediaCategory.Default,     additionalOwners: List<Long>? = null,     vararg options: Option): JsonObjectApiAction<Media>

The INIT command request is used to initiate a file upload session. It returns a media_id which should be used to execute all subsequent requests. The next step after a successful return from INIT command is the APPEND command. See the Uploading media guide for constraints and requirements on media files.

Twitter API reference

Receiver

Media endpoint instance.

Return

JsonObjectApiAction for blue.starry.penicillin.models.Media model.

Parameters

totalBytes

The size of the media being uploaded in bytes.

mediaType

The MIME type of the media being uploaded.

mediaCategory

A string enum value which identifies a media usecase. This identifier is used to enforce usecase specific constraints (e.g. file size, video duration) and enable advanced features.

additionalOwners

A comma-separated list of user IDs to set as additional owners allowed to use the returned media_id in Tweets or Cards. Up to 100 additional owners may be specified.

options

Optional. Custom parameters of this request.