[Step 4/5] Set article content from Markdown
Step 4 of 5 — Set the article body by providing Markdown text.
article_id: obtained from Step 1markdown: supports headings, bold/italic, lists, code blocks, and inline images ()
Inline images are automatically uploaded to X and embedded in the article.
Retour à la référence API
/Article Endpoints
PUT
/x/articles/{article_id}/contentAutorisation API
AuthorizationBearer token · headerrequisJeton Bearer global pour TwexAPI. Inclus sous la forme : Authorization: Bearer <YOUR_TWEXAPI_KEY>.
Paramètres de chemin
article_idstringrequisCorps de la requête
requisapplication/jsoncookiestringrequisIdentifiants de session ou auth_token autorisés de l'utilisateur (BYOC — Bring Your Own Cookie). Exécution proxy sans état avec zéro rétention d'identifiants. Consultez [Sécurité et Authentification](/fr/authentication#write-operations--byoc-bring-your-own-cookie) et [Comment obtenir un Cookie](https://youtube-promotion.pages.dev/how-to-get-twitter-cookie).
markdownstringrequisArticle body in Markdown format
Réponses
200Réponse réussie
codeintegerrequisCode d'état HTTP (200 indique le succès)
msgstringrequisMessage de réponse (ex. 'success')
dataArticleContentData | anyDonnées principales renvoyées par l'API
Afficher les propriétésMasquer les propriétés
Any of:
ArticleContentData
blocksintegerrequisNumber of content blocks parsed from the Markdown (paragraphs, headings, images, etc.)
any
any422Erreur de validation des paramètres
detailValidationError[]Afficher les propriétésMasquer les propriétés
Array of
ValidationErrorlocstring | integer[]requisAfficher les propriétésMasquer les propriétés
Array of
string | integerAny of:
string
stringinteger
integermsgstringrequisMessage de réponse (ex. 'success')
typestringrequisinputanyctxobject429Daily tweet limit reached
500Server error
⚡Console interactivePUT
⚡Console interactive / Tester l'APIPUTLive Console
🌐Serveur cible :
https://api.twexapi.io● Prêt pour la production
✍️
Guide d'identification d'écriture (Clé TwexAPI + Cookie Twitter)
1. Clé TwexAPI (Bearer Token) : À renseigner sous "Autorisation API" ci-dessous pour la facturation et l'authentification.
2. Cookie Twitter : Pour les opérations d'écriture (tweet, like, etc.), renseignez le Cookie Twitter (ex : auth_token=...; ct0=...) dans le champ cookie ci-dessous.
🔑Autorisation API
⚙️Paramètres (1)
📝Corps de la requêteapplication/json
📡
暂无响应数据
请在「请求配置」中确认参数后,点击底部的「发送请求」按钮。
Requête
curl -X PUT "https://api.twexapi.io/x/articles/string/content" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"cookie": "string",
"markdown": "string"
}'const response = await fetch("https://api.twexapi.io/x/articles/string/content", {
method: "PUT",
headers: {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"cookie": "string",
"markdown": "string"
})
});import requests
response = requests.put(
"https://api.twexapi.io/x/articles/string/content",
headers={
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
json={
"cookie": "string",
"markdown": "string"
},
)Réponse
{
"code": 0,
"msg": "string",
"data": {
"blocks": 0
}
}{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string",
"input": null,
"ctx": {}
}
]
}{
"code": 429,
"msg": "Daily tweet limit reached, please try again tomorrow."
}{
"code": 500,
"msg": "Internal server error"
}