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
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.
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.
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.
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.
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.
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.
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.
Hey Developers,
Enjoy watching this brief explanation of a new feature in IRIS RAD Studio – a new project by @José.Pereiraand @Henrique.GonçalvesDias:
Bulid REST API application built with ObjectScript in InterSystems IRIS. It also has OPEN API spec, can be developed with Docker and VSCode, can be deployed as ZPM module. can be used as Overbooking System data REST api.
What's Hotel Overbooking Management System?
The overbooking management system combines the unique conditions of the hotel, such as room prices, order channels, customer needs (etc.).
I'm participating in the Developing with InterSystems Objects and SQL with Joel Solon. The course is very nice and I will share with you some tips I got during the training. Tips presented in the day 4:
@José Pereira and I created a good project, and we want to introduce a few words about this project to you.
IRIS RAD Studio is our idea of a low-code solution to show what's possible, to make the developer's life easier.
This article is a continuation of this post.
In the previous article, we discussed the development of business processes, which are part of the components required for system integration and serve as a production coordinator.
This article will discuss creating a business service, which is the information input window for production.
And finally, the last component of “Let's Use Interoperability!
Hey Developers,
Enjoy watching the presentation of the IRIS-REST-API-DATABASEMANAGER app that allows you to create persistent Tables and Data in InterSystems Cache Database:
InterSystems API Management (IAM) - a new feature of the InterSystems IRIS Data Platform, enables you to monitor, control and govern traffic to and from web-based APIs within your IT infrastructure. In case you missed it, here is the link to the announcement. And here's an article explaining how to start working with IAM.
In this article, we would use InterSystems API Management to Load Balance an API.
In our case, we have 2 InterSystems IRIS instances with /api/atelier REST API that we want to publish for our clients.
There are many different reasons why we might want to do that, such as:
Hi All,
I hope someone can help me with the following, it's about the usage of the class EnsLib.HL7.Service.HTTPService.
Working situation right know.
In IIS we've got a site configured who is dealing with the client certificate, etc and redirect the full request to http://localhost/csp/healthshare/NAMEPSACE/EnsLib.HL7.Service.HTTPServi… and the web gateway redirects the request to Business Service 'EnsLib.HL7.Service.HTTPService.cls'.
Preferred situation:
We would like to have multiple available endpoints per namespace. According the documentation of the class 'EnsLib.HL7.Service.
Hi Community! Today I'd like to share with you a link to some exercises from a workshop about developing REST APIs and how to manage them using InterSystems API Manager.
It includes step by step exercises to:
You will find it all here: https://openexchange.intersystems.com/package/workshop-rest-iam
In the first installment of this article series, we 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. Now let’s look at how to save such data and metadata in JSON format.
Unfortunately, Advanced REST Client doesn’t let you compose JSON objects with binary data as a value of a key (or maybe I simply haven’t figured out how to do it), so I decided to write a simple client in ObjectScript to send data to the server.
I created a new class called RestTransfer.
A question came up in the InterSystems developer community concerning the possibility of creating a TWAIN interface to a Caché application. There were several great suggestions on how to get data from an imaging device on a web client to a server, then store this data in a database.
However, in order to implement any of these suggestions, you need to be able to transfer data from a web client to a database server and store the received data in a class property (or a table cell, as was the case in the question).
Hello,
We would be grateful if you could help us,
Our aim is to develop a method which retrieves an image stored in an external system, using a REST Operation
To upload the image we have the following code:
/// Operacion para gestionar el Registro imagen identidad digital en Tarjeta Sanitaria
Class Operaciones.REST.miSCS.miSCS Extends EnsLib.REST.Operation
{
Parameter INVOCATION = "Queue";
/// Subir la imagen del usuario
/// La documentación para crear este metodo es:
/// https://docs.intersystems.com/irisforhealthlatest/csp/docbook/Doc.View.cls?KEY=GNET_http#GNET_http_post_multipart
/// https://docs.intersystems.com/irisforhealthlatest/csp/docbook/Doc.View.cls?KEY=GNET_mime
Method SubirImagen(pRequest As Mensajes.Request.miSCS.SubirImagen, pResponse As Mensajes.Response.miSCS.SubirImagen) As %Library.Status
{
$$$LOGINFO("pRequest.imagen: "_pRequest.imagen) //Creamos Request y Response HTTP
Set httpRequest=##class(%Net.HttpRequest).%New()
set tResponse = ##class(%Net.HttpResponse).%New() // Generamos la parte que contiene a las demás partes, la "raiz", RootMIMEPart
Set RootMIMEPart=##class(%Net.MIMEPart).%New()
//Creamos la primera "subparte" con el expediente
Set ExpedienteMIMEPart=##class(%Net.MIMEPart).%New()
Set contentdisp="form-data; name=""expediente"""
Do ExpedienteMIMEPart.SetHeader("Content-Disposition",contentdisp)
Set ExpedienteMIMEPart.Body=pRequest.expediente
//Do ExpedienteMIMEPart.SetHeader("Content-Type","text/plain") ; esto no se envia en POSTMAN
//Asignamos la imagen
//Esto si funciona (la guarda como jpg y al descargarla se ve)
Set docStream=##class(%Stream.FileBinary).%New()
//Set sc=docStream.LinkToFile("C:\InterSystems\avatar prueba.jpg") // Esto no funciona (guarda el base64 directo, no el binario;
// es decir, guarda lo mismo que enviamos desde POSTMAN)
//set docStream = pRequest.imagen
//Si ponemos pRequest.imagen como string, enviamos el base64 por postman y decodificamos aqui a binario si
//guarda la imagen como jpg
set binary = $system.Encryption.Base64Decode(pRequest.imagen)
do docStream.Write(binary)
// Instanciamos la segunda "subparte" con la imagen
Set ImagenMIMEPart=##class(%Net.MIMEPart).%New()
// Incluimos la imagen, el docStream, en la subparte MIME
Do ImagenMIMEPart.BodySet(docStream)
// Cabeceras
Set ImagenMIMEPart.ContentType = "image/jpeg"
Do ImagenMIMEPart.SetHeader("Content-Disposition","form-data; name=""imagen""; filename=""imagen.jpg""")
// Insertamos las dos subpartes en la raiz
Do RootMIMEPart.Parts.Insert(ExpedienteMIMEPart)
Do RootMIMEPart.Parts.Insert(ImagenMIMEPart) // Creamos el MIME writer
Set writer=##class(%Net.MIMEWriter).%New() // Preparamos para enviar el mensaje MIME a la peticion HTTP
Set httpRequest=##class(%Net.HttpRequest).%New()
Set status=writer.OutputToStream(httpRequest.EntityBody)
if $$$ISERR(status) {do $SYSTEM.Status.DisplayError(status) Quit} // Escribimos el contenido del mensaje MIME en la peticion HTTP
Set status=writer.WriteMIMEBody(RootMIMEPart)
if $$$ISERR(status) {do $SYSTEM.Status.DisplayError(status) Quit} // Creamos la URL
set url = ##class(Util.TablasMaestras).getValorMaestra("MISCS.PARAMETRIZACIONES","url")
set path = ##class(Util.TablasMaestras).getValorMaestra("MISCS.PARAMETRIZACIONES","path")
set servicio = ##class(Util.TablasMaestras).getValorMaestra("MISCS.PARAMETRIZACIONES","servicio")
set recurso = ##class(Util.TablasMaestras).getValorMaestra("MISCS.PARAMETRIZACIONES","subirImagen") set URL = "http://"_url_path_servicio_recurso
$$$LOGINFO("URL: "_URL)
//Escribimos el tipo de contenido que enviamos en la raiz
Set httpRequest.ContentType="multipart/form-data; boundary="_RootMIMEPart.Boundary
$$$LOGINFO("> httpRequest.ContentType: "_httpRequest.ContentType) //Enviamos al sistema externo
set tSC=httpRequest.Post(URL,0)
$$$LOGINFO("tSC: "_tSC) //Lanzamos excepcion si hubo error
if $$$ISERR(tSC){
$$$ThrowOnError(tSC)
}
//Obtenemos respuesta
set tResponse = httpRequest.HttpResponse //Leemos respuesta
if (tResponse.Data.AtEnd = 0) {
set linea = tResponse.Data.Read()
$$$LOGINFO("Linea: "_linea)
} //Rellenamos response
set pResponse = ##class(Mensajes.Response.miSCS.SubirImagen).%New()
set pResponse.resultado = 1
set pResponse.informacion = linea
//Traducimos codigo del resultado, a descripcion
//set pResponse.informacion = ##class(Util.TablasMaestras).getValorMaestra("MISCS.CODIGOSTSI",linea) Quit pResponse
}
XData MessageMap
{
<MapItems>
<MapItem MessageType="Mensajes.Request.miSCS.SubirImagen">
<Method>SubirImagen</Method>
</MapItem>
</MapItems>
}Hi,
So I am a front end developer working with REST API with Cache database on the BE. The BE guys are currently using Cache through a Windows virtual machine and they claim it is not possible to have a development server to work with. All the work they are doing is directly on the production server and changes are immediate and I think this is a bad idea going forward and we most definitely need a development server that has access to the same code base and different version (through git) to be able to do development. We also do all the testing on this production server with test accounts, but we cannot do automated testing with this setup.
Hi Developers,
Please welcome the new video on InterSystems Developers YouTube:
⏯ Building REST API with InterSystems IRIS Docker Container in 5 Minutes
I am trying to write a REST consumer the API that I am talking to expects a file to be sent over and in response I will get a file back if anyone out there has ever had a similar use case please could you kindly guide us or share some sample code please
Hello fellow community members,
I would like to offer my services as an Intersystems Professional and am available to work on projects.
I have more than a decade experience into Intersystems stack of technologies including IRIS, Ensemble, Healthshare, Healthconnect, Cache Objectscript, Mumps, Zen, Analytics etc. with companies spread over US and UK involved in multiple domains.
Built in multi model integration using InterSystems iris data platform
Solution of hospital information inquiry business
Integration of hospital information query business solutions using InterSystems IRIS data platform with built-in multiple models
### Summary:
With the gradual improvement of hospital information construction, there are more and more hospital subsystems, and more and more interfaces between systems. At the same time, the interface cost is increasing, and the management work is becoming more and more complex.
Hi:
I've looked on many of these examples and questions how to post the JSON body but all the posts are a little complexly worded for me to follow.
so i have an EnsLib.REST.Operation
The example in ENSDEMO Directory Request says
Set tSC=..Adapter.PostURL(tURL,.tHttpResponse,"",pRequest.Body)
What i can't see is how in Demo Rest Directory request it happens to get the value of the message fields into
/// For JSON content submission
Property Body As %GlobalCharacterStream;