Melvin Tan Gim Huat
Posts: 0
Joined: Sun Oct 14, 2012 11:58 pm

PUT method - how do I update values in my Tiggzi database using user inputs?

Hi,

I am creating a REST service to update values in my Tiggzi database based on user inputs. I understand that this requires the PUT method.

However, I am not sure what I should specify for the URL, request parameters and response parameters when setting up the REST service.

I have not been able to find any tutorials, documentation or examples to guide me.

Can someone please advise?
Thanks.

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

PUT method - how do I update values in my Tiggzi database using user inputs?

Hello! Please take a look at the screenshot

Image

red - service URL
blue - request parameter

Here is how to define the service

Image

Here is the result after test

Image

name - it's just the name of column where I want to update the value

Melvin Tan Gim Huat
Posts: 0
Joined: Sun Oct 14, 2012 11:58 pm

PUT method - how do I update values in my Tiggzi database using user inputs?

Thanks Marina.
This example works but does not have much flexibility.

I need this REST service to be dynamic, therefore, I cannot simply specify the service URL with just one object ID. How can I set the object ID dynamically?

For e.g., Users can choose to vote for different items (hundreds or thousands) in my app. Whenever an item gets a vote, I want to update its number of votes in the database. Hence, the need for this REST service to be dynamic.

Appreciate your help.

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

PUT method - how do I update values in my Tiggzi database using user inputs?

You can send object Id as request parameter (name it Id), map that parameter to Local Storage variable, save in local storage Object Id and invoke the service.

Melvin Tan Gim Huat
Posts: 0
Joined: Sun Oct 14, 2012 11:58 pm

PUT method - how do I update values in my Tiggzi database using user inputs?

I understand the concept but it is the syntax that I can't get right.
I already have the object ID saved as a local storage variable from an earlier GET service so I can use it.

But, what do I specify as the service URL in this PUT service?
]https://api.tiggzi.com/rest/1/db/coll...? FYI, "thoughts" is the name of the collection.

This doesn't work. I tried a few other variations but they didn't work either.

Appreciate if you can list out the steps from setting up the dynamic PUT service to the mapping required to make it work.

Melvin Tan Gim Huat
Posts: 0
Joined: Sun Oct 14, 2012 11:58 pm

PUT method - how do I update values in my Tiggzi database using user inputs?

I've figured out the correct service URL to use.

dccshazam
Posts: 0
Joined: Sun Apr 21, 2013 7:54 pm

PUT method - how do I update values in my Tiggzi database using user inputs?

I have an App I want to build, but I do not know how to use this product, HTML, JS well enough to build the app. I have the layout done, just not the backend. Anyone able to help?

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

PUT method - how do I update values in my Tiggzi database using user inputs?

Hello! Please visit our docs site http://docs.appery.io/, there you can find a lot of information and many ideas on how to build your app. Please let us know if you have any specific question.

The Herb Keeper
Posts: 0
Joined: Sat Jul 06, 2013 7:34 pm

PUT method - how do I update values in my Tiggzi database using user inputs?

can you post the correct URL to use when pulling objectID from local storage to put in a dynamic URL? I have the same issue, and have used ObjectID from local storage to request, to no avail.

Return to “Issues”