Skip to content

Commit 95329a7

Browse files
committed
Update documentation with latest OpenAPI spec
1 parent 99d484b commit 95329a7

File tree

2 files changed

+177
-0
lines changed

2 files changed

+177
-0
lines changed

openapi.json

Lines changed: 174 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2387,6 +2387,85 @@
23872387
}
23882388
}
23892389
},
2390+
"/2/dm_conversations/media/{dm_id}/{media_id}/{resource_id}" : {
2391+
"get" : {
2392+
"security" : [
2393+
{
2394+
"OAuth2UserToken" : [
2395+
"dm.read"
2396+
]
2397+
}
2398+
],
2399+
"tags" : [
2400+
"Direct Messages"
2401+
],
2402+
"summary" : "Download DM Media",
2403+
"description" : "Downloads media attached to a legacy Direct Message. The requesting user must be a participant in the conversation containing the specified DM event. The response body contains raw binary bytes.",
2404+
"externalDocs" : {
2405+
"url" : "https://developer.x.com/"
2406+
},
2407+
"operationId" : "dmConversationsMediaDownload",
2408+
"parameters" : [
2409+
{
2410+
"name" : "dm_id",
2411+
"in" : "path",
2412+
"description" : "The unique identifier of the Direct Message event containing the media.",
2413+
"required" : true,
2414+
"schema" : {
2415+
"$ref" : "#/components/schemas/DmEventId"
2416+
},
2417+
"style" : "simple"
2418+
},
2419+
{
2420+
"name" : "media_id",
2421+
"in" : "path",
2422+
"description" : "The unique identifier of the media attached to the Direct Message.",
2423+
"required" : true,
2424+
"schema" : {
2425+
"$ref" : "#/components/schemas/MediaId"
2426+
},
2427+
"style" : "simple"
2428+
},
2429+
{
2430+
"name" : "resource_id",
2431+
"in" : "path",
2432+
"description" : "The resource identifier of the media file, including file extension (e.g. 'hVJQTwig.jpg').",
2433+
"required" : true,
2434+
"schema" : {
2435+
"$ref" : "#/components/schemas/DmResourceId"
2436+
},
2437+
"style" : "simple"
2438+
}
2439+
],
2440+
"responses" : {
2441+
"200" : {
2442+
"description" : "The request has succeeded.",
2443+
"content" : {
2444+
"application/octet-stream" : {
2445+
"schema" : {
2446+
"$ref" : "#/components/schemas/BinaryPayload"
2447+
}
2448+
}
2449+
}
2450+
},
2451+
"default" : {
2452+
"description" : "The request has failed.",
2453+
"content" : {
2454+
"application/json" : {
2455+
"schema" : {
2456+
"$ref" : "#/components/schemas/Error"
2457+
}
2458+
},
2459+
"application/problem+json" : {
2460+
"schema" : {
2461+
"$ref" : "#/components/schemas/Problem"
2462+
}
2463+
}
2464+
}
2465+
}
2466+
}
2467+
}
2468+
},
23902469
"/2/dm_conversations/with/{participant_id}/dm_events" : {
23912470
"get" : {
23922471
"security" : [
@@ -15976,6 +16055,12 @@
1597616055
"$ref" : "#/components/schemas/UserId"
1597716056
}
1597816057
},
16058+
"DmResourceId" : {
16059+
"type" : "string",
16060+
"description" : "The resource identifier of the media file, including file extension.",
16061+
"pattern" : "^[a-zA-Z0-9_.-]{1,50}$",
16062+
"example" : "tJg5kUG5RKPi3jNi.jpg"
16063+
},
1597916064
"DomainRestrictions" : {
1598016065
"type" : "object",
1598116066
"required" : [
@@ -20257,6 +20342,9 @@
2025720342
"post_id" : {
2025820343
"$ref" : "#/components/schemas/TweetId"
2025920344
},
20345+
"scoring_status" : {
20346+
"$ref" : "#/components/schemas/NoteScoringStatus"
20347+
},
2026020348
"status" : {
2026120349
"$ref" : "#/components/schemas/NoteRatingStatus"
2026220350
},
@@ -20273,6 +20361,52 @@
2027320361
"not_misleading"
2027420362
]
2027520363
},
20364+
"NoteFactorBucketCounts" : {
20365+
"type" : "object",
20366+
"description" : "Rating counts for a rater factor bucket.",
20367+
"properties" : {
20368+
"helpful_count" : {
20369+
"type" : "integer",
20370+
"description" : "The count of helpful ratings."
20371+
},
20372+
"helpful_tag_counts" : {
20373+
"type" : "object",
20374+
"description" : "Helpful tag counts.",
20375+
"properties" : {
20376+
"tag_count" : {
20377+
"type" : "integer",
20378+
"description" : "The count of the tag."
20379+
},
20380+
"tag_name" : {
20381+
"type" : "string",
20382+
"description" : "The name of the tag."
20383+
}
20384+
}
20385+
},
20386+
"not_helpful_count" : {
20387+
"type" : "integer",
20388+
"description" : "The count of not helpful ratings."
20389+
},
20390+
"not_helpful_tag_counts" : {
20391+
"type" : "object",
20392+
"description" : "Not helpful tag counts.",
20393+
"properties" : {
20394+
"tag_count" : {
20395+
"type" : "integer",
20396+
"description" : "The count of the tag."
20397+
},
20398+
"tag_name" : {
20399+
"type" : "string",
20400+
"description" : "The name of the tag."
20401+
}
20402+
}
20403+
},
20404+
"somewhat_helpful_count" : {
20405+
"type" : "integer",
20406+
"description" : "The count of somewhat helpful ratings."
20407+
}
20408+
}
20409+
},
2027620410
"NoteId" : {
2027720411
"type" : "string",
2027820412
"description" : "The unique identifier of this Community Note.",
@@ -20310,6 +20444,21 @@
2031020444
},
2031120445
"additionalProperties" : false
2031220446
},
20447+
"NoteRatingCountsPerModel" : {
20448+
"type" : "object",
20449+
"description" : "The rating counts of a Community Note per model.",
20450+
"properties" : {
20451+
"negative_factor_bucket_counts" : {
20452+
"$ref" : "#/components/schemas/NoteFactorBucketCounts"
20453+
},
20454+
"neutral_factor_bucket_counts" : {
20455+
"$ref" : "#/components/schemas/NoteFactorBucketCounts"
20456+
},
20457+
"positive_factor_bucket_counts" : {
20458+
"$ref" : "#/components/schemas/NoteFactorBucketCounts"
20459+
}
20460+
}
20461+
},
2031320462
"NoteRatingStatus" : {
2031420463
"type" : "string",
2031520464
"description" : "Community Note rating status",
@@ -20323,6 +20472,29 @@
2032320472
"needs_your_help"
2032420473
]
2032520474
},
20475+
"NoteScoringStatus" : {
20476+
"type" : "object",
20477+
"description" : "The scoring status of a Community Note.",
20478+
"properties" : {
20479+
"has_access" : {
20480+
"type" : "boolean",
20481+
"description" : "Whether the user has access to the scoring status of the Community Note."
20482+
},
20483+
"rating_counts_per_model" : {
20484+
"type" : "object",
20485+
"description" : "Rating count stats per model.",
20486+
"properties" : {
20487+
"model_name" : {
20488+
"type" : "string",
20489+
"description" : "The name of the model."
20490+
},
20491+
"value" : {
20492+
"$ref" : "#/components/schemas/NoteRatingCountsPerModel"
20493+
}
20494+
}
20495+
}
20496+
}
20497+
},
2032620498
"NoteTestResult" : {
2032720499
"type" : "object",
2032820500
"description" : "The evaluation result of a community note.",
@@ -25155,13 +25327,15 @@
2515525327
"enum" : [
2515625328
"id",
2515725329
"info",
25330+
"scoring_status",
2515825331
"status",
2515925332
"test_result"
2516025333
]
2516125334
},
2516225335
"example" : [
2516325336
"id",
2516425337
"info",
25338+
"scoring_status",
2516525339
"status",
2516625340
"test_result"
2516725341
]
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
openapi: get /2/dm_conversations/media/{dm_id}/{media_id}/{resource_id}
3+
---

0 commit comments

Comments
 (0)