-2

I am using Drupal 8 I have installed the poll module. I created a view with REST export enabled. Now when I get the data by this url

http://localhost/poll/rest/polling

I am getting all the data of polls like this

[{"question":"which is best city","choice_target_id":"Delhi, Mumbai, Chennai","id":"1","choice_target_id_1":["1","2","3"],"uuid":"b0ef150c-bf05-4a25-8ae9-b6864539c080"},{"question":"Where do you work?","choice_target_id":"Flat, Hotel, Factory, Shop","id":"2","choice_target_id_1":["4","5","6","7"],"uuid":"b2145904-fe8b-4ef6-82fa-f069c2e29f3b"}]

But when I get the data on the basis of id or uuid by this url

http://localhost/poll/rest/polling?id=1

then I am still getting all the data without getting filtered as per the id

What am I doing wrong?

3
  • You haven’t set up any exposed filters or you’re using the wrong filter id on them.
    – Kevin
    Jan 18, 2019 at 9:35
  • yes its working now
    – Mohd Maaz
    Jan 18, 2019 at 9:50
  • please add this as answer so i can mark it as answer
    – Mohd Maaz
    Jan 18, 2019 at 9:50

1 Answer 1

1

You haven’t set up any exposed filters or you’re using the wrong filter id on them. Views needs exposed filters on it by which to limit a query by.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.