HTTP Postback via HTTP Post

HTTP Postback via HTTP Post

  

Hi,

We currently have a requirement with this specification: 

Postback, notifications are sent by our server via HTTP POST. Yourpostback handler should not return a UI, but should return a plaintext (nohtml, no quotes) "result=OK". OK can be any value that can havenumbers, letters and underscores. e.g. result=FAIL_DIGEST_MISMATCH


How can this be implemented through Outsystems? It is a third party gateway we will be integrating with.

Hi,


I think you can do it with a rest expose method.

Just an output parameter in the body.


Otherwise a simple page where in the preparation you do a download of a file which is your text.

I have exposed a rest method for this however, we received the following advise from our partner:

The postback is getting an HTTP POST, while the return is getting anHTTP GET. Most languages and frameworks treat the parameters for these twomethods separately. In PHP, you can use the $_GET and the $_POST parameter. Ifyou are using these variables to access the parameters, or an analog of these, you would not "see"the parameters if a different HTTP method was used to what you were expecting.You can also use the $_REQUEST parameter, which should include parameters fromHTTP POST and HTTP GET. Other frameworks, like .Net, would have an analog ofthe $_GET, $_POST, and $_REQUEST as well.


How can this be implemented in outsystems?

Hello Geraldine,

I if understand you correctly, you should just need to change the HTTP Method of your REST API, like this:

I hope this helps you.

Sincerely,

Pedro Guimarães

Hi Pedro Guimarães,

That was the first thing I did actually.. however, it is giving them this error:


Upon trying in Postman, the following was the error:

{
  "Errors": [
    "The 'txnid' URL parameter is missing in the request.",
    "The 'refno' URL parameter is missing in the request.",
    "The 'status' URL parameter is missing in the request.",
    "The 'message' URL parameter is missing in the request.",
    "The 'digest' URL parameter is missing in the request."
  ],
  "StatusCode": 400
}


Yes, the REST received 5 parameters and returns 1 parameter. 

We have consulted this with our partner and the response was: 

The postback is getting an HTTP POST, while the return is getting an HTTP GET. Most languages and frameworks treat the parameters for these two methods separately. In PHP, you can use the $_GET and the $_POST parameter. If you are using these variables to access the parameters, or an analog of these, you would not "see" the parameters if a different HTTP method was used to what you were expecting. You can also use the $_REQUEST parameter, which should include parameters from HTTP POST and HTTP GET. Other frameworks, like .Net, would have an analog of the $_GET, $_POST, and $_REQUEST as well.