Hi! I’m developing an app using Java 8 and spring socials twitter.
Iknow that you dont support 3rd parts code but i can see that its a twitter api problem.
I need to upload videos to Twitter and then Tweet it with its description.
I’m using the same method to upload images, gifs and videos: https://upload.twitter.com/1.1/media/upload.json
For images and gifs it runs OK, but it fails with videos returning "media type unrecognized"
I use “media_data” parameter to send the Base64Encoded file.
Here is my code:
MultiValueMap<String, Object> uploadParams = new LinkedMultiValueMap<>(); uploadParams.set("media_data", imageData.getImageBase64()); //its encoded MediaUploadResponse response = executePostCommandWithReturn(() -> twitter.restOperations().postForObject("https://upload.twitter.com/1.1/media/upload.json", uploadParams, MediaUploadResponse.class));
I tried to use the chunk method to upload videos but in the INIT command it fails with the same error “media type unrecognized”. On this case, i’m sending “video/mp4” on the parameter “media_type”. (following the example on documentation)
I dont know what else to check.