Unable to do POST request using a MID server for SAP integration

Amit Kumar21
Tera Contributor

I am unable to do a POST request using MID server and BASIC auth credentials.

Rest Message:

AmitKumar21_0-1703081488398.png

 

HTTP Method:

AmitKumar21_1-1703081565514.png

 

AmitKumar21_2-1703081630656.png

Now there is a BR that will create the record on m2m outboud(

u_m2m_transactions_outbound) table for the request used for the trigger and payload.
 
screenshot of BR:
AmitKumar21_3-1703081873715.png

Once this has created the record there will be another BR triggered to call the POST request and send the payload.

screenshot of BR:

AmitKumar21_4-1703082157791.png

But i am getting "failure" response for any/all the updates triggering this POST request

AmitKumar21_5-1703082350672.png

Can someone please help as to why that is happening. Also in the past it was working fine. We have checked the credentials, MID server connectivity to the port on endpoint. Everything is correct. but why am i getting failure as response every time.

1 REPLY 1

Community Alums
Not applicable

In your BR - from where comes the variable UniqueHostnames ? Same question for the variables/properties in your loop when you itearte trough UniqueHostname.

Also, can you show the BR setup here - you should be using async BR in general for your use case.

Avoid using new JSONPArser() - use JSON.parse(obj) instead , like you did few lines above it.

Also, not a good practice to name your variables starting with capital letter - avoid it - for example :

var TransactionStatus = "" - rename it to var transactionStatus or var transaction_status - I prefer the first one as it's more readable and snake_case variables are usually used for GlideRecords - much easier to distinguish what is what in the code.