Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm playing around with the Ubuntu One API (coding in Java) and can successfully make calls using:

GET /api/file_storage/v1

and

GET /api/file_storage/v1/~/path/to/volume/path/to/node

to get information about the directory structure and files.

When I make a GET request for:

https://files.one.ubuntu.com/YgLpi504etc.etc.etc.

I get a webpage back (works in a browser obviously, but not in my code):

<html>
    <head>
        <title>OpenID transaction in progress</title>
    </head>
    <body onload="document.forms[0].submit();">
        <form id="openid_message" action="https://login.launchpad.net/+openid" method="post" accept-charset="UTF-8" enctype="application/x-www-form-urlencoded"><input type="hidden" name="openid.return_to" value="https://files.one.ubuntu.com/auth/complete/?next=%2FYgLpi504SI6eOmbTtQuRWw%2F&amp;janrain_nonce=2012-01-10T23%3A20%3A10ZjM6Ttj"/><input type="hidden" name="openid.realm" value="https://files.one.ubuntu.com/"/><input type="hidden" name="openid.ns" value="http://specs.openid.net/auth/2.0"/><input type="hidden" name="openid.sreg.optional" value="email,fullname,nickname"/><input type="hidden" name="openid.claimed_id" value="http://specs.openid.net/auth/2.0/identifier_select"/><input type="hidden" name="openid.ns.sreg" value="http://openid.net/extensions/sreg/1.1"/><input type="hidden" name="openid.assoc_handle" value="{HMAC-SHA1}{4efc9f73}{E6WEdg==}"/><input type="hidden" name="openid.mode" value="checkid_setup"/><input type="hidden" name="openid.identity" value="http://specs.openid.net/auth/2.0/identifier_select"/><input type="submit" value="Continue"/>
    </form>
        <script>
            var elements = document.forms[0].elements;
            for (var i = 0; i < elements.length; i++) {
                elements[i].style.display = "none";
            }
        </script>
    </body>
</html>

Is this the wrong URL to be using in code?

share|improve this question

1 Answer 1

up vote 0 down vote accepted

In order to fetch the file content, you need to use https://files.one.ubuntu.com/ + content_path URL, the links that are used for https://one.ubuntu.com/files/ will not work with OAuth.

share|improve this answer
    
Exactly what I needed, thanks –  Thom Shutt Jan 13 '12 at 11:45

Your Answer

 
discard

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.