Hello, our customer, large industrial company, is considering modernizing their old CSP application so it can run on multiple client device types, using responsive design.

They have a lot of experience with CSP and some ZEN.

They are new to REST and have some limited knowledge of javascript - perhaps not enough to the extent used by client framework.

Does anyone have a framework or a set of templates that you would be willing to share?

Thank you!

Dan Kutac

2 7
0 727

Given I have a property

Class All.AllBooks Extends %Library.Persistent
{

Property ID As %Integer;

Property Title As User.Book;

}

In the class method

ClassMethod GetABookById(id As %Integer) As %Status
{

SET MyBooks = ##class(All.Allbooks).%OpenId(id)

SET obj = {

     "ID" : (MyBooks.%Id())

     "Title" : (MyBooks.Title)

}

WRITE obj.%ToJSON()

Quit 1
}

How do Access the foreign key in JSON() data

0 7
0 490

I have an Ensemble installation and just build my first RestService (using %CSP.Rest that forwards them to my Business Service). This works nice and fine when I use postman to make REST calls over http (port 57772). However when I attempt to make a request using https over port 443 I receive the following error:

1 7
0 863

I am trying to write an application that will take some information on the database make a call to the Google API distance matrix and get the information to use with rest of the application without using the ensemble part of the development is this possible and how can I do my communication with the API from a cache class thanks in advance

0 7
0 1.3K

I am trying to connect the external application. Authenticating via Two SSL,

I have the Client Cert, Private key and the Root Certificate

The connection is successful from local (both via terminal and as well via Postman)

But when trying from IRIS application by configuring the certificates in the SSL configuration, i am not able to successfully verify the SSl connections

When test from the ssl configuration with the endpoint and port its gives the error Error #988: SSL connection failed. SSL/TLS error in SSL_read(), SSL_ERROR_SYSCALL: I/O error (54)

0 7
0 506
Question
· Apr 11, 2017
Authentication with REST

We are building a bunch of rest based services using Ens 2016.2 to serve our browser based application (Angular 4).

Two questions:

1. The initial authentication seems only work if credentials are placed in the url parameters. Trying to use the Authorization header instead, the client code immediately complains about Access-Control-Allow-Origin. How can I resolve this?

2. After initial authentication, what is the proper way to send subsequent rest calls without having to include credential every time?

2 7
0 2.6K

Hi, Community!

Please find a new session recording from Global Summit 2017:

Building Durable APIs: New REST Tooling

https://www.youtube.com/embed/Iv1t1znzZyk
[This is an embedded link, but you cannot view embedded content directly on the site because you have declined the cookies necessary to access it. To view embedded content, you would need to accept all cookies in your Cookies Settings]

3 7
0 394

I am trying to use the automated unittest class for a %CSP.Rest service.

So my Unittest code set's %request and %response from %CSP.Req/resp respectively

I build a tProxy with the fields I need for the post and set it %ToJson... I have tried seting %request.Content = tProxy (and not)

I call the method for the post url directly...

When that method calls %fromJson to set an object with the info. I passed...

- when I don't set %request.content.. I get a error '5035 - premature end of data code 12'

0 7
2 1.1K

When manually coding REST services and using GET /api/mgmnt/v1/:namespace/spec/:application/ to return an OpenAPI spec, how do you specify supported properties (OpenAPI Properties in Use | Creating REST Services | InterSystems IRIS Data Platform 2021.1) like responses, definitions, and information in paths like summary and description?

0 7
1 262

It is clear how to get the request header value with a specific name:

Class My.RestController Extends %CSP.REST
{

ClassMethod processRequest() As %Status
{
    #dim request as %CSP.Request 
    set request = %request
    set h = ##class(%REST.Impl).%GetHeader("...")
    ...    
    return $$$OK
}

But I can't figure out how to enumerate ALL the request headers (and also get all values).

1 7
0 365

Hi Community,

Enjoy watching the new Global Summit 2019 video on InterSystems Developers YouTube Channel:

Building Data-Driven Web Apps

https://www.youtube.com/embed/sLq2NRf0xq4
[This is an embedded link, but you cannot view embedded content directly on the site because you have declined the cookies necessary to access it. To view embedded content, you would need to accept all cookies in your Cookies Settings]

4 7
0 492
Article
· Sep 21, 2016 7m read
REST in Pieces

A beginners guide to develop Ensemble RESTful web services.

Background

Before you start reading this short introduction please go through the on-line documentation of Ensemble with special attention to chapter “Creating REST services and clients with Ensemble”.

The approach in the documentation is undisputable the fastest and easiest way to create RESTful services. As a beginner I went through the documentation and I had several questions. This short article is listing those questions plus my humble answers.

9 6
0 2.2K
InterSystems Official
· Feb 16, 2021
IAM 1.5.0.9 is now GA (Generally Available)

The GA release is now published for the 1.5 version of the InterSystems API Manager (IAM).

The container for IAM, including all relevant artifacts to upgrade from earlier versions of IAM can be downloaded from the WRC Software Distribution site in the Components area.

The build number for this release is IAM 1.5.0.9-4.

InterSystems API Manager 1.5 makes it easier to manage your API traffic, integrate with your environment and onboard users of your APIs. It has many new capabilities, including:

  • Improved User Experience
  • Introducing new Developer Portal tools
  • Support for Kafka connectivity
5 6
0 601

Hello to all,

I'm trying to post some form data from a form I made in React to the backend of cache fetching a REST-service.
Receiving and processing a JSON-object is no problem but how can I handle Form Data?

The frontend is sending the form as form data and also includes one or more files.

What is the easiest way to process this data in my REST.Broker- class?

Best regards,

Simon

0 6
0 452

Some time ago I got a WRC case transferred where a customer asks for the availability of a raw DEFLATE compression/decompression function built-in Caché.

When we talk about DEFLATE we need to talk about Zlib as well, since Zlib is the de-facto standard free compression/decompression library developed in the mid-90s.

Zlib works on particular DEFLATE compression/decompression algorithm and the idea of encapsulation within a wrapper (gzip, zlib, etc.).
https://en.wikipedia.org/wiki/Zlib

9 6
1 2.5K

After some trials, I am comfortably on my way developing spec first REST APIs using /api/mgmt/, OpenAPI 2.0, testing with Postman.

My question is related to scaling up.

Assume these things:

- Our software is CSP web app and it's web application is '/csp/application'

- I created a new REST enabled web app called '/csp/application/v1' and for my first API I created a spec that defines an endpoint /getTeapots so the endpoint is localhost/csp/application/v1/getTeapots

- Using the /api/mgmt/ endpoint, I loaded the spec into API.TeapotLibrary

0 6
0 405