Back to forum list… Back to How Do I?...

Rest API payload issues (1 reply and 1 comment)

mlamboms
6 years ago
mlamboms 6 years ago

I'm trying to post the following json payload to a rest end point and always getting invalid request response

{
"trxnID": 204623243,
"value": 300.00,
"trcNo": "0865232523",
"domainName": "www.example.com",
"aType": "TP_PAYMENT",
"prvNm": "EFT_A2",
"qrEweb": "DEP",
"bnK": "STD",
"sampleText": "2020-10-14 IB PAYMENT FROM 0865232523"
}

 

If I send it via postman it works fine. The problem seems to be with the mandatory JPath parameters on Iman which have to be specified and in this case it's just a single object with no nested objects in it. How do I overcome this. If I Specify Initial JPath to $ then the logs show the request being sent as

"$": [

{
"trxnID": 204623243,
"value": 300.00,
"trcNo": "0865232523",
"domainName": "www.example.com",
"aType": "TP_PAYMENT",
"prvNm": "EFT_A2",
"qrEweb": "DEP",
"bnK": "STD",
"sampleText": "2020-10-14 IB PAYMENT FROM 0865232523"
}

]

and the above is not what is expected by the rest endpoint hence the Invalid Request response

 

Erica Malcolm
6 years ago
Erica Malcolm 6 years ago

mlamboms,

Within JSON writer select the first option in the Generate File Per Transaction dropdown box. Also select Omit Header Object checkbox as in screenshot below.

This is covered hereĀ https://www.realisable.co.uk/support/Documentation/iman-user-guide/Writers/JSON/JSONWriter.htm

https://www.realisable.co.uk/wp-content/uploads/2020/11/JSON-Writer-config.png
mlamboms
6 years ago

very helpful thanks

Contact

    Realisable Software Ltd provides code-free, cost-effective applications integration solutions for SMEs. Our core IMan product is designed to integrate almost any application with a number of Sage solutions and online payment processors.

    Looking to purchase IMan, please see our resellers here.

    Realisable Software
    Ph: +44 (0) 208 123 1017

    Copyright © Realisable. All rights reserved.
    Realisable is a registered trademark

    Close

    Request Demo

      Realisable Software Ltd provides code-free, cost-effective applications integration solutions for SMEs. Our core IMan product is designed to integrate almost any application with a number of Sage solutions and online payment processors.

      Looking to purchase IMan, please see our resellers here.

      Realisable Software
      Ph: +44 (0) 208 123 1017

      Copyright © Realisable. All rights reserved.
      Realisable is a registered trademark

      Close

      Access Downloads

        Realisable Software Ltd provides code-free, cost-effective applications integration solutions for SMEs. Our core IMan product is designed to integrate almost any application with a number of Sage solutions and online payment processors.

        Looking to purchase IMan, please see our resellers here.

        Realisable Software
        Ph: +44 (0) 208 123 1017

        Copyright © Realisable. All rights reserved.
        Realisable is a registered trademark

        Close