REST API response uses different keys

REST API response uses different keys

  

I am trying to consume a REST API but the response structure's key is different for each call of method. I'm calling something like

http://example.com/api/data?id=100

and I expected to return something like this

{

"id" : 100,

"foo" : "Hello",

"bar" : "world"

}

However what I actually receive is like this

{

"ID:100" : { "foo" : "Hello" , "bar" : "world" }

}

Since the first key in the response structure is related to the parameter passed to the api url, the structure generated by Outsystems only works for calls to the API using the same parameter. Anything else throws an error.

What can I do prevent this or work around it?

Hi,

If you try consume the REST API in Postman (for example), have you same output?

The REST API was created by you in Outsystems?

EDIT: Read this links (1, 2, 3), can help you.


Regards.

Paulo Cação wrote:

Hi,

If you try consume the REST API in Postman (for example), have you same output?

The REST API was created by you in Outsystems?

Regards.

Yes, Postman returns the same structure.

No, the API is from another organisation.

Regards