0

Making 2 and/or 3 legged auth request to Version/GetDownloads returns 400 when VersionId is valid and existing.

When trying to make an http call to a version's download endpoint (https://forge.autodesk.com/en/docs/data/v2/reference/http/projects-project_id-versions-version_id-downloads-GET/), the response returns:

{
    "jsonapi": {
        "version": "1.0"
    },
    "errors": [
        {
            "id": "a306d506-e374-4734-a68e-86c998fc7a5a",
            "status": "400",
            "code": "BAD_INPUT",
            "title": "One or more input values in the request were bad",
            "detail": "Request cannot be handled."
        }
    ]
}

This would be ok if the Version Id didn't exist for the corresponding project, but requesting the version's download formats (https://forge.autodesk.com/en/docs/data/v2/reference/http/projects-project_id-versions-version_id-downloadFormats-GET/) returns a 200 response, despite the version not having any download format:

{
    "jsonapi": {
        "version": "1.0"
    },
    "links": {
        "self": {
            "href": "https://developer.api.autodesk.com/data/v1/projects/{PROJECT_ID}/versions/{URN_VERSION_ID}/downloadFormats"
        }
    },
    "data": {
        "type": "downloadFormats",
        "id": {URN_VERSION_ID},
        "attributes": {
            "formats": []
        }
    }
}

The file I am testing with is a pdf uploaded to BIM360 via the UI. I would have expected to get at least a 200 response on both endpoints. Also, I quite not understand why the downloadFormats endpoint does not return any format.

  • What does your `versionId` look like? It must have to be encoded by something like [encodeURIComponent](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent) to remove some invalid parameter for URL. – Eason Kang Oct 07 '19 at 03:33
  • I notice that and the quesion mark on the `versionId` is encoded accordingly `urn:adsk.wipprod:fs.file:vf.PltC2QKtQBice13zs2p_ew%3Fversion=1`. I don't expect it being an issue with any Id as the `downloadFormats` works fine. – Alvaro Ortega Pickmans Oct 07 '19 at 06:40

0 Answers0