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:

0 18
0 43.4K

Hello community,

I am trying to parse the below HttpResponse in Cache. Cannot get the Iterator to work. Is there a single loop which can parse both or single messages and grab the error?

{
error:[
{ txt1:'error msg1'},

{ txt2:'error msg2'},
]
}

{
error: {
txt1:[
'error msg1',

'error msg2'
]
}

Thanks,

Jimmy Christian

0 16
0 2.1K
Question
· Jul 25, 2023
REST API Request Logging

I am working on my first REST operation to send a API Request to an internal server within our Network. I have finally got past the point of being able to connect using a SSL/TLS Configuration, but I am getting a ERROR <Ens>ErrHTTPStatus: Received non-OK status 403 from remote HTTP server: 'HTTP/1.1 403 Forbidden'.

1 16
1 496

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.

0 14
1 603
Question
· Mar 20, 2017
AWS API calls

This question is about calling AWS REST APIs. Based on:

http://docs.aws.amazon.com/general/latest/gr/sigv4_signing.html

AWS requires REST clients to call their APIs using Signature Version 4 which in case you don't know what I am talking about is a pain in the neck. Here comes the question:

Has anybody, by any chance implemented the v4 signing alg. in COS? If yes, would she or he have the kind heart to share?

Thanks,

Chris

0 13
1 1.2K
Question
· Jul 17, 2017
Connecting to a web service

Hi,

I am new to coding web services and trying to connect to an API that returns its format in xml or json.

I have a class as follows.. when I run I get back a 6059 in my status - Unable to open TCP/IP socket to server

Can someone help me identify what I am missing? Thanks

0 12
0 2.7K

I have successfully created REST service classes on my local IRIS server following this book: Using the /api/mgmnt/ Service | Creating REST Services | InterSystems IRIS Data Platform 2021.2

I am now 1) trying to edit impl.cls in VS Code and 2) export it to my local repo so I can push to the remote repo.

When I click on my project in VS Code and 'Add to project' and choose the new package, spec.cls and impl.cls, I get the following error:

0 12
0 293

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:

0 12
0 315

Hi everyone,

This is:

Cache for UNIX (Red Hat Enterprise Linux for x86-64) 2016.2 (Build 736U) Fri Sep 30 2016 12:25:56 EDT

The server is on RedHat Linux while the browser is running on Windows (Firefox).

I am helping a partner build a complex modern HTML5 web application that talks with Caché using REST calls. They have been using %CSP.REST very successfully. Security works great as well.

1 11
0 9.2K

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.

0 11
0 461

Still working on my first External REST API call, and I am struggling to find the exact answer I am looking for... I get a JSON response from my API call but I am not quite sure how to dynamically get the JSON response into the Ens.Response Object with its lists of Arrays that I have defined.

set tSC = ..Adapter.SendFormDataArray(.tHTTPResposne,"POST",tHTTPRequest,,,tURL)

0 10
0 342

Hello All,

I am just wondering if there is any inbuilt function or utility available in IRIS to clean up "null" elements from JSON e.g. I want to remove "null" elements from payload below before I do any processing with it.

{

recipients: [

{ "name":"Utsavi", "email":"utsavi@gmail.com"},

{ "name":"Utsavi 1", "email":"utsavi1@gmail.com"},

null, null

],

content:[null, {"title":"Test.pdf", "data":"ygwehfbnwfbhew"} ]

}

Thanks & Regards,

0 10
0 540

Hello,

I have a DB server (ser-app-db) where cache is installed as server.

I have a Web server (ser-app-w) where cache is installed as web server and configured as CSP gateway.

I followed the configuration guide (https://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY...) and ser-app-w perfectly display the CSP and CLS pages.

But that's not working for my REST service, for exemple with the REST sample:

0 9
0 1.2K

Hi,

I don't found how to get params send by a GET REST query (not in url but by request param).

this is config of the call in postman

I try to get %request.Data, doesn't work : Data is undefined

I try to get %request.GetCgiEnv("Data"), doesn't work, return ""

I do ZW %request and see that my parameter is present in cgi parameters, but I don't now how to access it.

0 9
2 308
Question
· Jun 1, 2017
Casting JSON

I'm doing a REST service. A method has as body parameter a JSON corresponding to a class A.

In my production I have class A so that I retrieve the parameters using a dynamic object, such that:

Set body = ##class(%DynamicObject).%FromJSON(%request.Content)
Set myObjectA = ##class(A).%New()
Set myObjectA.Id = body.Id
Set myObjectA.Name = body.Name
Set myObjectA.Date = body.Date
Set myObjectA.Salary = body.Salary

I would like to know if I can avoid doing the manual mapping, doing a casting, since I am sure that FromJSON will return a class A. Something like this:

0 9
1 861