Software Archive
Read-only legacy content
17061 Discussions

Rest API Webservices Search function

Sam_Suresh
Beginner
207 Views

Hi

I have created a Rest API webservices to pull data from my database.

And I have placed a search box so that user can perform a search.

This is how to search with parameters in the URL;

http://localhost/api.php?name=super&private_key=e4ed5acb3a53e3935a1a8f1676fb111de2a4842a

After create input box I have changed the URL call by dragging the input box to;

http://localhost/api.php?name={{uib_w_7::value}}&private_key=e4ed5acb3a53e3935a1a8f1676fb111de2a4842a

Where {{uib_w_7::value}} is the value user key in, in the input box.

This doesn't work.

However when I tried in browser directly it works. What am I missing here?

Thanks

Screen Shot 2016-07-20 at 2.40.52 PM.png

 

 

 

0 Kudos
2 Replies
Diego_Calp
Valued Contributor I
207 Views

Hi Sam,

Where doesn't work? In Emulator, in a device? If it works on browser the problem probably is that the other option is not getting the php using the url http://localhost/api.php

For more info look at point #2 in this great doc:

http://blogs.intel.com/evangelists/2015/12/31/five-useful-tips-on-getting-started-building-cordova-mobile-apps-with-the-intel-xdk/

Regards

Diego

0 Kudos
Sam_Suresh
Beginner
207 Views

Hi Diego,

I'm testing in emulator.

This URL is working fine in emulator and Firefox (direct access to URL);

http://localhost/api.php?name=super&private_key=e4ed5acb3a53e3935a1a8f1676fb111de2a4842a

But this one which include user input doesn't show any output in emulator.

http://localhost/api.php?name={{uib_w_7::value}}&private_key=e4ed5acb3a53e3935a1a8f1676fb111de2a4842a

This {{uib_w_7::value}} refers to input box value.

So my question is how to get user input is passed to the url? I dragged the inputbox to webservices (as per documentation) and can be seen in my first post above.

Any help appreciated.

Thanks

0 Kudos
Reply