Downloads list returned empty.

Issue #52 invalid
Grzegorz Zawadzki created an issue

I can't get download links for repository. I use this API library and only result I get is:

string(51) "{"pagelen": 10, "values": [], "page": 1, "size": 0}"

Any help?

My Code:

$repositories = new Bitbucket\API\Repositories();
$repositories->setCredentials($bb_auth);
$repositories->getClient()->setApiVersion('2.0');
$response = $repositories->requestGet('repositories/{uname}'); // Works fine
$response = $repositories->requestGet('repositories/{uname}/{reponame}/downloads'); // Link here is copied from result from line above. Does not work.

Comments (6)

  1. Alexandru Guzinschi

    "size": 0 means that you have no files added to the downloads section of given repository.

    As a side note, you should use OAuth instead of basic auth.

  2. Grzegorz Zawadzki reporter

    Maybe it's not a place here for it. But you need to define them somehow? When I log on site, I have all downloads.

    PS: OAuth is scary :) Got to dive into it someday.

  3. Alexandru Guzinschi

    Uploading a file in the Downloads section is enough.

    For example, if you try to get all downloads from this repository, you will end-up with a response similar to what you have:

    {"pagelen": 10, "values": [], "page": 1, "size": 0}
    

    The reason is that this repository has no files added in the Downloads section.

    Please note that downloads endpoint does not include tags and branches, but only uploaded files. If you want to download a tag, branch or any commit, this might help you.

  4. Grzegorz Zawadzki reporter

    So basically, I cannot automatically retrieve newest repository download zip with this method? It's only for manually uploaded files (releases?)?

    Thank you for other link. I think that's what I wanted.

  5. Log in to comment