Autodesk-Forge / forge-api-nodejs-client

Forge Node.js SDK: Provides Node.js SDK to help you easily integrate Forge REST APIs into the application
Apache License 2.0
122 stars 87 forks source link

Expose ApiClient's callApi function (Feature Request) #85

Closed ericjisaac closed 1 year ago

ericjisaac commented 1 year ago

While not strictly required, this would help developers with extending the API.

Some of the functionality in the HTTP Specification isn't implemented in the Node SDK, including the ability to search and filter users in BIM360 or ACC. https://forge.autodesk.com/en/docs/acc/v1/reference/http/users-search-GET/

As of now, this can be done through a direct HTTP request, but it seems like the ApiClient has some safeguards and quality of life checks already implemented. If possible, I'd prefer to reference this for writing extensions.

It would also be convenient with respect to authentication and general consistency with using the API. Extensions could be written to match the patterns that Autodesk has established within the API, allowing extensions to be easily replaced by official SDK functions as they are implemented.

cyrillef commented 1 year ago

You can already do this using:

const apiClient = new ForgeSDK.ApiClient();
apiClient.defaultHeaders = { 'x-ads-test': BUCKET_KEY };
...
apiClient.call (...);

see sample