Hi everyone - In IRIS we would like to arrange the access of two users in such a way that each has access to exactly one (his) database only. Which resource does this (%DB_%DEFAULT allows each of the two users access to both databases). If you create new resources (%DB_Database1 and %DB_Database2) and then add them to individual roles (each for the user to), the access for the users, for example, via a REST client does not give the desired separation (instead once Ok, other database 401 Unauthorized both OK).

0 2
0 281

Hi,
How can I get an instance of stream which is a successor of %Stream.Object in a method that handles a REST POST request?

#dim request as %CSP.Request = %request
 set content = request.Content

This returns a variable of type %CSP.Stream which is totally useless, because %CSP.Stream does not inherit from %Stream.Object

0 2
0 157

Hi,

I've added a REST service which worked fine on our test system but failed on the production environment because UnknownUser does not have %All set and I really don't want it set on production (in fact I've also switched it off on test).

Is there a way to allow a single REST service to have unauthorised access?

I was thinking adding a resource/role to UnknownUser specifically for that service but I've never touched on Users/Roles/Resources so I'm struggling to work out what needs adding where.

Thanks

0 2
0 252

Hi,
Trying to work with REST protocol, using IIS 8, both client and server are Cache servers,
I have the following problem-
When I send a PUT command, I get the following error:
<HTML><HEAD><TITLE>Length Required</TITLE>
<META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii"></HEAD>
<BODY><h2>Length Required</h2>
<hr><p>HTTP Error 411. The request must be chunked or have a content length.</p>
</BODY></HTML>

0 2
0 894

Hello community,

I have a very simple REST API connection doing a POST of JSON messages via AZURE APIM.

It worked successfully for few weeks until a day ago when i started receiving a bad response as below.

<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW"><meta name="format-detection" content="telephone=no"><meta name="viewport" content="initial-scale=1.0"><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"><script type="text/javascript" src="/_Incapsula_Resource?......................................

0 2
0 373

Hi All,
I am implementing REST API's in IRIS using the below link as a guide.
I chose this approach so i could have a single entry point for requests regardless of namespace

https://community.intersystems.com/post/restful-exception-handling

a sample form the HIHLib.REST.Server class i am using is below. my question is does IRIS and CSP cache responses for requests to the CSP.REST class?
and if so what parameters or properties do i need to enable?

0 2
0 405

I am making a POST request to an API. In the case of an error, I don't know what parameters the response JSON will contain (they will change depending on the error). I am converting the response stream to an object but then I need a way to loop through all the properties and access their values. The following code is making the POST request, reading the response, and trying to add all the error messages to an array. But I can't iterate over the properties of the tProxy.errors object because it is a %ZEN.proxyObject. Is there a better way to do this?

0 2
0 172

Hi,

I want to create a table with a dynamic display of data using the DataGrid.

On the page there dataCombo and the table.

According to the plan, when the user selects an item in dataCombo the table is filled with data. If select another item - data is updated.

But in fact, the data in the table are loaded once when the page is loaded, and when I select value in DataCombo, I receive an error:

0 1
0 400
404 Not Found

{
"error": {
 "errors": [
  {
   "domain": "global",
   "reason": "notFound",
   "message": "Not Found"
  }
 ],
 "code": 404,
 "message": "Not Found"
 }
}

I want to do something like the above sample from a Google Storage JSON API. I have a call to Write obj.%ToJSON() followed by return ..ReportHttpStatusCode(..#HTTP404NOTFOUND) however the HTTP Status code is always 200. If I remove the Write obj.%ToJSON() statement it returns a 404 status with no body. How do I return both?

0 1
0 2.5K

Hello,

I am trying to figure out if we can extend a business process in IRIS. My Use Case is that I am developing RESTful Interfaces and my each REST Interface needs to go through certain processes before getting to the actual action.

e.g. I have 2 REST Interfaces, GetPatient and GetEncounter. Both of these need to invoke "GetToken" Business Operation to go to the Authentication server to get an authentication token before they go ahead and hit the Business Operation to Get the data i.e. Patient or Encounter.

1 1
1 185

Hi-

Im curious if there is any specific configuration that has to be done on an IIS web server to serve up RESTful web services.

I have a server that has IIS installed, with the CSP gateway. a second server that has Cache installed on it.

I have configured a web application using the Cache System Management Portal for the web services that has a dispatch class pointing to my dispatch class.

I have created an application mapping in my CSP Gateway Management Portal on the web server such that url's with /webservices prefix are routed to my cache server.

0 1
0 3.5K
Question
· Jul 10, 2022
login failure

I am still working on iris-for-money app: https://github.com/oliverwilms/iris-for-money

Account.csp posts a rest call with _SYSTEM username and the password.

xhttp.open("POST", "/restapi/sql/" + query, true,"_SYSTEM","SYS");
xhttp.send();

/restapi web application has Password Authentication Method enabled.

SYS is the correct password for _SYSTEM user.

I do not understand why I see login failure in Audit database.

0 1
0 237

Trying my first REST call operation to our internal EMR (Epic) server, and I am receiving "ERROR #6097: Error '<READ>Read+28^%Net.HttpRequest.1' while using TCP/IP device '9999'" when I attempt to test my operation. When I look up the General Error Messages for 6097 I am seeing...Error '%1' while using TCP/IP device $zu(189,1)='%2'. What does this mean?

0 1
0 389

Hi,

I have Healthshare/Ensemble version 2015.2.1.

I created Business Operation in my ENSDEMO namespace that will connect to an external REST endpoint to send data to this external REST Service.

I also created an http service in Home>Healthshare>Service Registry, under the Service Type: http. I entered the REST endpoint Name, Host, SSL Configuration, and URL.

0 1
0 619

Hi All,

Actually, I'm developing few restful API's. I want to create a authentication tokens and display it on my login restful API. If I'm using CSP sessionId, how can I validate the session Id's in another or continues restful API's. else, is there any other approach to handle this task.

My Primary goal is, I have to integrate 2 different front end applications. One is Zen framework another one is web pages from Python.

If any lead, it would be appreciated.

Thanks,

Arun Kumar Durairaj.

0 1
0 465
Question
· Mar 27, 2023
JSON Validation Errors

When using %JSONImport it seems to only report a single error, is there a way to report all the errors with out having to do multiple requests?

{

"errors": [

{

"code": 9406,

"domain": "%ObjectErrors",

"error": "ERROR #9406: Unexpected format for value of field, CurrencyCode, using Update mapping",

"id": "JSONImportError",

"params": [

"CurrencyCode",

"Update"

0 1
0 258
Question
· Dec 4, 2023
Custom Application Metric

I made a custom application metric, imported it to the USER namespace and used:

set status = ##class(SYS.Monitor.SAM.Config).Add.ApplicationClass("historymonitor.errorSensor", "USER")

to add it. When I do 'w status' it returns 1 so it is added but I still can't see the custom metric in the api/monitor/metrics endpoint. Even though I added %DB_USER in the application roles for api/monitor.

Does anyone know where the problem might be that the metrics endpoint still doesn't show my metric?

0 1
0 101

I am using the %Net.HttpRequest class to download a file from the internet .using the following code. When a file is returned in the DOM I am able to read the file content and save it to the desired location but when my response is a download dialog nothing is returned in the HttpResponse. Am I doing something wrong here is where I have gotten to so far any help appreciated.

current code

0 1
0 199