Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8174575
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T22:29:45+00:00 2026-06-06T22:29:45+00:00

Is it possible to upload images using Scribe-Java and twitter POST Url https://upload.twitter.com/1/statuses/update_with_media.json? my

  • 0

Is it possible to upload images using Scribe-Java and twitter POST Url “https://upload.twitter.com/1/statuses/update_with_media.json”?
my source
I get the response: {“request”: “\ / 1 \ / statuses \ / update_with_media.json”, “error”: “Could not authenticate with OAuth.”}

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T22:29:46+00:00Added an answer on June 6, 2026 at 10:29 pm

    Just to help out anyone else looking at this, a simple way to build the multi part is to add httpmime-4.0.1.jar and apache-mime4j-0.6.jar to your path and do the following.

            /* You will have done this bit earlier to authorize the user
    
        OAuthService service = new ServiceBuilder().provider(TwitterApi.SSL.class).apiKey("[YOUR API KEY]").apiSecret("[YOUR SECRET]").callback("twitter://callback").build();
        Token accessToken = Do you oauth authorization as normal 
    
        */  
    
        OAuthRequest request = new OAuthRequest(Verb.POST, "https://upload.twitter.com/1/statuses/update_with_media.json");
        MultipartEntity entity = new MultipartEntity();
        try {
    
            entity.addPart("status", new StringBody("insert vacuous statement here"));
            entity.addPart("media", new FileBody(new File("/path/of/your/image/file")));
    
            ByteArrayOutputStream out = new ByteArrayOutputStream();
            entity.writeTo(out);
    
            request.addPayload(out.toByteArray());
            request.addHeader(entity.getContentType().getName(), entity.getContentType().getValue());
    
            service.signRequest(accessToken, request);
            Response response = request.send();
    
            if (response.isSuccessful()) {
                // you're all good
            }
    
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
    

    The trade off here is of course adding the size of the 2 jars to your APK

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using Uploadify/asp.net mvc 3 to upload images. Is it possible to display
I upload image files using aspupload component. I was wondering if its possible to
I can't seem to upload an image using Zend_Service_Nirvanix. Is it even possible? I
Is is possible to upload a photo to facebook using Corona?
I need a simple code to upload images to mySQL using PHP... short! snippet...
I am using Jquery Uploadify for images upload with PHP, here i want to
I am using formset and allowing users to upload multiple images. It worked. But
Has anyone had success using Flickr to embed images that users can upload to
I'm using uploadify on a page that allows a user to upload images as
I'm using paperclip to allow user to upload images and I want to convert

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.