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

Commands API check permission using wrong request method #65

Closed karlenek closed 4 years ago

karlenek commented 4 years ago

When using checkPermission method on Commands API class, regardless of the input it always returns status code 404:

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

It seems like the internal method _commandsApiCal is using the request method GET and according to the documentation it should be POST

https://github.com/Autodesk-Forge/forge-api-nodejs-client/blob/33b121b6cdc3b1486e8c3b145d0856005ab251d4/src/api/CommandsApi.js#L191-L195

Documentation here: https://forge.autodesk.com/en/docs/data/v2/reference/http/CheckPermission/

I can successfully use the check permission command when calling the API externally.

Best Regards, /Karl

cyrillef commented 4 years ago

Thx for the report