78
Views
7
Comments
Solved
How to pass list parameter into method URL?
Question

Hi, I'm trying to GET a filtered data from a REST API. To get those data, there's a few parameter that need to be passed. Here are some of the parameters that need to be passed in postman.


I do know that i need to just add {query} if it's a single value (skip or take)

e.g. http://test.com/Filter/skip={skip}&take={take}

But how do i pass the parameter of a list (sort and filter) into the method URL?

Do i do the same thing, e.g. http://test.com/Filter/skip={skip}&take={take}&field={field}&dir={dir}
or is there other way to achieve this? 

Best Regards,
Felix

2021-03-05 13-56-11
Ricardo Pereira
 
MVP
Solution

Hi,

You need to pass it in the body:

But, if you do that, the method cannot be defined as 'GET'.


Hope this can help you.


Best regards,

Ricardo

UserImage.jpg
Felix Intan Bahagia

Hi Ricardo,
Is there a way to send it through URL method though? Since i don't really want to change the method from 'GET' if it's possible.

Best Regards,
Felix

2023-05-30 10-05-13
Lourenço Matalonga

Hello Felix,

please check the following documentation!

Hope it helps.

Best regards,

Lourenco Matalonga

UserImage.jpg
Felix Intan Bahagia

Hi Lourenco,

Thanks for the documentation. 
Gave it a read, and given from what i've understand, seems like it's a documentation on how to design the API when exposing it? 

Sadly I can't really change the code behind the API, and the task is I've been given is I need to find out on how to pass the parameters into the URL using GET method.
Please do tell me if you have any insights on that.

Best Regards,
Felix


2021-03-05 13-56-11
Ricardo Pereira
 
MVP
Solution

Hi,

You need to pass it in the body:

But, if you do that, the method cannot be defined as 'GET'.


Hope this can help you.


Best regards,

Ricardo

UserImage.jpg
Felix Intan Bahagia

Hi Ricardo,
Is there a way to send it through URL method though? Since i don't really want to change the method from 'GET' if it's possible.

Best Regards,
Felix

2024-09-12 02-43-38
Deepsagar Dubey

Hi @Felix Intan Bahagia 

indeed the best solution is to pass data through body but if you want to achieve this by passing query parameter then convert your list to JSON and pass it as query parameter value then when you want to use it again convert JSON to list,  

I hope you are aware about these two Outsystems tool - 

But i am not sure whether it'll work fine or not but lets have a try.

Thanks
Deep 


2024-09-12 02-43-38
Deepsagar Dubey

Hi @Felix Intan Bahagia 

Have you tried this ?

UserImage.jpg
Felix Intan Bahagia

Hi Deep, I haven't really tried that method yet, since I've decided to just change the method to POST, and everything work as planned.

Thanks for the advice though! 

Best Regards,
Felix

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.