0

I am using apex ORDS to create my own REST api.

what I'm trying to do is to create a query that returns in json format a list of animes linked to a specific user :

to help visualisation, I have user with ID = 1 that has a seen 3 animes : anime ID : 1,2 and 4

the request I want to do in ORDS is :

select *
from table
where ID in (1,2,4)

I'm on android studio using java and what I want is to create an URL of this type : "https://apex.oracle.com/****/apex/****/****/getAnimeList?q=" + theList

The problem is that I can't find how to catch ?q in ORDS and use it it my query.

How do I get ?q in ORDS and could you give me an example please? thanks

Kris Rice
  • 3,300
  • 15
  • 33
fire frost
  • 427
  • 7
  • 23
  • this problem has been answered and explained by Kris Rice at :https://stackoverflow.com/questions/50429334/how-do-i-pass-a-list-in-url-for-a-rest-api/50449055#50449055 – fire frost May 21 '18 at 18:52

1 Answers1

1

Everything in the Query String in ORDS is automatically turned into a Bind. There's nothing extra to be done. "q" is an exception because it is used internally by ORDS for Query Filtering. That means q= has to follow a very exact syntax and has specific function tied to it. REF: https://docs.oracle.com/cd/E56351_01/doc.30/e87809/developing-REST-applications.htm#GUID-091748F8-3D14-402B-9310-25E6A9116B47

For the others, here's an example. Just choose a different letter/name and it'll work fine.

enter image description here

Kris Rice
  • 3,300
  • 15
  • 33
  • thanks, that helps me understanding apex a bit more. I still have an issue, I try doing ?a=1,2,3 and it gives me a error 500. I tried doing it as ?a=1%2C2%2C3 as "," is special in URL but still gives me a 500. how can I do ?a=1,2,3 properly? – fire frost May 21 '18 at 18:44
  • What happens if you just have the source be.. select :a from dual – Kris Rice May 21 '18 at 19:30
  • you answers my problem at https://stackoverflow.com/questions/50429334/how-do-i-pass-a-list-in-url-for-a-rest-api/50449055#50449055 – fire frost May 21 '18 at 19:39