Search code examples
autodeskautodesk-data-managementautodesk-construction-cloud

I cannot download the reference images in an issue


I am trying to download the refence images in an issue following the api documentation with the photos API, but whenever I try to use it I get the message "The requested resource does not exist", I am following the guide step by step do I am unsure of what I am doing wrong.

I retrieved the photo id with the relationships api using the intersect with the project id and the issue id, but once I have that ID and I try to get it with the photos API I get that error message, this is how my requests looked:

POST https://developer.api.autodesk.com/bim360/relationship/v2/containers/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/relationships:intersect

{
    "entities": [
        {
        "id": "...",
        "type": "issue",
        "domain": "autodesk-bim360-issue"
        }
    ]
}

That one gave me the regular relationships json with the id like so

"entities": [
                {
                    "createdOn": "2024-08-07T11:39:27.425905+00:00",
                    "domain": "autodesk-construction-photo",
                    "type": "photo",
                    "id": "yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy"
                },
                {
                    "createdOn": "2024-08-06T08:15:58.613064+00:00",
                    "domain": "autodesk-bim360-issue",
                    "type": "issue",
                    "id": "..."
                }
            ]

And then I called GET https://developer.api.autodesk.com/construction/photos/projects/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/photos/yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy?include=signedUrls With the same project id and the same photo id, but the response I got was this one:

{
    "developerMessage": "The requested resource does not exist.",
    "moreInfo": "https://forge.autodesk.com/en/docs/oauth/v2/developers_guide/error_handling/",
    "errorCode": ""
}

And I dot know what to do with this, of course I am using a three legged token in all these request, and in the documentation the next step is to just download the file so I cannot think of anything else to try.

Thank you in advance for your help.


Solution

  • The endpoint you requested is incorrect.

    Please use POST photos:filter, which the base Url is https://developer.api.autodesk.com/construction/photos/v1/projects/, not https://developer.api.autodesk.com/construction/photos/projects/.

    curl --location 'https://developer.api.autodesk.com/construction/photos/v1/projects/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/photos/yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy?include=signedUrls' \
    --header 'Content-Type: application/json' \
    --header 'Authorization: ••••••'