ERROR Bad Request : 400 using REST Service

ERROR Bad Request : 400 using REST Service

  

Hi,


I try to Expose REST API in my 1stApp using Outsystem, i Already test Using REST Client POSTMAN and it works. I try to consume the API in another 2ndApp and the Test Result is SUCCESS.

REST API Exposed

Test Result :


Example Response :

{
  "genericResponse": {
    "GenericResponseDoc2": {
      "responseCode": "00",
      "responseDesc": "SUCCESS"
    }
  },
  "itemList": [
    {
      "ItemFindPreRegisterDoc": {
        "id": 11487170150,
        "customerId": 11487089602,
        "name": "Bank Account",
        "type": 3,
        "value": "+628170998245",
        "description": "Favourite ku"
      }
    },
    {
      "ItemFindPreRegisterDoc": {
        "id": 11487183950,
        "customerId": 11487089602,
        "name": "Bank Account",
        "type": 3,
        "value": "+628170998246",
        "description": "Favourite ku"
      }
    }
  ],
  "start": "0",
  "total": "2"
}

But when i run the 2ndApp some how i got the ERROR 400 Bad Request. When i debug it the input Parameter show the data has sent correctly :

Any Idea??

Hi,


Sorry My bad, i set Integer Data type for StartIndex Parameter and i set the value for 0 which wont be set in URL

Hi Angga,


That value 0 is not sent because it is a configured to "not send default values" and 0 is the default value for Integer.

Either way, if you change this setting you can have your requests sending the 0 (for this case) and other default values that you may be passing.

This is not recommended because increases the payload size and, with REST APIs, we want to reduce them.


Best regards.