Message:

Subscribe rss
Blog categories
All | Backendless features
Feature 117: Creating/saving new data objects using REST Console
May 6, 2015 by markpiller
Spread the love

Previously I wrote about the REST Console, which is a part of the Backendless Console. It is a versatile interface which lets you perform a complete CRUD (Create, Retrieve, Update, Delete) set of operations on your data stored in Backendless using the REST interface. One of my previous articles described how to use the REST Console to perform search queries (that’s the Retrieve part of CRUD). In this post I am going to demonstrate how to save new data objects using the REST Console.

Consider the following data table schema:
location table - Feature 117: Creating/saving new data objects using REST Console

The table name is “Location”, as you can see in the drop-down in the upper-right corner of the screen. There are five columns in the table. Let’s switch to the REST Console interface for the table and enter a JSON object describing a new location. We’re going to ignore the “menu” column for now to keep things simple. A JSON object describing a location per the schema shown above may look like this:

The REST Console interface is available on the Data screen of the Backendless Console. Select a table where you want to create a new object and click the REST Console tab. In my case it is going to the the Location table:
location table rest console - Feature 117: Creating/saving new data objects using REST Console

Notice I already added the JSON object in the Request body field. To send a REST request to save a new object, click the POST button. An object is saved an a complete object description is returned and shown in the Response body field. It is important to note that this would be the exact behavior for the same REST request executed outside of the REST Console:
location table object saved - Feature 117: Creating/saving new data objects using REST Console

If you switch to the Data Browser tab, the new object will show up in the table as well:
object in data browser - Feature 117: Creating/saving new data objects using REST Console

Enjoy!

Share this post
Tweet about this on TwitterShare on FacebookGoogle+