Hi folks!
Consider you are logged in to a REST API in InterSystems IRIS with user A.
What is the way to log out in a browser?
E.g. to login with another user B?
Representational state transfer (REST) is a software architectural style that defines a set of constraints to be used for creating Web services. Web services that conform to the REST architectural style, called RESTful Web services (RWS), provide interoperability between computer systems on the Internet. RESTful Web services allow the requesting systems to access and manipulate textual representations of Web resources by using a uniform and predefined set of stateless operations. Other kinds of Web services, such as SOAP Web services, expose their own arbitrary sets of operations.
Hi folks!
Consider you are logged in to a REST API in InterSystems IRIS with user A.
What is the way to log out in a browser?
E.g. to login with another user B?
Hello everybody
I'm trying to send a XML file in a form-data like this, but is not working. Can anyone help me with the code?
.png)
This is my code:
Set HttpRequest = ##class(%Net.HttpRequest).%New()
Set RootMIMEPart = ##class(%Net.MIMEPart).%New()
Set BinaryMIMEPart = ##class(%Net.MIMEPart).%New()
Set stream = ##class(%FileBinaryStream).%New()
Set stream.Filename = pRequest.file
Do stream.LinkToFile(pRequest.file)
Set BinaryMIMEPart.Body = stream
// I already used "application/x-www-form-urlencoded", "application/xml", "application/x-object" in Content-Type
Do BinaryMIMEPart.SetHeader("Content-Type", "appli
I work as an Integration Engineer for United States Department of Veterans Affairs (VA).
Hi Team,
I want to consume(call) third-party API by passing JSON as a request from Iris.
Over the past year or so, my team (Application Services at InterSystems - tasked with building and maintaining many of our internal applications, and providing tools and best practices for other departmental applications) has embarked on a journey toward building Angular/REST-based user interfaces to existing applications originally built using CSP and/or Zen. This has presented an interesting challenge that may be familiar to many of you - building out new REST APIs to existing data models and business logic.
As part of this process, we've built a new framework for REST APIs, which has been
This article suggests to you some patterns to create REST API applications using IRIS.
Note: source code in https://github.com/yurimarx/movie
To begin, see my suggestion for classes needed to create IRIS API applications:
.png)
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.
The first installment of this article series discussed how to read a big chunk of data from the raw body of an HTTP POST method and save it to a database as a stream property of a class. The second installment discussed how to send files and their names wrapped in a JSON format.
Now let’s look closer at the idea of sending large files in parts to the server. There are several approaches we can use to do this. This article discusses using the Transfer-Encoding header to indicate chunked transfer. The HTTP/1.1 specification introduced the Transfer-Encoding header, and the RFC 7230 section 4.1 described it, but it’s absent from the HTTP/2 specification.
I'm building a Flutter app for smartphones and with same code a Flutter web app.
Both are using IRIS with a RestAPI.
As described in your documentation
I added
in the Info block of the Swagger definition and added
in the spec file after generating the RestAPI.
I also copied the example dispatch class to
With the Android app on my smartphone the OnHandleCorsRequest() is
I need to pass a parameter string that contains slashes to a REST call.
I tried URL encoding, or making URL map to accept query parameter instead of path parameter but apparently we only allow for path parameters.
I can come with several workarounds, but these involve some transformation at client and then on server, but I'd prefer a direct support.
Q1: is there any Cache specific trick to pass slashes in path parameters
Q2: are we going to support query parameters in REST?
something like this would help:
<Route Url="/test?var=:var" Method="GET" Call="Test" Cors="true"/>
Dan Kutac
I have an interoperability production that functions as a FHIR proxy. I have a need to add an HTTP Header value to the outbound request. I've subclassed HS.FHIRServer.Interop.HTTPOperation, but I cannot find a way to add an HTTP Header to the request. The HTTP class used in HS.FHIRServer.Interop.HTTPOperation is HS.FHIRServer.RestClient.HTTP. That RestClient class does not seem to expose or allow modification of the actual HttpRequest.
I'm used to using %Net.HttpRequest and doing a request.SetHeader(key, value) - but that isn't available - or I can't find it - when using
So, one day you're working away at WidgetsDirect, the leading supplier of widget and widget accessories, when your boss asks you to develop the new customer facing portal to allow the client base to access the next generation of Widgets..... and he wants you to use Angular 1.x to read into the department's Caché server.
There's only one problem: You've never used Angular, and don't know how to make it talk to Caché.
This guide is going to walk through the process of setting up a full Angular stack which communicates with a Caché backend using JSON over REST.
This is a parent page for the
I am working on an angular applications and build a web application (Rest API) on IRIS for health, the web application uses a password authentication and setup with the default csp session time out (15 minutes). If the user make an REST API call from the angular application after the session expired, it displays a login prompt...is that anyway that we can disable the login prompt and just simply return http status 401? When the angular application received the status 401, it can redirect to angular error page.
Thanks,
Hoi
Productions often need to receive REST requests.
Here's how to do that.
1. Create proxy Service:
/// Empty BS we would use to send Produciton requests
Class production.ProxyService Extends Ens.BusinessService
{
}2. Add it to production as RESTService (or any other name).
3. Write your rest broker (docs, more docs)
4. In your handler method create the message and call target BP/BO like this
Include Ensemble
Class test.REST Extends %CSP.REST
{
XData UrlMap [ XMLNamespace = "http://www.intersystems.com/urlmap" ]
{
<Routes>
<Route Url="/launchProcess/:processName" Method="POST"When a publish my API, only HTTP is available. How do I publish my REST API using HTTPS?
Trying to get started on REST api on https://learning.intersystems.com/course/view.php?id=681. Doing something basic wrong in my setup
Hello,
First of all thank you for reading this question
Also thank you for giving an answer
We would need some help
Our objective is to spot all REST Services in a namespace
➡️ How could we detect all services with AdapterClassname = EnsLib.HTTP.InboundAdapter , in an automatic way, in a namespace?
I am using MDX2JSON do display data, it uses CSP REST to retrieve data and uses Password Authentication. I enabled LDAP authentication for this applicaiton, but it does not work.
Hey Developers,
Enjoy watching this new video on InterSystems Developers YouTube:
⏯ Demo of REST APIs defined in Swagger, built with InterSystems IRIS interfacing with a SQL backend
Let's imagine if you would like to write some real web application, for instance, some simple clone of medium.com. Such sort of application can be written using any different language on the backend side, or with any framework on the frontend side. So many ways to do the same application, and you can look at this project. Which offers a bunch of frontends and backends realizations for exactly the same application. And you can easily mix them, any chosen frontend should work with any backend.
Let me introduce the same application realization for InterSystems IRIS on a backend side.
Hello,
I am trying to find out if it is possible to decode the Azure access token in IRIS. Has anyone ever tried this before? I need to decode the token to extract the "Scope" details in order to verify the scope to make sure client is permitted to do the request they have done.
If you could point me to any information, that'd be great.
Thank you.
Utsavi
In this 3-part series of articles, is shown how you can use IAM to simply add security, according to OAuth 2.0 standards, to a previously unauthenticated service deployed in IRIS.
In the first part, was provided some OAuth 2.0 background together with some IRIS and IAM initial definitions and configurations in order to facilitate the understanding of the whole process of securing your services.
The second part discussed and showed in detail the steps needed to configure IAM to validate the access token present in the incoming request and forward the request to the backend if the validation
Earlier this year, the AppS.REST package was released. AppS.REST is a framework for easily exposing existing persistent classes in IRIS as REST resources. AppS.REST-enabled classes support CRUD operations with little effort from the developer, bridging the gap between persistent data in IRIS and data consumers, such as an Angular front end application.
But IRIS classes are much more than just a definition for loading and saving individual records! This article aims to highlight a few ways to leverage the power of IRIS in your REST applications. Using the Phone.Contact sample app, we'll look at out-of-the-box query support, use of class queries and finally ObjectScript methods.
I have a vendor that is sending an HL7 message. But when I asked for more detail about their mapping tables, they told me they typically don't supply that but supply an API for customers to call so they don't have to define tables and it is more dynamic.
So with that being said I am creating my first REST operation. I understand the gist of how a REST operation works in working with other types out Non HL7 Operations (SOAP, SQL) before. You send a request and get a response back, that part I understand.
What I am not comprehending is how secure it can be if they only give you an ID, and a
Hello Everyone,
We are currently in process of implementing REST APIs using IRIS and we are also looking at using Intersystems API Manager.
Our aim is to implement a Microservices Architechture where Services are small in size, bounded by contexts, autonomously developed, and independently deployable.
We are following a spec first approach where we are first defining the API specs into Swagger Hub and using IRIS API Management Service to build the REST classes i.e. the Specification class, Dispatch class and Implementation Class.
Methods in Implementation class invoke a Business service in
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.
Is it possible to create like a "Super" business process that does the call to
FIrst of all thank you for your time in reading this question and writing a response,
We would need some help,
-> Our objective is to control which method is being used in the service: GET POST PUT
We have tried to understand the example REST Service: Demo.REST.DirectoryService
After that we have tried to create our own custom rest service,
please take a few minutes to examine the following code:
Code
InterSystems IRIS 2019.1 has been out for a while and I would like to cover some enhancements for handling JSON which might have gone unnoticed. Dealing with JSON as a serialization format is an important part of building modern applications, especially when you interact with REST endpoints.
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?
i notice the %CSP.Page class that %CSP.REST inherits from has an EXPIRES parameter that can be set, and %CSP.Response has a VaryByParam and Expires setti
I'm trying to setup a REST server with CORS support. I have created a class that handles a specific part of the service (printer control). This class I have referenced in my main REST class by adding <Map Prefix="/print" Forward="myClass.PrintAPI" />
My main class does have its own <Route>s and handles CORS requests perfectly. But in my subclass OnHandleCorsRequest() is only run when requesting from same origin and never run when making a CORS request. I have set Parameter HandleCorsRequest = "true" in both my main REST class and the subclass.
Can anyone point me in the right direction on what