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 6112183
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:42:56+00:00 2026-05-23T14:42:56+00:00

Trying to call from an android client, using the signpost oauth libs. I generated

  • 0

Trying to call from an android client, using the signpost oauth libs. I generated new APIv2 keys, but didn’t seem to make a difference. The error I’m getting looks like:

{"error":{"text":"Signature was 
invalid","id":"INVALID_SIGNATURE","description":"Invalid signature. 
Expected signature base string: GET&http%3A%2F%2Fapi.yelp.com 
%2Fv2%2Fsearch&category_filter%3Drestaurants%2520food%26limit%3D10%26ll 
%3D37.422005%252C-122.084095%26oauth_consumer_key 
%3DPbSjw9p08To_XXXXXXXXZg%26oauth_nonce 
%3D-81097XXXXXXXX560239%26oauth_signature_method%3DHMAC- 
SHA1%26oauth_timestamp%3D129XXXX091%26oauth_token 
%3DARfbDXXXXXXXXlBHARTgygLkcMw9h8eW%26oauth_version%3D1.0%26offset 
%3D0%26radius_filter%3D300%26sort%3D0"}} 

I double checked, and all my token and secret values exactly match
what’s in the manage API screen. Code currently looks like this:

if (location != null) { 
        String lat = Double.toString(location.getLatitude()); 
        String lng = Double.toString(location.getLongitude()); 
        String category = "restaurants+food"; 
        String radius = "300"; 
        String limit = "10"; 
        String offset = "0"; 
        String sort = "0"; 
        try { 
                String query = String.format("http://api.yelp.com/v2/search?ll=%s, 
%s&category_filter=%s&radius_filter=%s&limit=%s&offset=%s&sort=%s", 
                                URLEncoder.encode(lat, ENCODING_SCHEME), 
                                URLEncoder.encode(lng, ENCODING_SCHEME), 
                                category, 
                                URLEncoder.encode(radius, ENCODING_SCHEME), 
                                URLEncoder.encode(limit, ENCODING_SCHEME), 
                                URLEncoder.encode(offset, ENCODING_SCHEME), 
                                URLEncoder.encode(sort, ENCODING_SCHEME)); 
                OAuthConsumer consumer = new CommonsHttpOAuthConsumer(CONSUMER_KEY, 
CONSUMER_SECRET); 
                consumer.setTokenWithSecret(TOKEN, TOKEN_SECRET); 
                consumer.setMessageSigner(new HmacSha1MessageSigner()); 
                consumer.setSendEmptyTokens(true); 
                consumer.setSigningStrategy(new QueryStringSigningStrategy()); 
                String signedQuery = consumer.sign(query); 
                Log.i(getClass().getName(), signedQuery); 
                HttpGet request = new HttpGet(signedQuery); 
                HttpClient httpClient = new DefaultHttpClient(); 
                HttpResponse response = (HttpResponse) httpClient.execute(request); 
                HttpEntity entity = response.getEntity(); 
                String jsonResult = EntityUtils.toString(entity); 
                Log.i(getClass().getName(), jsonResult); 
  • 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-05-23T14:42:57+00:00Added an answer on May 23, 2026 at 2:42 pm

    Just found the issue. You should add the MessageSigner BEFORE setting the TokenSecret, otherwise it’s null and everything gets signed badly

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

Sidebar

Related Questions

I'm trying to call a RESTful web service from an Android application using the
I'm trying to make a RESTful api call from the android emulator (using android
I am trying to call cleartool from an java application, but cleartool hangs even
I am trying to call ejabberdctl from a PHP file, but it is failing
I am trying to call ejabberdctl from PHP but i keep getting an error
I am trying to grab consecutive frames from android using opencv VideoCapture class. Actually
I'm trying to contact a RESTful WCF POST web service from an android client
I am trying to call a stored procedure using native query call from an
HI, im trying to call a javascript function from my actionscript code but its
I'm trying to call a java method from native C code in an Android

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.