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
fjcortes
Posts: 72
Joined: Thu Apr 21, 2011 9:16 pm
Location: Colombia
Contact:

Re: REST GET,POST,PUT,DELETE?

Post by fjcortes »

Hello, I am trying to send information through a REST using the POST method, the page that should receive the information, requests that the Authorization attribute be added with its respective key in the header of the html to send, how can I do that from Aware IM
Javier Cortes Ayus
Version 9.x (Testing)
OS: Ubuntu 20.04.6 LTS - DB: MySQL
Jaymer
Posts: 2539
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: REST GET,POST,PUT,DELETE?

Post by Jaymer »

use your appropriate name/value pairs in the header.
should be straightforward

rest headers.png
rest headers.png (92.62 KiB) Viewed 16251 times
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
fjcortes
Posts: 72
Joined: Thu Apr 21, 2011 9:16 pm
Location: Colombia
Contact:

Re: REST GET,POST,PUT,DELETE?

Post by fjcortes »

Thank you Jaymer.
Indeed, once the corresponding values were placed, it was simple.
Javier Cortes Ayus
Version 9.x (Testing)
OS: Ubuntu 20.04.6 LTS - DB: MySQL
ACDC
Posts: 1161
Joined: Sat Jun 30, 2007 5:03 pm
Location: California, USA

Re: REST GET,POST,PUT,DELETE?

Post by ACDC »

BLOMASKY wrote: Wed Mar 16, 2022 10:45 pm 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.

Bruce
This is fine for constructing a REST call and running test, but I want to see what the AwareIM server is constructing from the REST setup with all its features like name mapping and name replacement.

How do I capture the POST url at the server level for debug purposes -- any ideas?

Seems like a good feature request to have in the configurator, once REST is setup, output to a log file the url content
Jaymer
Posts: 2539
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: REST GET,POST,PUT,DELETE?

Post by Jaymer »

ACDC wrote: Fri Apr 14, 2023 7:33 pm How do I capture the POST url at the server level for debug purposes -- any ideas?
not sure what that means.
A REST call going TO Aware?

You have to make a Service, and thats tied to a Process with an Input table.
So all the submitted data gets stored in the Table.
Make the call and browse the table and you can see what came in?

True, the Server/Tomcat windows don't say squat.
Production log will show you the Process running... and you could use rules there with LOG2 statements if needed.
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
pbrad
Posts: 782
Joined: Mon Jul 17, 2006 11:03 pm
Location: Ontario, Canada

Re: REST GET,POST,PUT,DELETE?

Post by pbrad »

Webhook.site can expose a URL to post to and then view received post
Pete Bradstreet
Contract developer of commercialized applications

AwareIM Ver. 8.2
ACDC
Posts: 1161
Joined: Sat Jun 30, 2007 5:03 pm
Location: California, USA

Re: REST GET,POST,PUT,DELETE?

Post by ACDC »

Jaymer wrote: Fri Apr 14, 2023 8:40 pm
ACDC wrote: Fri Apr 14, 2023 7:33 pm How do I capture the POST url at the server level for debug purposes -- any ideas?
not sure what that means.
A REST call going TO Aware?
I am connecting to a remote API and posting an Invoice from my AwareIM APP

The ....POST url that AwareIM generates from the Aware configured REST Object contains a Request header and body.

I want to see something like this, to check if the layout and contents that AwareIM created is correct according to the configuration in the REST OBJECT and its related process. (i can see it in the table created by the process, but want to see what's going out on the wire)


{
"header": {
"Authorization": "Bearer api-key",
"x-apitest-app-id": "app-id",
"x-apitest-consumer-id": "consumer-id",
"x-apitest-service-id": "service-id"
},
"body": {
"number": "1234567",
"customer": "Citi Bank",
"invoice_date": "2023/04/10",
"due_date": "2023/04/10",
"terms": "Net",
"po_number": "4321",
"reference": "69000",
"status": "authorised",
"tax_inclusive": "2000",
"sub_total": "2500",
"total_tax": "500",
"tax_code": "td200",
"balance": "2500",
"billing_address": {
"id": "450009",
"string": "25 Sring St Blackburn",
"name": "HQ US",
"line1": ""
}
}
}
Jaymer
Posts: 2539
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: REST GET,POST,PUT,DELETE?

Post by Jaymer »

@ACDC
pbrad wrote: Fri Apr 14, 2023 8:44 pm Webhook.site can expose a URL to post to and then view received post
what he said
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
ACDC
Posts: 1161
Joined: Sat Jun 30, 2007 5:03 pm
Location: California, USA

Re: REST GET,POST,PUT,DELETE?

Post by ACDC »

Jaymer wrote: Sat Apr 15, 2023 2:00 am @ACDC
pbrad wrote: Fri Apr 14, 2023 8:44 pm Webhook.site can expose a URL to post to and then view received post
what he said
Yes this does seem like a solution. Thank You
BTW, is there any constraints trying to get this working in TEST mode on a local pc with no ssl in place
pbrad
Posts: 782
Joined: Mon Jul 17, 2006 11:03 pm
Location: Ontario, Canada

Re: REST GET,POST,PUT,DELETE?

Post by pbrad »

As I reecall, you can consume but not expose in test mode. Ssl not required for consuming
Pete Bradstreet
Contract developer of commercialized applications

AwareIM Ver. 8.2
ACDC
Posts: 1161
Joined: Sat Jun 30, 2007 5:03 pm
Location: California, USA

Re: REST GET,POST,PUT,DELETE?

Post by ACDC »

pbrad wrote: Sat Apr 15, 2023 8:29 am As I recall, you can consume but not expose in test mode. Ssl not required for consuming
Yes that's what I thought, thank you. I have had some strange issues with the configuration that don't make sense, was wondering if it's because i am in Test Mode, also getting java errors in the configurator. Anyway I will start again from scratch, maybe use a manual config as opposed to using the Discover Tool and auto setup of objects
Post Reply