If you have questions or if you want to share your opinion about Aware IM post your message on this forum
#49010 by UnionSystems
Tue Oct 23, 2018 9:36 am
The addition of REST service consumption to AwareIM is a huge addition to a fantastic package. We have extended our AwareIM Apps with data from numerous REST services. Thank you Vladimir.

Some of the REST services we have used with AIM return addrional information via the http response codes (aka status codes). Like the examples below :
Code: Select all200   OK   Success
201   Created   Resource was created
304   Not Modified   There was no new data to return.
400   Bad Request   The request was invalid. An accompanying error message will explain why.
401   Unauthorized   Authentication credentials were missing or incorrect.
402   Payment required   The request is not available in your current price plan.
403   Forbidden   The request is understood, but it has been refused.

Is there a way to capture the http response code returned in an AwareIM REST exchange?
#49015 by Jaymer
Wed Oct 24, 2018 2:37 pm
Dave, I’ve had this problem for a few months as well.
One rest service we use has a normal reply that gets loaded into a BO.
But sometimes, they will return an error (i.e. something other than a 200) and this will not fit the BO structure. So it gets displayed as an ugly message to the user.
I think what’s needed is an Aware methodology to allow for
a) successful reply of type JSON that will create a new instance of a BO, and
b) an error reply in the form of JSON that can create a BO instance also - Then I would be able to gracefully handle the response along with structured data from the provider to present to the user.
#49067 by BenHayat
Fri Oct 26, 2018 2:20 pm
I'm going through the docs for a Payment Processing, and they ONLY supply status code.
A successful request returns the HTTP 202 Accepted status code

We NEED status codes in order for our side to make decision what to do. Every REST system follows this standard. A message is not the standard way.

Please upgrade the REST system to send/get Status code as this is a required featured by many Payment processing sites.
#49258 by UnionSystems
Mon Nov 05, 2018 9:40 am
Vlad delivers (again).

New 8.2 build 2561 changelog

Code: Select allImprovements:
1. It is now possible to capture HTTP response codes in REST

We have not used it yet, but thank you Vlad.
#52680 by UnionSystems
Thu Jan 09, 2020 12:46 am

Can someone tell me how these HTTP response codes are captured in the AwareIM REST setup ?
#52683 by BobK
Thu Jan 09, 2020 3:31 am
I have been working on consuming a REST service for the past week and the following has been my experience with capturing the status code.

1) The BO with the attribute to capture the status code needs to already be in context of the process performing the REQUEST SERVICE
2) A status code of 200 is not captured
3) Any other status code will be captured in the attribute set up to receive the status code
4) If any status code but 200 is returned, the body of the response will be saved in the attribute set up to receive the error message
5) If the body of the response is empty, the current process will fail
#52686 by UnionSystems
Thu Jan 09, 2020 3:50 am
Thanks for quick reply Bob.

Can you post a screen shot of where in the AwareIM REST screens you defined the BO and attribute to capture the http status code?
#52697 by BobK
Thu Jan 09, 2020 12:36 pm
Here is a quick screen shot using the latest AwareIM build. Note: only the fields for capturing the status code and any error message have been set up.

rest.PNG (130.93 KiB) Viewed 873 times

Who is online

Users browsing this forum: Google [Bot] and 21 guests