0
 Followers
1
 Like

List of basic data type as REST API URL parameter

Integration
New

Hey all,


For loosely coupled applications, we use REST APIs also for the exchange of data between our Outsystems application. 

For example (from outsystems docu): GET https://<server>/MyAPI/rest/PhoneBook/Contacts to get a list of contacts


But currently it is not possible to implement a multi sort for the GET endpoint like:

sort_by=-last_modified,+email

to get something like:

SELECT
    email
FROM
    Items
ORDER BY Last_Modified DESC, Email ASC

(example from: https://www.moesif.com/blog/technical/api-design/REST-API-Design-Filtering-Sorting-and-Pagination/)

because the URL parameter need to be a basic data type or an identifier. But a list like here needed is not possible.

The possibility to change the HTTP Method to send the list in the body, works but is against most REST API design principals.


How do you solve this issue normally if you need a list input parameter in a GET call?


I'm curious to hear your ideas!



Created on 20 Jul
Comments (1)

Changed the category to Integration


views
127
Followers
0