मुख्य सामग्री पर जाएं
POST
/
2
/
media
/
upload
/
initialize
मीडिया अपलोड आरंभ करें
curl --request POST \
  --url https://api.x.com/2/media/upload/initialize \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "additional_owners": [
    "2244994945"
  ],
  "media_category": "tweet_video",
  "media_type": "video/mp4",
  "shared": true,
  "total_bytes": 8589934592
}
'
{
  "data": {
    "id": "1146654567674912769",
    "media_key": "<string>",
    "expires_after_secs": 123,
    "processing_info": {
      "check_after_secs": 123,
      "progress_percent": 123
    },
    "size": 123
  },
  "errors": [
    {
      "title": "<string>",
      "type": "<string>",
      "detail": "<string>",
      "status": 123
    }
  ]
}

Documentation Index

Fetch the complete documentation index at: https://generaltranslation.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

प्राधिकरण

Authorization
string
header
आवश्यक

The access token received from the authorization server in the OAuth 2.0 flow.

बॉडी

application/json
additional_owners
string[]

इस उपयोगकर्ता का विशिष्ट पहचानकर्ता। इसे स्ट्रिंग के रूप में लौटाया जाता है, ताकि उन भाषाओं और टूल्स से जुड़ी जटिलताओं से बचा जा सके जो बड़े पूर्णांकों को संभाल नहीं सकते।

Pattern: ^[0-9]{1,19}$
media_category
enum<string>

एक स्ट्रिंग enum मान, जो मीडिया उपयोग-प्रकरण की पहचान करता है। इस पहचानकर्ता का उपयोग उपयोग-प्रकरण-विशिष्ट प्रतिबंधों (जैसे, फ़ाइल आकार, वीडियो अवधि) को लागू करने और उन्नत सुविधाओं को सक्षम करने के लिए किया जाता है।

उपलब्ध विकल्प:
amplify_video,
tweet_gif,
tweet_image,
tweet_video,
dm_gif,
dm_image,
dm_video,
subtitles
उदाहरण:

"tweet_video"

media_type
enum<string>

मीडिया का प्रकार।

उपलब्ध विकल्प:
video/mp4,
video/webm,
video/mp2t,
video/quicktime,
text/srt,
text/vtt,
image/jpeg,
image/gif,
image/bmp,
image/png,
image/webp,
image/pjpeg,
image/tiff,
model/gltf-binary,
model/vnd.usdz+zip
उदाहरण:

"video/mp4"

shared
boolean

क्या यह मीडिया साझा है या नहीं।

total_bytes
integer

बाइट्स में मीडिया अपलोड का कुल आकार।

आवश्यक सीमा: 0 <= x <= 17179869184

प्रतिक्रिया

अनुरोध सफल रहा।

मीडिया अपलोड अनुरोध की स्थिति प्राप्त करने पर मिलने वाला रिस्पॉन्स।

data
object
errors
object[]
Minimum array length: 1

IETF RFC 7807 (https://tools.ietf.org/html/rfc7807) में परिभाषित एक HTTP Problem Details ऑब्जेक्ट।