Home > Net >  Trill open platform to upload video to a file server (/video/upload/API why always return parameters
Trill open platform to upload video to a file server (/video/upload/API why always return parameters

Time:11-14

The API documentation address: https://open.douyin.com/platform/doc/OpenAPI-video-create


Interface parameters:


Platform has applied for permission to


Problem description:
In illegal call https://open.douyin.com/video/upload/interface is the total return parameters, using the interface call open_id and access_token call used by other interfaces (such as:/video/list/) data can be returned the call is successful, to be sure, open_id and access_token parameters no problem, interface permissions (Scope: ` video. Create `) has been applied for and approved in open platform when sweeping code authorization, also has such as the Scope permissions,

Call the API returns the results as follows:
{" data ": {" description" : "illegal" parameters, "error_code" : 2100005}, "extra" : {" logid ":" 202003211443340100140470891 df1b821 ", "now" : 1584773018222}}

Note: interface test using multiple test methods are the results:
By the way to the test:
1) c # program called
2) jquery front-end direct call
3) the postman call

CodePudding user response:

Please the great god some directions, solving, ~ ~ ~ ~ ~

CodePudding user response:

To solve, I also met, I am put open_id and access_token in url inside spread and good, but the insufficient quta

CodePudding user response:

To solve now? I are constructed and send with MultipartEntityBuilder parameters directly through the url, video files with addBinaryBody loaded, you can upload and return video_id success:

The File File=new File (filePath);
HttpPost post=new HttpPost (uploadUrl);
HttpClient HttpClient=HttpClientBuilder. The create (). The build ();

MultipartEntityBuilder builder=MultipartEntityBuilder. The create ();
Builder. AddBinaryBody (" video ", file, ContentType MULTIPART_FORM_DATA, "TestVideo. Mp4");

HttpEntity reqEntity=builder. The build ();
Post. SetEntity (reqEntity);
HttpResponse response=httpclient. Execute (post);
Int statusCode=response. GetStatusLine (.) getStatusCode ();
If (statusCode==HttpStatus. SC_OK) {
Logger. The info (" upload success ");

HttpEntity HttpEntity=response. GetEntity ();
String entity=EntityUtils. ToString (httpEntity);

JSONObject JSONObject=JSONObject. ParseObject (entity);
JSONObject data=https://bbs.csdn.net/topics/jsonObject.getJSONObject (" data ");
If (data!=null & amp; & Data. GetInteger (" error_code ")==0) {
Result=data;

}

CodePudding user response:

But the problem is that I upload successful, failed to create video always, always return 2100005, parameters of illegal
Create video is videoCreatePost this,
According to its documentation, passing JSON long like this:
{
"Access_token" : "XXXXXX",
"Open_id" : "XXXXXX",
"The body" : {
"Video_id" : "XXXXXX",
"Text", "XXXXXX"
}
}

According to my understanding of the document should be, don't know where is the problem

CodePudding user response:

I want to ask next, bosses have the user is not authorized API, but I've been authorized and is very confused now

CodePudding user response:

What I use is uniapp upload open_id and access_token to joining together behind the url
Uni. UploadFile ({
Url: config. TtUpload + path +
'? Open_id c7e23=574-8265-4282 - a312 0 b3f7b33d808 & amp; Access_token=act. 8 cf894e92e9c33e980af3c0ebabb37b8uinvaw0nbcerdqehul8yjiau6moi ',
FilePath: data, video,
Name: 'video'
Headers: {
'the content-type' : 'multipart/form - data'//* * * * * * * * to highlight
},
Success: (res)=& gt; {
The console. The log (123123, res)
}
})
Successful too him of difficult
  •  Tags:  
  • C#
  • Related