Question Sylvie Greverend · Jul 2, 2024

I use a swagger file and ##class(%REST.API).CreateApplication to create the rest api.

There is an interesting post: https://community.intersystems.com/post/download-file-rest-api-operation, but it is code, not a swagger configuration. disp.cls returns always a header content : application/json that of course fails as I am not always returning a json

I can not figure out what to put in swagger. Some examples I tried:

produces:
- application/pdf
- image/png
responses:
   200:
      schema:
           type: file
responses:
   200:
       schema:
           type: string
           format: binary

Thank you

2
0 230
Question Sylvie Greverend · Jun 20, 2024

How do you authenticate with a rest api? The rest api implemention allows us to add in the header Authentication: 'Basic ' + btoa(user + ':' + password) but it is not really secure as a user can inspect and with the right decoding tool see a user password

4
1 397
Question Sylvie Greverend · May 7, 2024

I have an angular UI communicating with a iris rest api. Now I need to authenticate (to federated) before accessing the UI, and for a better solution  as the users are using the healthshare clinical viewer 2023, find a way to use the clinical viewer authentication / user to go to the UI.

The angular way would be to do an angular guard and have a function 'am I authenticate to federated', but I never found a function like this and how to get my username.

At the other end, creating a csp page in my csp folder that is either
- a csp including the angular html page outside the csp folder and passing

0
0 151
Question Sylvie Greverend · Apr 6, 2024

It is probably somewhere in the doc. So hard to search. Hope InterSystems going to AI on their community/support data. 

How to see a meaningful value in management portal - sql explorer. For instance
Class MySetting Extends %Persistent{
     Property Name As %String;

Class MyObj Extends %Persistent{
    Property Setting As MySetting;

When browsing MyObj in management portal (just select * from MyObj - lazy to do a join), I will see 1,2.. values in the Setting column. I would like to see the Name. I do not want index MySetting with Name as primary as the name can change

Thank for your comment.

1
0 156
Question Sylvie Greverend · Mar 29, 2024

I built my rest api with ^%REST and update with CreateApplication.
Postman works fine and I suppose production server will work fine as UI and rest api will be on the same domain, but for now in dev, I need to have access from my local to the Iris rest api. I have a CORS error.

I do not know how to configure my swagger file to have either Parameter HandleCorsRequest=1 or <route Cors=true in the generated displ,cls.

As adviced in community, I tried in my impl.cls
    Do ..%SetHeader("Access-Control-Allow-Origin", "*")
I even tried 
     Do ..%SetHeader("Access-Control-Allow-Headers", "*") //

3
0 406
Question Sylvie Greverend · Mar 14, 2024

In HealthShare, we can add any new application that will show up in the left menu of the viewer. I am trying to add new navigation entries that will look like 'patient search' popup. 

- Is Intersystems sharing its HealthShare style? They are using material tags, but it looks very different that the default material themes. I probably can pick up the style, but perhaps there is an official way.
- Is there a way to do a popup like patient search? So far I see, a new option is associated to an url not some javascript code?

Thank you for your help.

0
0 150
Question Sylvie Greverend · Mar 14, 2024

I am trying to use postman to start the restapi classes from a json openapi2.0.0 file.

POST: https://myserver.com/api/mgmnt/v2/requestAPI. The body contains the openapi2.0.0. The application api/mgmnt has in security settings: password. JWT is not selected. I set postman authentication to basis authentication and gave username and password. I also set in headers IRISUsername and IRISPassword. I have 401 Unauthorized.

Is the only way to go through is to build an oauth token? or do I miss something?

Thank you very much.

2
0 237