Comments (5)
Can you write according to the OpenAPI specification?
I will modify it to placeholder.json
.
from twitter-openapi.
I have used the format of twitter-openapi,
but I'm not sure if it's working correctly.
but, the response body has mostly the same fields. so INIT
and FINALIZE
can use the same of MediaUploadResponse
--------INIT ------------
[response body] {"media_id":1677217907460407298,"media_id_string":"1677217907460407298","expires_after_secs":86399,"media_key":"7_1677217907460407298"}
--------APPEND-----------
[POST] https://upload.twitter.com/i/media/upload.json?command=APPEND&media_id=1677217907460407298&segment_index=0
[response body]
-------FINALIZE----------
[response body] {"media_id":1677217907460407298,"media_id_string":"1677217907460407298","media_key":"7_1677217907460407298","size":1856821,"expires_after_secs":86400,"processing_info":{"state":"pending","check_after_secs":1}}
openapi: 3.0.3
info:
title: Twitter OpenAPI
version: 0.0.1
paths:
/i/media/upload.json:
post:
operationId: postMediaUpload
description: post media upload
responses:
"200":
description: Successful operation
content:
application/json:
schema:
$ref: "#/components/schemas/MediaUploadResponse"
tags:
- "v-media-post"
# {"media_id":1677217907460407298,"media_id_string":"1677217907460407298",
#"expires_after_secs":86399,"media_key":"7_1677217907460407298"}
# {"media_id":1677217907460407298,"media_id_string":"1677217907460407298",
#"media_key":"7_1677217907460407298","size":1856821,
#"expires_after_secs":86400,
#"processing_info":{"state":"pending","check_after_secs":1}}
components:
schemas:
MediaUploadResponse:
required:
- "media_id"
- "media_id_string"
- "media_key"
- "expires_after_secs"
properties:
media_id:
type: "integer"
media_id_string:
type: "string"
media_key:
type: "string"
expires_after_secs:
type: "integer"
processing_info:
$ref: "#/components/schemas/MediaUploadResponseProcessingInfo"
MediaUploadResponseProcessingInfo:
properties:
state:
type: "string"
check_after_secs:
type: "integer"
or download this yaml file
from twitter-openapi.
hi fa0311:
I don't know how to write the URL request JSON format rules in placeholder.json
. It's a complicated.
from twitter-openapi.
It's a complicated.
You're right about that.
It seems that this request cannot be written according to the current rules for placeholder.json
, so it would be better to write it according to openapi.
If you send us a pull request, we will merge them.
from twitter-openapi.
ok
from twitter-openapi.
Related Issues (12)
- 🚀 Roadmap
- searchAdaptive is 404 HOT 2
- Recent Updates HOT 1
- endpoint Following missing data HOT 1
- Some patterns are incorrect
- UserResults.result is Union ?????
- Cannot reverse serialise `Authorization: Status is a duplicate`
- Missing APIs HOT 7
- Missing extended_entities HOT 2
- Remove AGPL HOT 11
- post endpoint is not working
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from twitter-openapi.