Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am currently developing a ubuntuone Bada app. I can get the tokens via the api, but if I try to request any other part of the api I just get an empty browser window or no event fired in the http listener of the app.

My request url looks like this:

I found the parameters on various sites and I am not sure if they are valid.

Thanks for your help!!

share|improve this question
up vote 2 down vote accepted

You need to use the token details you have to sign the request with the OAuth protocol.

Here's an example Python script, to be run on Ubuntu, which will sign a URL and then print out that URL; if you then request that URL, it should work.

Let me know if this is still problematic. (Note: the API returns data as content-type application/json, so this may not be loaded in a mobile browser.)

import oauth, urlparse, sys
from ubuntuone.couch.auth import *
if __name__ == "__main__":
  # If you already have token details, then use them here; you'll need
  # access_token, token_secret, consumer_key, and consumer_secret. This
  # script fetches them from a running Ubuntu instead.
      credentials = get_oauth_credentials()
  except CredentialsNotFound:
  access_token = credentials['token']
  token_secret = credentials['token_secret']
  consumer_key = credentials['consumer_key']
  consumer_secret = credentials['consumer_secret']

  # Now we have token details; let's use them to sign a request.

  token = get_oauth_token(access_token, token_secret)
  consumer = oauth.OAuthConsumer(consumer_key, consumer_secret)

  url = ""
  request_body = ""
  signature_method = HMAC_SHA1

  parameters = {}
  query = urlparse.urlparse(url)[4]
  for key, value in urlparse.parse_qs(query).items():
      parameters[key] = value[0]

  request_len = len(request_body) if request_body else 0
  timeout = 10 * (request_len / 1024 / 1024 + 1)  # 10 seconds per megabyte

  oauth_request = oauth.OAuthRequest.from_consumer_and_token(
  oauth_request.sign_request(signature_method, consumer, token)
  print oauth_request.to_url()
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.