From: Harmon Date: Sat, 20 Feb 2021 00:34:17 +0000 (-0600) Subject: Add documentation for API.simple_upload X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=b2aa154b9d193aa9adf5b25648a54f05f9b9386f;p=tweepy.git Add documentation for API.simple_upload --- diff --git a/docs/api.rst b/docs/api.rst index 9241fde..e2a4810 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -1346,6 +1346,28 @@ Media methods :rtype: :class:`Media` object +.. method:: API.simple_upload(filename, [file], [media_category], \ + [additional_owners]) + + Use this endpoint to upload images to Twitter. + This does not use the chunked upload endpoint. + + :param filename: The filename of the image to upload. This will + automatically be opened unless ``file`` is specified. + :param file: A file object, which will be used instead of opening + ``filename``. ``filename`` is still required, for MIME type + detection and to use as a form field in the POST data. + :param media_category: The category that represents how the media will be + used. This field is required when using the media + with the Ads API. + :param additional_owners: A list of user IDs to set as additional owners + allowed to use the returned ``media_id`` in Tweet + or Cards. Up to 100 additional owners may be + specified. + + :rtype: :class:`Media` object + + .. method:: API.create_media_metadata(media_id, alt_text) This endpoint can be used to provide additional information about the