Page 1 of 2

REST Service URL populated from a Local Storage variable?

Posted: Fri Apr 27, 2012 1:19 am
by TimGeiges

How can you load a URL into a REST service. So I have a listview and each item has a URL that should load a new listview, the URLS do not accept params so I cannot map the request. So can I have the full URL be read from a local storage variable?


REST Service URL populated from a Local Storage variable?

Posted: Fri Apr 27, 2012 2:08 am
by maxkatz

Set the URL like this:

{url}

and create 'url' request parameter. Then map it from local storage.

http://help.tiggzi.com/documentation/...


REST Service URL populated from a Local Storage variable?

Posted: Fri Apr 27, 2012 10:06 pm
by TimGeiges

Thanks, worked perfectly!


REST Service URL populated from a Local Storage variable?

Posted: Wed Sep 26, 2012 9:48 am
by Tim5052033

Hi,

I'm having the same issue and I can't seem to get it working.

http://api.mob1.stackmob.com/appName/...

unique_id is a Request Parameter (not a header and no default).

On Load event I'm invoking the service and populating it with a local variable.

If I hardcode and replace {unique_id} with the actual ID then it works.

Any ideas what I could be doing wrong?

Thanks


REST Service URL populated from a Local Storage variable?

Posted: Wed Sep 26, 2012 1:10 pm
by maxkatz

Can you show a screen shot of service setting, service request parameter and mapping?


REST Service URL populated from a Local Storage variable?

Posted: Wed Sep 26, 2012 1:50 pm
by Tim5052033

Thanks Max. I've tried moving across to other back-end providers to solve this that way but it's proving more complicated.

I've quickly re-created a simple version of the app and attached screenshots.

On the first screen the local variable "unique_id" is set to valid id in the DB (the same DB that I was using earlier).

Thanks

Image Image
Image
Image


REST Service URL populated from a Local Storage variable?

Posted: Wed Sep 26, 2012 1:57 pm
by maxkatz

It looks fine.. where do you set the local storage variable?


REST Service URL populated from a Local Storage variable?

Posted: Wed Sep 26, 2012 2:02 pm
by Tim5052033

The local variable is set on a button click on another page which then causes a page navigation to the page above. I've just shared my app with you - it may be easier to look at it that way around.


REST Service URL populated from a Local Storage variable?

Posted: Wed Sep 26, 2012 7:14 pm
by maxkatz

I think there is a bug on our end. You got it setup correctly, the problem is that the {id} is first inserted into the URL (as should be), but then also added as a request paremeter (?id=xxx). This part causes the problem. We'll fix it.


REST Service URL populated from a Local Storage variable?

Posted: Thu Sep 27, 2012 5:44 am
by Tim5052033

Thanks Max. Any idea of timing?