REST GET,POST,PUT,DELETE?

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
hpl123
Posts: 2579
Joined: Fri Feb 01, 2013 1:13 pm
Location: Scandinavia

REST GET,POST,PUT,DELETE?

Post by hpl123 »

Hi all,
If I have an external system i.e not Aware and I want to use REST GET, POST, PUT and DELETE verbs to talk to an Aware app (i.e the Aware app is the "backend" for another customer facing solution), is this possible in Aware today? Do all the verbs mentioned work per REST standards?

Thanks
Henrik (V8 Developer Ed. - Windows)
aware_support
Posts: 7523
Joined: Sun Apr 24, 2005 12:36 am
Contact:

Re: REST GET,POST,PUT,DELETE?

Post by aware_support »

Short answer is Yes - check out Aware IM REST.
Aware IM Support Team
hpl123
Posts: 2579
Joined: Fri Feb 01, 2013 1:13 pm
Location: Scandinavia

Re: REST GET,POST,PUT,DELETE?

Post by hpl123 »

Awesome, thanks
Henrik (V8 Developer Ed. - Windows)
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Re: REST GET,POST,PUT,DELETE?

Post by tford »

Can you keep us in the loop about what you learn, Henrik?
Tom - V8.8 build 3137 - MySql / PostGres
hpl123
Posts: 2579
Joined: Fri Feb 01, 2013 1:13 pm
Location: Scandinavia

Re: REST GET,POST,PUT,DELETE?

Post by hpl123 »

Su
tford wrote: Tue Oct 06, 2020 3:46 pm Can you keep us in the loop about what you learn, Henrik?
Sure, will do.
Henrik (V8 Developer Ed. - Windows)
mohd.documents
Posts: 58
Joined: Thu Sep 13, 2012 7:06 pm

Re: REST GET,POST,PUT,DELETE?

Post by mohd.documents »

Any updates? Thanks
pbrad
Posts: 781
Joined: Mon Jul 17, 2006 11:03 pm
Location: Ontario, Canada

Re: REST GET,POST,PUT,DELETE?

Post by pbrad »

Just following up on this. Is there anywhere to learn more about this?
Pete Bradstreet
Contract developer of commercialized applications

AwareIM Ver. 8.2
hpl123
Posts: 2579
Joined: Fri Feb 01, 2013 1:13 pm
Location: Scandinavia

Re: REST GET,POST,PUT,DELETE?

Post by hpl123 »

I tried to use/understand this but was over my head and also the documentation is not the best. You have to understand REST in detail I think to understand how it works in Aware. I have managed to get some simple POST from an external source into Aware so does work but I haven't done more than that (would like to though).

Take a look at the sample BSVs shared by Jaymer, it's a good starting point.

Ideally I would want a sample BSV and/or guide for how to set up an entire REST infrastructure using all verbs so if support or anyone who knows this part of Aware can do that, would be awesome.
Henrik (V8 Developer Ed. - Windows)
pbrad
Posts: 781
Joined: Mon Jul 17, 2006 11:03 pm
Location: Ontario, Canada

Re: REST GET,POST,PUT,DELETE?

Post by pbrad »

Thanks Henrik, any idea where I can grab Jaymers bsv?
Cheers,
Pete
Pete Bradstreet
Contract developer of commercialized applications

AwareIM Ver. 8.2
BobK
Posts: 544
Joined: Thu Jan 31, 2008 2:14 pm
Location: Cincinnati, Ohio, USA

Re: REST GET,POST,PUT,DELETE?

Post by BobK »

I would be interested in seeing Jaymer's BSV too.

I may be missing something, but in my experience Aware handles all of the verbs in the same way. No matter what verb is used, the process listed in the Service Implementation is executed and I do not know of any way to determine which verb was used.
Bob
hpl123
Posts: 2579
Joined: Fri Feb 01, 2013 1:13 pm
Location: Scandinavia

Re: REST GET,POST,PUT,DELETE?

Post by hpl123 »

Here is the sample bsv:
viewtopic.php?f=1&t=10849&p=55252&hilit ... mer#p55252

I also wonder about the verb used thing i.e how can we determine which verb is used in a call to the Aware REST.
Henrik (V8 Developer Ed. - Windows)
pbrad
Posts: 781
Joined: Mon Jul 17, 2006 11:03 pm
Location: Ontario, Canada

Re: REST GET,POST,PUT,DELETE?

Post by pbrad »

Thanks Henrik, I have actually seen this before and have a number of rest services that take a similar approach although I found the process of hiding attributes from being returned too tedious so I created an alias object that I keep in sync that has far fewer attributes.

What I am a little confused about is the whole Verb thing (REST,GET,POST,PUT,DELETE). I have processes that do these things already but I don't get the verbs. I am thinking that perhaps it is just a case of populating the URL must contain string field to have those verbs so that the service URLs look more like traditional crud endpoints, I suspect that is the case but I will have another dive.
Cheers,
Pete
Pete Bradstreet
Contract developer of commercialized applications

AwareIM Ver. 8.2
hpl123
Posts: 2579
Joined: Fri Feb 01, 2013 1:13 pm
Location: Scandinavia

Re: REST GET,POST,PUT,DELETE?

Post by hpl123 »

I have limited knowledge about REST but think the verbs are part of the body of the request being made to the Aware REST service endpoint and depending on which verb is used, the Aware REST should 1) pick up which verb and do operations based on that and 2) send a reply to the calling entity in the form of a success reply or some data being returned and I think the replies can look different depending on which verb is used (not sure about that though).

The thing is, if we want to setup a REST api for our apps and use the REST format, we have to more or less work after the current REST standards i.e a REST DELETE does just that deletes some resource and sends an appropriate DELETE call reply. IMO we can´t ask our customers to do a POST with a DELETE keyword as part of the parameters, sure it would work technically but most likely not work like "normal" REST apis work and the way most companies expect REST apis to work. There are multiple verbs for a reason, otherwise all calls would be made with POST and keywords.

This then takes us back to the verbs used question, how can we know which verb is used and also regarding the potential reply, is there some standard for type of reply or how does it work?
Henrik (V8 Developer Ed. - Windows)
BLOMASKY
Posts: 1470
Joined: Wed Sep 30, 2015 10:08 pm
Location: Ocala FL

Re: REST GET,POST,PUT,DELETE?

Post by BLOMASKY »

I have used REST a lot with NODE. Calling Node FROM Aware not in reverse.

A few suggestions:

1) GET POSTMAN! This lets you very easily with a GUI create REST calls and see the return. Use it, Love it. This way you are only debugging the Aware part of this.

2). While there are 4 main verbs, they mostly have to do with how and what is being sent to the REST client. There is NOTHING wrong with using a POST to delete. Since you will have a named rest process. It can do whatever you want. Since, unless you are issuing a GET, your only response is usally a msg stating Success of Failure.

3). Use the best tool for the job. While there are a lot of plus in many cases having Aware hosting your rest backend. It is pretty simple to set up a node server (Express, Restify, etc.) and use that if you are just manipulating SQL.)


Bruce
BobK
Posts: 544
Joined: Thu Jan 31, 2008 2:14 pm
Location: Cincinnati, Ohio, USA

Re: REST GET,POST,PUT,DELETE?

Post by BobK »

BLOMASKY wrote: Wed Mar 16, 2022 10:45 pm 1) GET POSTMAN! This lets you very easily with a GUI create REST calls and see the return. Use it, Love it. This way you are only debugging the Aware part of this.
+10
Bob
Post Reply