#REST API

0 Followers · 604 Posts

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.

Learn More.

Article Julio Esquerdo · Feb 10 4m read

Using SQL Gateway with Python, Vector Search, and Interoperability in InterSystems Iris

Part 1 - SQL Gateway

Hello

In this article we will look at the use of SQL Gateway in Iris. SQL Gateway allows Iris to have access to tables from other (external) database via ODBC or JDBC. We can access Tables or Views from various databases, such as Oracle, PostgreSQL, SQL Server, MySQL and others.

0
0 0
Question Ali Chaib · Feb 7

I have a scenario where I send a GET request to a broker and receive a FHIR response. When I attempted to use the built-in InterSystems functions to convert this FHIR response into SDA, the transformation failed—likely because it is not a standard FHIR request.

How should I handle this situation? Is there a recommended approach to processing FHIR responses in this context?

0
0 0
Question Ali Chaib · Feb 7

I understand that InterSystems provides functions to facilitate transactions between FHIR and HL7 via the SDA segment. My question is:

  • Does this transformation only work when InterSystems receives FHIR requests and converts them into HL7, or does it also support responses?
  • Specifically, if our operation sends a GET request to a broker and receives a FHIR response, does InterSystems support transforming this response into an SDA segment automatically?
  • Or should we manually parse and modify the response to handle it according to our needs?
0
0 0
Question Anthony Decorte · Feb 5

Hello, I have a problem with a call and I would need some help.

When I call an API with the SendFormDataArray method of the EnsLib.HTTP.OutboundAdapter adapter, I pass it a %Net.HttpRequest object and I receive the following error:

ERROR #5002: ObjectScript error: <SUBSCRIPT>MatchSuffix+1^%Net.HttpRequest.1 ^%qPublicSuffix("")

I have correctly entered the url in my business operation and I pass it in the last parameter of the SendFormDataArray method. Do you have any idea, please?

0
0 0
Article Daryl Flaming · Jan 31 9m read

My main goal of this article was to prove the use of InterSystems IRIS for Health for REST FHIR interoperability between multiple applications. In this use case, some initiating application makes a REST call to IRIS for Health (which is merely a passthrough for REST calls) to retrieve FHIR data from an Oracle Health R4 FHIR repository. Ideally, it simplifies the syntax for calling the Oracle Health APIs. 

0
0 0
Article Tani Frankel · Jan 19 1m read

In your Interoperability Production you could always have a Business Operation that is an HTTP client, that uses OAuth 2.0 for authentication, but you had to customize the Operation for this authentication methodology. Since v2024.3, which was lately released, there is a new capability, providing new settings, to handle this more easily.

0
0 0
Question Ilenia Centonze · Jan 15

While working with GET request I encountered this situation where FHIR Server return a responseStatusHTTP "HTTP/1.1 200 200" instead of "HTTP/1.1 200 OK" (as highlighted in the attached screenshot).

Although the response code seems valid, these bundles have a total value of 0.

Could anyone clarify what "200 200" signifies in this context? Is there an issue with my setup, or does this indicate a specific condition related to the empty bundle search?

Thank you in advance for your help!

0
0 0
Article Chris Stewart · Jan 17, 2024 9m read

The Lo-Code Challenge

Imagine the scene.  You are working happily at Widgets Direct, the internet's premier retailer of Widgets and Widget Accessories.   Your boss has some devastating news, some customers might not be fully happy with their widgets, and we need a helpdesk application to track these complaints.   To makes things interesting, he wants this with a very small code footprint and challenges you to deliver an application in less than 150 lines of code using InterSystems IRIS.  Is this even possible?

8
6 909
Article Kate Lau · Jan 2 5m read

Last Chapter: Creating a REST client to get Tracks from Spotify REST API - Part4 Save the Search Result

Git link: https://github.com/ecelg/InterSystems-IRIS-as-a-Spotify-REST-client

OK.... based on what I have done.... I am able to 

1. Query Track information by making use of the Spotify API

2. Store the necessary data into my own album, artists, and track table

so.... what next?🤔 How about I set up my own REST API service on my IRIS for the other people to query my table?🤔🤨

ok... 1st... start from document Introduction to Creating REST Services

0
0 0
Article Kate Lau · Dec 31, 2024 8m read

Last Chapter: Creating a REST client to get Tracks from Spotify REST API - Part3 Get some data (e.g. Artists)

Git link: https://github.com/ecelg/InterSystems-IRIS-as-a-Spotify-REST-client

OK we create a method to get data and lets try to get some Tracks 😁

Now open a terminal and test the code

Run the following line

w ##class(rest.utli.requestUtli).getdata("Spotify","/search","offset=5&limit=10&query=Shape%20of%20you&type=track&market=SG")

ooooo no seems there is huge among of data returns.....😥

I would like to know what information can be found in 1 track....🤔 how about only query 1 track?

0
0 0
Article Kate Lau · Dec 29, 2024 4m read

Git link: https://github.com/ecelg/InterSystems-IRIS-as-a-Spotify-REST-client

Recently, I come up an idea in my mind that how can I put my playlist on IRIS.🧐

At the same time, I was told to pay for my Spotify subscription💸💸... ooo.. how about to get some data from the Spotify API... so I started to do study about it.

Like most of the development, let's start from Documentation of  the API https://developer.spotify.com/documentation/web-api

In order to get the data, i am required to request an access token from for the token endpoint URL.🧐

0
0 0
Article Kate Lau · Dec 30, 2024 2m read

Last Chapter: Creating a REST client to get Tracks from Spotify REST API - Part2 Save and Refresh Token

Git link: https://github.com/ecelg/InterSystems-IRIS-as-a-Spotify-REST-client
 

Ok, now I am pretty sure i have a valid token for making query.😀

Shall we try to query something from the API.

Again, its time to go through the API document https://developer.spotify.com/documentation/web-api/tutorials/getting-started

Search for Request artist data

the suggested code is like the following

0
0 0
Article Kate Lau · Dec 30, 2024 2m read

Last Chapter:  Creating a REST client to get Tracks from Spotify REST API - Part1 Check out token

Git link: https://github.com/ecelg/InterSystems-IRIS-as-a-Spotify-REST-client

Ok... Now we can check out a token but it will be expired in 3600 seconds.

There are 2 questions come up🤔

1. How to save this token????🙄

2. How to refresh this token????🤨🤔 

Lets come back to the API document https://developer.spotify.com/documentation/web-api/tutorials/getting-started

Base on my understanding, this piece of API do not have a token called refresh_token, as a result, we can assume the logic like following

0
0 0
Article Mark OReilly · Dec 13, 2024 5m read

As part of the Open Exchange competition Salford Royal (Dean White and Mark O'Reilly) developed a REST API for sharepoint as a template that works but can also be a starting point to your own Rest Applications 

Prerequisites

This is using the v1 REST sharepoint API you need a tennant id, client id, client secret and tennant name 

Setup 

Configure an OAuth server

 

The code in the middle is the tennant ID 

Create a client config name as whatever you want 

Set up the oauth client replacing your server ip with the ip of the server you are on (not the VIP address- if not part of a VIP localhost may work) 

0
0 0
Question Michael Davidovich · Dec 11, 2024

I have a primary dispatch class that implements %CSP.REST.AccessCheck() for some high level access checks before the route table forwards the request to the implementation classes which also implement %CSP.REST.AccessCheck() for some lower level access checks.  The idea is that we know where we are in the implementation class and what the user is trying to do, so it makes more sense to check some lower level items there rather than trying to parse out the request at the dispatch class.

0
0 0
Question Pietro Di Leo · Nov 20, 2024

Hi everybody, 

I'm modifying a REST interface for a client but it seems impossible to me to modify HTTP Response Status and including custom HTTP Headers either.

My dispatch class (extending %CSP.REST) is contacted through a POST request and the latter is processed in a custom class (extending %CSP.REST as well) accessed as shown in the example below:

  <Route Url="/test" Method="POST" Call="Custom.Test:Process" />

Within the processing class I tried executing the following statements with no success:

Do%response.SetHeader("totalcount",totalcount)
Set%response.Status = ..#HTTP400BADREQUEST
0
0 0
Article Rolano Rebelo · Nov 11, 2024 3m read

🌍 Inclusion & Innovation in Education 🌍
Our project reimagines learning for all students, with a focus on accessibility and interactive experiences. Built with the goal of making education engaging and inclusive, the tool is designed to support students of all abilities in learning complex material in an intuitive way.

💡 What It Does
This educational app transforms lesson presentations into interactive study sessions:

0
0 0
Question Elisha Gould · Nov 7, 2024

We've got some web services that utilise EnsLib.SOAP.Service/EnsLib.REST.Service. These do some further requests to a few operations to call some other services and return the combined results.

An issue that we are noticing is that some of the usage involves users hitting the refresh button a few too many times and generating a lot of requests. This is mostly an issue when the service that the operations are calling are down or slow to respond. IRIS starts using a lot of RAM when this occurs and has caused outages by getting through an extra 50-60GB of RAM.

0
0 0
Article Lorenzo Scalese · Nov 15, 2020 8m read

Hi Community,   OpenAPI-Client Gen has just released, this is an application to create an IRIS Interoperability Production client from Swagger 2.0 specification.   Instead of the existing tool ^%REST that creates a server-side REST application, OpenAPI-Client Gen creates a complete REST Interoperability Production client template.

Install by ZPM:

zpm "install openapi-client-gen"

  How to generate production from Swagger document?   It's very simple.

Open a terminal and execute:

Set sc = ##class(dc.openapi.client.Spec).generateApp(<applicationName>, <Your Swagger 2.0 document>>)
12
0 1273
Question Alin Soare · Oct 28, 2024

I have a question about the routing of IIS.

If I have a javascript application that has a single entry point app.html. Is it possible to configure the IIS server such that both the urls

addr:port/entry1

addr:port/entry2

to provide the same app.html and let the javascript code from application decide what component to load next, depending on the path of the URL ?

My IIS server is configured such that when I do a GET url1, ir tries to send entry1.html , respectively entry2.html when I do GET url2.

0
0 0
Question Olivier Caudron · Jul 23, 2024

Hi

I'm trying to use JWT authentication on a REST application in IRIS. The login API are correctly "injected" into the application. Login works fine with Postman and other REST clients, and subsequent calls to my REST API using the bearer token work fine (correctly authenticated). So far, so good.

0
0 0
Question Otto Medin · Jul 6, 2024

Hi all,

When passing on the content of a file in a REST API call, I need to put the original file name in an HTTP header. As it happens, some file names have non-8-bit characters in them ("å", "ö", and the like), and these arrive garbled on the other side. Does anybody know the correct way to encode them (assuming they should be encoded at all)?
$zconvert(filename, "O", "UTF8") does not appear to be it. I'm leaning towards $zconvert(filename, "O", "URL"), but leaning isn't good enough.
Thanks,
Otto

0
0 0
Article Chi Nguyen-Rettig · Sep 21, 2024 3m read

There are many applications for working with HL7 V2 messages, but the tools for working with XML in IRIS Management Portal and Cache Studio are limited. While plenty of external utilities and IDEs work with XML messages and even C-CDA documents, there is a compelling case for being able to test directly against the IRIS C-CDA framework. 

Testing within the IRIS environment provides the necessary context: 

0
0 0
Article Andrii Mishchenko · Sep 22, 2024 5m read

Introduction

Managing databases and performing CRUD operations are fundamental tasks for developers building data-driven applications. While many database management systems (DBMS) exist, they can be complex and cumbersome to interact with, especially when it comes to creating databases and tables, handling constraints, and performing real-time data operations through an API.

0
0 0
Article Andrii Mishchenko · Sep 27, 2024 4m read

In this article, we’ll dive into the inner workings of the database management tool, exploring the architecture and technologies that power it. Understanding how the application functions behind the scenes will give you insight into its design, how it manages databases, tables, and how the API interacts with data.

We will discuss the core technologies used, including InterSystems IRIS as the primary database and Redis for caching. Additionally, we’ll break down the structure of the tables used and explain how the system handles data creation, retrieval, and manipulation through the REST API.

0
0 0
Question Martin Staudigel · Sep 27, 2024

Hello community

I sent a http post message with a large message body (approx. 200 kB) to a standard EnsLib.REST.GenericService using a standard EnsLib.HTTP.InboundAdapter.

When inspecting the message in the message viewer I expected to see a HTTPMessage XML in the Contents preview, but I found a GenericMessage with no HTTPHeaders section. After a while, I found out that the display in the message's Visual Trace differs from what is shown, when going to the View Full Contents view in the Contents tab of the message viewer.

0
0 0