curl --request POST \
--url https://api.x.com/2/tweets \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"card_uri": "<string>",
"community_id": "1146654567674912769",
"direct_message_deep_link": "<string>",
"for_super_followers_only": false,
"geo": {
"place_id": "<string>"
},
"nullcast": false,
"quote_tweet_id": "1346889436626259968",
"share_with_followers": false,
"text": "Learn how to use the user Tweet timeline and user mention timeline endpoints in the X API v2 to explore Tweet\\u2026 https:\\/\\/t.co\\/56a0vZUx7i"
}
'import requests
url = "https://api.x.com/2/tweets"
payload = {
"card_uri": "<string>",
"community_id": "1146654567674912769",
"direct_message_deep_link": "<string>",
"for_super_followers_only": False,
"geo": { "place_id": "<string>" },
"nullcast": False,
"quote_tweet_id": "1346889436626259968",
"share_with_followers": False,
"text": "Learn how to use the user Tweet timeline and user mention timeline endpoints in the X API v2 to explore Tweet\u2026 https:\/\/t.co\/56a0vZUx7i"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
card_uri: '<string>',
community_id: '1146654567674912769',
direct_message_deep_link: '<string>',
for_super_followers_only: false,
geo: {place_id: '<string>'},
nullcast: false,
quote_tweet_id: '1346889436626259968',
share_with_followers: false,
text: 'Learn how to use the user Tweet timeline and user mention timeline endpoints in the X API v2 to explore Tweet\u2026 https:\/\/t.co\/56a0vZUx7i'
})
};
fetch('https://api.x.com/2/tweets', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.x.com/2/tweets",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'card_uri' => '<string>',
'community_id' => '1146654567674912769',
'direct_message_deep_link' => '<string>',
'for_super_followers_only' => false,
'geo' => [
'place_id' => '<string>'
],
'nullcast' => false,
'quote_tweet_id' => '1346889436626259968',
'share_with_followers' => false,
'text' => 'Learn how to use the user Tweet timeline and user mention timeline endpoints in the X API v2 to explore Tweet\\u2026 https:\\/\\/t.co\\/56a0vZUx7i'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.x.com/2/tweets"
payload := strings.NewReader("{\n \"card_uri\": \"<string>\",\n \"community_id\": \"1146654567674912769\",\n \"direct_message_deep_link\": \"<string>\",\n \"for_super_followers_only\": false,\n \"geo\": {\n \"place_id\": \"<string>\"\n },\n \"nullcast\": false,\n \"quote_tweet_id\": \"1346889436626259968\",\n \"share_with_followers\": false,\n \"text\": \"Learn how to use the user Tweet timeline and user mention timeline endpoints in the X API v2 to explore Tweet\\\\u2026 https:\\\\/\\\\/t.co\\\\/56a0vZUx7i\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.x.com/2/tweets")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"card_uri\": \"<string>\",\n \"community_id\": \"1146654567674912769\",\n \"direct_message_deep_link\": \"<string>\",\n \"for_super_followers_only\": false,\n \"geo\": {\n \"place_id\": \"<string>\"\n },\n \"nullcast\": false,\n \"quote_tweet_id\": \"1346889436626259968\",\n \"share_with_followers\": false,\n \"text\": \"Learn how to use the user Tweet timeline and user mention timeline endpoints in the X API v2 to explore Tweet\\\\u2026 https:\\\\/\\\\/t.co\\\\/56a0vZUx7i\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.x.com/2/tweets")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"card_uri\": \"<string>\",\n \"community_id\": \"1146654567674912769\",\n \"direct_message_deep_link\": \"<string>\",\n \"for_super_followers_only\": false,\n \"geo\": {\n \"place_id\": \"<string>\"\n },\n \"nullcast\": false,\n \"quote_tweet_id\": \"1346889436626259968\",\n \"share_with_followers\": false,\n \"text\": \"Learn how to use the user Tweet timeline and user mention timeline endpoints in the X API v2 to explore Tweet\\\\u2026 https:\\\\/\\\\/t.co\\\\/56a0vZUx7i\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "1346889436626259968",
"text": "Learn how to use the user Tweet timeline and user mention timeline endpoints in the X API v2 to explore Tweet\\u2026 https:\\/\\/t.co\\/56a0vZUx7i"
},
"errors": [
{
"title": "<string>",
"type": "<string>",
"detail": "<string>",
"status": 123
}
]
}{
"code": 123,
"message": "<string>"
}पोस्ट बनाएँ या संपादित करें
प्रमाणीकृत उपयोगकर्ता के लिए एक नई पोस्ट बनाता है, या edit_options दिए जाने पर किसी मौजूदा पोस्ट को संपादित करता है।
curl --request POST \
--url https://api.x.com/2/tweets \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"card_uri": "<string>",
"community_id": "1146654567674912769",
"direct_message_deep_link": "<string>",
"for_super_followers_only": false,
"geo": {
"place_id": "<string>"
},
"nullcast": false,
"quote_tweet_id": "1346889436626259968",
"share_with_followers": false,
"text": "Learn how to use the user Tweet timeline and user mention timeline endpoints in the X API v2 to explore Tweet\\u2026 https:\\/\\/t.co\\/56a0vZUx7i"
}
'import requests
url = "https://api.x.com/2/tweets"
payload = {
"card_uri": "<string>",
"community_id": "1146654567674912769",
"direct_message_deep_link": "<string>",
"for_super_followers_only": False,
"geo": { "place_id": "<string>" },
"nullcast": False,
"quote_tweet_id": "1346889436626259968",
"share_with_followers": False,
"text": "Learn how to use the user Tweet timeline and user mention timeline endpoints in the X API v2 to explore Tweet\u2026 https:\/\/t.co\/56a0vZUx7i"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
card_uri: '<string>',
community_id: '1146654567674912769',
direct_message_deep_link: '<string>',
for_super_followers_only: false,
geo: {place_id: '<string>'},
nullcast: false,
quote_tweet_id: '1346889436626259968',
share_with_followers: false,
text: 'Learn how to use the user Tweet timeline and user mention timeline endpoints in the X API v2 to explore Tweet\u2026 https:\/\/t.co\/56a0vZUx7i'
})
};
fetch('https://api.x.com/2/tweets', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.x.com/2/tweets",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'card_uri' => '<string>',
'community_id' => '1146654567674912769',
'direct_message_deep_link' => '<string>',
'for_super_followers_only' => false,
'geo' => [
'place_id' => '<string>'
],
'nullcast' => false,
'quote_tweet_id' => '1346889436626259968',
'share_with_followers' => false,
'text' => 'Learn how to use the user Tweet timeline and user mention timeline endpoints in the X API v2 to explore Tweet\\u2026 https:\\/\\/t.co\\/56a0vZUx7i'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.x.com/2/tweets"
payload := strings.NewReader("{\n \"card_uri\": \"<string>\",\n \"community_id\": \"1146654567674912769\",\n \"direct_message_deep_link\": \"<string>\",\n \"for_super_followers_only\": false,\n \"geo\": {\n \"place_id\": \"<string>\"\n },\n \"nullcast\": false,\n \"quote_tweet_id\": \"1346889436626259968\",\n \"share_with_followers\": false,\n \"text\": \"Learn how to use the user Tweet timeline and user mention timeline endpoints in the X API v2 to explore Tweet\\\\u2026 https:\\\\/\\\\/t.co\\\\/56a0vZUx7i\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.x.com/2/tweets")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"card_uri\": \"<string>\",\n \"community_id\": \"1146654567674912769\",\n \"direct_message_deep_link\": \"<string>\",\n \"for_super_followers_only\": false,\n \"geo\": {\n \"place_id\": \"<string>\"\n },\n \"nullcast\": false,\n \"quote_tweet_id\": \"1346889436626259968\",\n \"share_with_followers\": false,\n \"text\": \"Learn how to use the user Tweet timeline and user mention timeline endpoints in the X API v2 to explore Tweet\\\\u2026 https:\\\\/\\\\/t.co\\\\/56a0vZUx7i\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.x.com/2/tweets")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"card_uri\": \"<string>\",\n \"community_id\": \"1146654567674912769\",\n \"direct_message_deep_link\": \"<string>\",\n \"for_super_followers_only\": false,\n \"geo\": {\n \"place_id\": \"<string>\"\n },\n \"nullcast\": false,\n \"quote_tweet_id\": \"1346889436626259968\",\n \"share_with_followers\": false,\n \"text\": \"Learn how to use the user Tweet timeline and user mention timeline endpoints in the X API v2 to explore Tweet\\\\u2026 https:\\\\/\\\\/t.co\\\\/56a0vZUx7i\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "1346889436626259968",
"text": "Learn how to use the user Tweet timeline and user mention timeline endpoints in the X API v2 to explore Tweet\\u2026 https:\\/\\/t.co\\/56a0vZUx7i"
},
"errors": [
{
"title": "<string>",
"type": "<string>",
"detail": "<string>",
"status": 123
}
]
}{
"code": 123,
"message": "<string>"
}Authorizations
The access token received from the authorization server in the OAuth 2.0 flow.
Body
Card Uri पैरामीटर। यह Quote Tweet Id, Poll, Media और Direct Message Deep Link के साथ mutually exclusive है।
इस Community का अद्वितीय पहचानकर्ता।
^[0-9]{1,19}$"1146654567674912769"
बातचीत को सार्वजनिक timeline से निजी Direct Message में ले जाने का लिंक।
किसी मौजूदा पोस्ट को संपादित करने के विकल्प। दिए जाने पर, यह अनुरोध नया पोस्ट बनाने के बजाय निर्दिष्ट पोस्ट को संपादित करेगा।
Show child attributes
Show child attributes
Super followers के लिए exclusive Tweet।
जियोलोकेशन के लिए Tweet से जोड़ा जा रहा Place ID।
Show child attributes
Show child attributes
बनाए जा रहे Tweet से जोड़ी जा रही media जानकारी। यह Quote Tweet Id, Poll और Card URI के साथ mutually exclusive है।
Show child attributes
Show child attributes
Nullcasted (केवल promoted) पोस्ट्स सार्वजनिक timeline में दिखाई नहीं देते और फ़ॉलोअर्स को नहीं दिखाए जाते।
poll वाले Tweet के लिए poll विकल्प। यह Media, Quote Tweet Id और Card URI के साथ mutually exclusive है।
Show child attributes
Show child attributes
इस Tweet का विशिष्ट पहचानकर्ता। इसे स्ट्रिंग के रूप में लौटाया जाता है, ताकि उन भाषाओं और टूल्स में जटिलताओं से बचा जा सके जो बड़े पूर्णांकों को संभाल नहीं सकते।
^[0-9]{1,19}$"1346889436626259968"
जिस Tweet का जवाब दिया जा रहा है, उसकी Tweet जानकारी।
Show child attributes
Show child attributes
यह बताने वाली सेटिंग कि Tweet का जवाब कौन दे सकता है।
following, mentionedUsers, subscribers, verified कम्युनिटी पोस्ट को फ़ॉलोअर्स के साथ भी साझा करें।
Tweet की सामग्री।
"Learn how to use the user Tweet timeline and user mention timeline endpoints in the X API v2 to explore Tweet\\u2026 https:\\/\\/t.co\\/56a0vZUx7i"
Response
अनुरोध सफल रहा है।
Show child attributes
Show child attributes
1IETF RFC 7807 (https://tools.ietf.org/html/rfc7807) में परिभाषित एक HTTP Problem Details ऑब्जेक्ट।
- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
- Option 6
- Option 7
- Option 8
- Option 9
- Option 10
- Option 11
- Option 12
- Option 13
- Option 14
- Option 15
- Option 16
- Option 17
- Option 18
Show child attributes
Show child attributes