REST Services

Hi Everyone!

New webinar "Rest API Design and Development" is available now on  DC YouTube Channel:

 

+ 1   0 2
0

comments

134

views

+ 1

rating

This series of articles aims to address the following topics:

  • Creation of a web application based on REST pages;
  • Overview of some tools for tracing (debugging) HTTP requests;
  • Switching from hyperevents to... hyperevents;
  • Integration with jQuery File Upload;
  • Conversion of JSON from the {id:1,parentId:1} format to the {id:1,children:[{}]} format for tree visualization;
  • Integration with jQuery EasyUI (using datagrid and tree as examples);
  • Other topics.

Last comment 8 March 2018
+ 4   0 3
545

views

+ 4

rating

Hi.. I have an issue where we are using OAuth2.0 with the ZAUTHENTICATE routine.  Once our token is validated we are using a users lan id (passed on the ID token) to find a software defined username in a Cache Global.

That is all working fine in ZAUTHENTICATE.. I am setting the software defined username in the Properties("Comment") array and wanting to reference it in the Rest Service Dispatch class.

Last answer 2 February 2018 Last comment 16 February 2018
0   0 2
389

views

0

rating

I'm sending data via ajax to my REST service, and while retrieving any information sent in the url parameter is easy when they're defined in the route, I can't get anything if I store information in the data parameter. For example:

$.ajax({
               url: "ServerURL",
               data: { "some": "json" } //How do I get this information?

...

I've looked at many common solutions such as here:

Last answer 15 February 2018 Last comment 15 February 2018
0   0 3
363

views

0

rating

Hi. I am learning create Rest service  with Cache. From this repo. https://github.com/intersystems-ru/REST

I created new web application from Web Applications  section in Management Portal. Such as screenshot.  In browser  call http://127.0.0.1:57772/rest/test . But got  "Service Unavailable" 503 response.  Could you please help?

Last answer 1 February 2018 Last comment 1 February 2018
0   0 5
420

views

0

rating

As many of you, our partners, are more widely using modern UI frameworks to create client front-end, you may have encountered a question, "So how do I secure my data when I just finished developing all new fancy browser based client experience?"

The answer is easy. Use a standard, proven OAuth2 and OpenID!

"OK, but how can I do it? I have never done it before."

No problem, just have a look here, if your client is Angular (not AngularJS) based, there is a demo project available for you to review and get inspired!

Last comment 13 November 2017
+ 6   0 4
743

views

+ 6

rating

Hello, evrybody, I'm writing one project using CSP("OnPreHTTP"), and also REST angular. At the beginning I wrote purely on csp, then I decided to use angular for the flexibility of the client part. Now I can not design logging, I created a table App.Log with properties

Last answer 6 November 2017 Last comment 7 November 2017
0   0 1
267

views

0

rating

Hi, 

I am a beginner on intersystems technologies ! and i want implements Oauth2 for our projects ( Angular 2 + Caché REST  Backend). 

i read the article that the link  is below : 

https://community.intersystems.com/post/cach%C3%A9-open-authorization-framework-oauth-20-implementation-part-1

But : i need to create  all servers ( Auth and Resource ) on Caché and dont' to use google server.

Last comment 26 September 2017
0   0 4
0

answers

474

views

0

rating

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:

Last answer 11 August 2017 Last comment 14 August 2017
0   0 2
587

views

0

rating

By now it's a commonplace how to implement a basic REST API in Caché and there is good documentation about it here: REST in Caché

A question that comes up from time to time is:

How can I make a parameter in my REST url optional?

Simply put, is it possible to create a URL map in Caché that maps a URL like this:

Last comment 23 July 2017
+ 11   0 4
1209

views

+ 11

rating

Suppose I have a web application named "/my/api", with a dispatch class configured (a subclass of %CSP.REST), and I want to be able to respond to:

GET /my/api/something/:id

by loading an object with the specified ID and returning it as JSON

GET /my/api/another-thing/data.js

Last answer 24 May 2017 Last comment 24 May 2017
0   0 4
504

views

0

rating

Hi all,

I've a RESP API service in a Business Service to server different methods

I've created the route with the name of the method, each one has been created in lowercase 

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

But only there is a response if the call is used in lowercase

Last answer 4 May 2017
0   0 4
0

comments

345

views

0

rating

In this article I'll cover testing and debugging Caché web applications (mainly REST) with external tools. Second part covers Caché tools.

You wrote server-side code and want to test it from a client or already have a web application and it doesn't work. Here comes debugging. In this article I'll go from the easiest to use tools (browser) to the most comprehensive (packet analyzer), but first let's talk a little about most common errors and how they can be resolved.

+ 8   2 1
0

comments

980

views

+ 8

rating

Let's say I need to process these urls in one REST method:

http://host:port/REST/arg1/arg2/arg3
http://host:port/REST/arg1/arg2/
http://host:port/REST/arg1/arg2
http://host:port/REST/arg
http://host:port/REST/

Currently I need to define URL Map like this (assuming /REST web app):

Last answer 28 March 2017 Last comment 28 March 2017
+ 1   0 0
205

views

+ 1

rating

Hi everyone, I have and Zen Mojo application, it's all working but I have some doubts about what is recommended to use: There is some reports of employees, for example, and actually I'm using some plugins : "Excelent export" to generate Excel reports and "jspdf" to generate PDF reports in client side.

I have an REST service, that receives the request, process and returns JSON, after client side receive the response it's processed.

- This can be slow/bad in applications with large data?

- It's better/recommended to use ZenReports even with ZenMojo applications?

Last answer 24 February 2017
+ 1   0 0
0

comments

208

views

+ 1

rating

Hi,

I am working with this Ensemble Business Operation, which extends the EnsLib.Rest.Operation.

http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=...

I built the OpenWeatherMap Rest Operation described in the article above.

I would like to access the weather.id weather.main, and weather.description. However, these objects are in a JSON Array.

How do you access these three objects in Objectscript.

Last answer 9 December 2016 Last comment 9 December 2016
0   0 1
422

views

0

rating

Hi,

I was looking at the ENSDEMO namespace in our Ensemble server. In the class Demo.REST.DirectoryOperation, there is a line that uses the macro $$$URLENCODE. I would like to know exactly what does this macro $$$URLENCODE() do. Specifically what value does it. Unfortunately, I can't find anything about this macro in the Ensemble Documentation.

Last answer 7 December 2016
0   0 0
0

comments

266

views

0

rating

Evgeny

Thank you for your help yesterday at the Belfry.

When I try to subscribe to the RSS feeds using some news readers they do not accept them.

The W3C validator makes a lot of suggestions about what might be wrong, but my guess is that the feed title is blank.  Could this be fixed please?

W3C feed validator results for a group: http://validator.w3.org/feed/check.cgi?url=https%3A%2F%2Fcommunity.inter...

George

Last answer 2 December 2016 Last comment 27 October 2016
+ 2   0 0
130

views

+ 2

rating

We tested REST Services  as described for Caché DocServer example and for requests using http protocol it works without problems. However when we use the https protocol for the same REST Service it is not available. Our infrastructure is as follows: Apache with openssl, which works on the other hand well for CSP with https. If we switch on the web gateway http trace facility we could see the request of CSP pages by https://... but again a request of a REST Service by https:// will not result in a entry in the tracer. We hope that this description of the problem is understandable.

Last answer 23 November 2016
0   0 1
0

comments

342

views

0

rating