#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 Ashok Kumar T · Feb 17 6m read

What is JWT?

JWT (JSON Web Token) is an open standard (RFC 7519) that offers a lightweight, compact, and self-contained method for securely transmitting information between two parties. It is commonly used in web applications for authentication, authorization, and information exchange.

A JWT is typically composed of three parts:

1. JOSE (JSON Object Signing and Encryption) Header
2. Payload
3. Signature

These parts are encoded in Base64Url format and concatenated with dots (.) separating them.

Structure of a JWT

Header

{ "alg": "HS256", "typ": "JWT"}

Payload

0
0 0
Article Julio Esquerdo · Feb 14 5m read

HTTP and HTTPS with REST API

Hello

The HTTP protocol allows you to obtain resources, such as HTML documents. It is the basis of any data exchange on the Web and a client-server protocol, meaning that requests are initiated by the recipient, usually a Web browser.

REST APIs take advantage of this protocol to exchange messages between client and server. This makes REST APIs fast, lightweight, and flexible. REST APIs use the HTTP verbs GET, POST, PUT, DELETE, and others to indicate the actions they want to perform.

0
0 0
Article Luis Angel Pérez Ramos · Oct 31 5m read

Yes, yes! Welcome! You haven't made a mistake, you are in your beloved InterSystems Developer Community in Spanish.

You may be wondering what the title of this article is about, well it's very simple, today we are gathered here to honor the Inquisitor and praise the great work he performed. 

So, who or what is the Inquisitor?

Perfect, now that I have your attention, it's time to explain what the Inquisitor is. The Inquisitor is a solution developed with InterSystems technology to subject public contracts published daily on the platform  https://contrataciondelestado.es/ to scrutiny.

0
0 0
Article Kate Lau · Oct 13 13m read

Hi all,

Let's do some more work about the testing data generation and export the result by REST API.😁

Here, I would like to reuse the datagen.restservice class which built in the pervious article Writing a REST api service for exporting the generated patient data in .csv

This time, we are planning to generate a FHIR bundle include multiple resources for testing the FHIR repository.

Here is some reference for you, if you want to know mare about FHIR The Concept of FHIR: A Healthcare Data Standard Designed for the Future

OK... Let's start😆

0
0 0
Question Colin Nagle · Oct 24, 2024

I have an API set up in IRIS which is secured using an IRIS authentication service, so there is a bearer token being passed down in the request header.

I've already set Parameter HandleCorsRequest = 1; on the spec class and All the endpoints I am have (a mix of GET, POST, PATCH and DELETE) are working from postman without issue, the problem is when consuming from the web front-end and the preflight checks the browser instigates. Most of the endpoints work in the browser, but some are triggering the preflight (OPTIONS) check causing the CORS issue.

This is what I am seeing in the browser:-

0
0 0
Article Kurro Lopez · Oct 23 1m read

Hi all,

This is a quick tip about how to use case insensitive URL in REST API.

If you have a class that extends from %CSP.REST and Ens.BusinessService, to create a REST API service, and you have defined your WebApplication in lowercase

XData UrlMap [ XMLNamespace = "http://www.intersystems.com/urlmap" ]
{
<Routes>
    <Route Url="/user" Method="POST" Call="User"/>
    <Route Url="/login" Method="POST" Call="Login"/>
</Routes>
}

Only accepts the url in lowercase, i.e. http://myserver/myproduction/user

If you have any uppercase character, the url doesn't work. http://MyServer/MyProduction/user

0
0 0
Article Pablo Frigolett · Mar 7, 2023 3m read

Surely you wanted to use the OpenAPI Specification (OAS) JSON you used for your spec class on the iris-web-swagger-ui iris package. The generated OAS from the ##class(%REST.API).GetWebRESTApplication(...) method is very crude, with no description on the parameters or the expected response structure.

So after creating your REST application from an OAS you should have:

  • A generated application.disp.cls class
  • An application.spec.cls class (we'll add a path to the OpenAPI spec that's residing in the "XData OpenAPI" property)
  • An application.impl.cls class (we'll just implement the GetSpec method)
0
0 322
Question Mark OReilly · Oct 8

Hi:

I see a lot of cool REST apps and i'm trying to host something in the TIE using REST/Axios with VITE. 

At the moment i will probably host the application in web applications in Intersytems. 

For authorisation and getting the logged in user and password to any app, is there a standard people are doing? 

I.e. for axios you might have this from the app

auth: {
        username: apiUser,
        password: apiPass
      }
0
0 0
Article Kate Lau · Oct 13 5m read

Hi all,

It's me again 😁. In the pervious article Writing a REST api service for exporting the generated FHIR bundle in JSON, we actually generated a resource DocumentReference, with the content data encoded in Base64

Question!! Is it possible to write a REST service for decoding it? Because I am very curious what is the message data talking about🤔🤔🤔

OK, Let's start!

1. Create a new utility class datagen.utli.decodefhirjson.cls for decoding the data inside the DocumentReference
 

Class datagen.utli.decodefhirjson Extends%RegisteredObject
{
}
0
0 0
Question Matheus Augusto · Sep 23

Some languages ​​have the concept of a garbage collector for automatic memory management. I'd like to know if something like this exists in InterSystems Caché in the context of routines, %CSP.REST, or %CSP.Page.

The question arises from the %Close() method of the %RegisteredObject class. This indicates that I need to manually clear the object from memory if it's no longer in use, or in the web context, if the request has completed. Is this correct? Or am I completely wrong?

Thank you!

0
0 0
Article Kate Lau · Oct 9 6m read

Hi,

It's me again😁, recently I am working on generating some fake patient data for testing purpose with the help of Chat-GPT by using Python. And, at the same time I would like to share my learning curve.😑

1st of all for building a custom REST api service is easy by extending the %CSP.REST

Creating a REST Service Manually

Let's Start !😂

1. Create a class datagen.restservice which extends  %CSP.REST 

Class datagen.restservice Extends%CSP.REST
{
Parameter CONTENTTYPE = "application/json";
}

 

2. Add a function genpatientcsv() to generate the patient data, and package it into csv string

0
0 0
Article Andrew Sklyarov · Oct 3 8m read

I was really surprised that such a flexible integration platform with a rich toolset specifically for app connections has no out-of-the-box Enterprise Service Bus solution. Like Apache ServiceMix, Mule ESB, SAP PI/PO, etc, what’s the reason? What do you think? Has this pattern lost its relevance completely nowadays? And everybody moved to message brokers, maybe?

0
0 0
Question Eugene.Forde · Aug 31

I’ve been exploring options for connecting Google Cloud Pub/Sub with InterSystems IRIS/HealthShare, but I noticed that IRIS doesn’t seem to ship with any native inbound/outbound adapters for Pub/Sub. Out of the box, IRIS offers adapters for technologies like Kafka, HTTP, FTP, and JDBC, which are great for many use cases, but Pub/Sub appears to be missing from the list.

Has anyone here implemented such an integration successfully?

For example:

0
0 0
Article David Hockenbroch · Apr 2, 2024 9m read

One of the most common kinds of integration we are asked to do is emailing. One of the most typical email services our customers use is Microsoft’s Office 365. After setting up the right configuration on the Microsoft side, we can email from IRIS with two HTTP requests. By the end of this article, we will be able to send an email with an attachment through our Microsoft 365 service!

0
0 681
Article Ashok Kumar T · Sep 8 19m read

FHIR Server

A FHIR Server is a software application that implements the FHIR (Fast Healthcare Interoperability Resources) standard, enabling healthcare systems to store, access, exchange, and manage healthcare data in a standardized manner.

Intersystems IRIS can store and retrieve the following FHIR resources:

0
0 0
Question Scott Roth · Aug 4

I am trying to help another group within our organization access a SQL Table that I have created to populate Epic Department Data within our environment and came across the ability to use SQL Seach REST Interface using iKnow.

However, I am having issues trying to get it to work via POSTMAN before I hand off the solution...

the POST URL... https://<servername>/api/iKnow/latest/TESTCLIN/table/osuwmc_Epic_Clarity.DepartmentMaster/search

where osuwmc_Epic_Clarity.DepartmentMaster is the table

In the body...

0
0 0
Question Sébastien Demoustiez · Aug 22

Hello,

I have a main dispatcher (that extends%CSP.REST) that contains:
<Routes>
   <Map Prefix="/v([0-9]{1,2})/news"    Forward="API.Dispatch.news"/>
</Routes>

And I have the sub-dispatcher that contains:
<Routes>
   <Route Url="/:id"                        Method="GET"  Call="NewsGetItem"/>
</Routes>
If I try to access this route:
https://mydomain.com/mobile/api/v4/news/123
It doesn't work (404).

 

0
0 0
Question TAZ.R · Jul 16

Hello Community,

I’m working on an InterSystems IRIS production that needs to call an external API using OAuth client credentials (client_id and client_secret). For security reasons, I must pass these credentials via environment variables in my Docker container.

In the IRIS terminal, I can successfully retrieve these environment variables using $System.Util.GetEnviron("api-clientid") and $System.Util.GetEnviron("api-clientsecret"). However, inside my Business Operation class (OnMessage method), these environment variables return empty strings.

0
0 0
Question André-Claude Gendron · Jul 31

Hi everyone,

I’m working with an existing InterSystems IRIS server that hosts several web applications and namespace-specific code and data. I’d like to reverse-engineer the current environment into a %Installer.Manifest file so I can store it in Git and manage its changes.

My goal is to:

  • Track the application setup and configuration in version control
  • Rebuild environments consistently (namespaces, CSP apps, security roles, etc.)
  • Possibly automate deployments later on
0
0 0
Question Elisha Gould · Jul 28

With Intersystems indicating ZEN pages are being deprecated, I'm looking to find out how to add custom configuration pages for the management portal using the new method similar to the new Rules editor.

From what I can tell the new method uses rest pages using JWT Authentication, and has a mechanism to use the session cookie to generate the JWT token.
I've gotten the REST part done as per:

Creating a REST API with JWT Authentication in ObjectScript | InterSystems
 

0
0 0
Article Vinicius Maranhao Ribeiro de Castro · Apr 2, 2020 4m read

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.

1
0 1154
Question Rüya Gökoglu · Jul 21

Dear InterSystems-Maintainer Team,


I am currently conducting a comparative evaluation of FHIR clients as part of my
bachelor thesis in health informatics. One of my evaluation criteria is the response
time to support inquiries.


Therefore, I would like to kindly ask the following question as part of my analysis:
How can I read and write custom FHIR extensions using your client library?


If available, could you point me to any documentation or examples?


Many thanks for your time and support!


Kind regards,
Rüya Gökoglu

0
0 0
Article Raef Youssef · Jul 15 6m read

REST API (Representational State Transfer Application Programming Interface) is a standardized way for web applications to communicate with each other using HTTP methods like GET, POST, PUT, DELETE, etc. It's designed around resources, which can be anything from a user to a file. Each resource is identified by a unique URL, and interactions with these resources are stateless, meaning each request from a client to a server must contain all the information needed to understand and process the request. This statelessness, along with the use of standard HTTP methods, makes REST APIs highly

0
0 0
Article David Hockenbroch · Jul 10 16m read

Dear community, I have a confession to make. I have not gotten over Zen yet. Alas, all good things must come to an EOF, so I am currently learning about Angular. I am working on proving to myself that with the right back end and Angular components, I can deliver to myself and my team a very Zen-like experience in this environment. Since this is my first attempt, here is a fair warning: I will be providing some rather large code samples before discussing them. Please warm up your mouse and hand for extensive upcoming scrolling! Also, a note on the code snippets: many of them are labeled

0
0 0
Article Marco Bahamondes · Jun 24 3m read

Introduction

InterSystems IRIS allows you to build REST APIs using ObjectScript classes and the %CSP.REST framework. This enables the development of modern services to expose data for web apps, mobile apps, or system integrations.

In this article, you'll learn how to create a basic REST API in InterSystems IRIS, including:

  • A persistent data class
  • A REST class with GET and POST methods
  • A web application to expose the API
  • A full demonstration using Docker

Step 1: Create the data class Demo.Producto

0
0 0