autodesk-forgeautodesk-bim360autodesk-construction-cloud

Issue with Axios GET properties from Model Properties API on Autodesk Forge


I'm having trouble getting the results for [GET projects/:projectId/diffs/:diffId/properties] from the new Model Properties API provided by Autodesk Forge.

I've been able to get all the Model Properties API calls (both Index and Diff) to work on Postman. However, on a NodeJS server (using axios) the properties call doesn't work, and returns a 502 error.

Below is an example code:

const result = await axios.get(
            `https://developer.api.autodesk.com/construction/index/v2/projects/${projectId}/diffs/${diffId}/properties`,
            {
                headers: {
                    Authorization: `Bearer ${internalToken.access_token}`,
                },
            },
        );

If I replace properties with either manifest or fields, the results are returned normally. This applies to both Index and Diff.

I'm not sure if this is actually an internal server error (which is the error returned), or is there something wrong in the request that is being sent?

Note: if it makes any difference, it is a BIM360 project.

Update: After some further usage, it seems that the error 502 with status of 'Bad Gateway' occurs when the response is large. Responses above ~14MB return this error. This is confirmed because the results return normally on Postman.

Could anyone from Autodesk help me with this? And if there are any alternatives to fixing this issue.


Solution

  • In case somebody runs into the same problem, it was solved by adding 'Accept-Encoding': 'gzip, deflate, br' to the header in the request.