TimGeiges
Posts: 0
Joined: Fri Apr 27, 2012 1:19 am

REST Service URL populated from a Local Storage variable?

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?

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

REST Service URL populated from a Local Storage variable?

Set the URL like this:

{url}

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

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

TimGeiges
Posts: 0
Joined: Fri Apr 27, 2012 1:19 am

REST Service URL populated from a Local Storage variable?

Thanks, worked perfectly!

Tim5052033
Posts: 0
Joined: Wed Sep 26, 2012 5:27 am

REST Service URL populated from a Local Storage variable?

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

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

REST Service URL populated from a Local Storage variable?

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

Tim5052033
Posts: 0
Joined: Wed Sep 26, 2012 5:27 am

REST Service URL populated from a Local Storage variable?

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

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

REST Service URL populated from a Local Storage variable?

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

Tim5052033
Posts: 0
Joined: Wed Sep 26, 2012 5:27 am

REST Service URL populated from a Local Storage variable?

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.

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

REST Service URL populated from a Local Storage variable?

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.

Tim5052033
Posts: 0
Joined: Wed Sep 26, 2012 5:27 am

REST Service URL populated from a Local Storage variable?

Thanks Max. Any idea of timing?

Return to “Issues”