ecg-icas / icas

iCAS documentation and changelogs
4 stars 2 forks source link

add docs for endpoints GET /ad/count and /ad/histogram #109

Closed twessling-icas closed 12 months ago

twessling-icas commented 12 months ago

idk how to properly test this locally except for using the intellij openapi preview pane... any hints to test in real browser from local?

remenska commented 12 months ago

idk how to properly test this locally except for using the intellij openapi preview pane... any hints to test in real browser from local?

If you already have the openAPI plugin, the linter should indicate any errors/warnings. You can use the openAPI plugin to run a local server, and execute stuff even locally.

Screenshot 2023-11-07 at 10 28 47

If not, you can do a quick&dirty copy/paste in the Swagger editor to check for linting errors. I want to add a pre-commit hook eventually.

If you want to execute the API endpoint, you need to authorize to the right env/endpoint (top right button). There are 2 ways to authorize, both require that you're logged in the console, i.e., there is a cookie. Either with a test account or just impersonate with readonly.

  1. Use the access token directly with bearerAuth - the first option on the screen. Just paste the access token.
  2. login with particular client credentials, requesting the scopes you want. This will create a separate access token, like the normal oauth2 flow that partners use.

I realize now that the caveat of this is that you cannot run your local version against a non-local environment, unless we add localhost to the CORS headers in sellside2. It would first need to be merged to main.