Online database and Web application builder

Discover Simbla's database driven elements

cover pic.png

Rest API

The Rest API allows you to perform actions such as queries and data update.
In order to connect via API you must receive the following parameters:
1. X-Parse-Application-Id – the database’s identifier. This parameter isn’t confidential.
2. X-Parse-Master-Key – the master password for your database. With its help, you have the highest permissions to the database. You must keep it unexposed to the users.
For the purpose of the exercise, we’ll create within the database a table named Accounts (in the case it doesn’t exist). In the table we will launch three fields –
1. Name – string
2. PhoneNumber – string
3. Score – Number
We will use an API simulator - https://apitester.com/

First example, Querying  the Accounts table: 
Test1.png


- In the field ‘Request’ we’ll enter a general name for the example.

- We’ll choose ‘Post’ and enter the service address for Accounts - https://apps.simbla.com/parse/classes/Accounts

- In the field ‘Post Data’ we’ll enter the following value:

{

"_method":"get"

{

- In the Header we’ll add three values:

1. Content-Type: application/json

2. X-Parse-Application-Id: Your application ID

3. X-Parse-Master-Key: Your Master Key

Now, once we examine the service (clicking Test), we’ll receive a list of clients’ objects existing within the database.

At this point, we’ll change the content of ‘Post’ and add a condition/filter Accounts by the name equals to John:

{

“_method”:”get”,

“where”:{“Name”:”John”}

}

Let test it again.

The following is a list of usable operations:

 Key       Operation

$lt           Less Than

$lte         Less Than Or Equal To

$gt         Greater Than

$gte       Greater Than Or Equal To

$ne        Not Equal To

$in         Contained In

$nin       Not Contained in

$exists  A value is set for the key

$select This matches a value for a key in the result of a different query

$dontSelect Requires that a key’s value not match a value for a key in the result of a different query

$all       Contains all of the given values

$regex  Requires that a key’s value match a regular expression

$text      Performs a full text search on indexed fields

Additional examples:

Retrieve accounts where name like Jo.

{

"_method":"get",

"where":{"Name":{"$regex":"^Jo"}}

}

Retrieve accounts where name is John and Phone Number is like 054.

{

"_method":"get",

"where":{"PhoneNumber":{"$regex":"^054"}, "Name":"John"}

}

retrieve scores between 1000 and 3000, including the endpoints, we could issue:

{"score":{"$gte":1000,"$lte":3000}}'

 retrieve scores equal to an odd number below 10, we could issue:

{"score":{"$in":[1,3,5,7,9]}}

Read here the complete manual of the Rest API:

https://docs.parseplatform.org/rest/guide/


About Simbla

Trying to create a website for their own business, Simbla's founders recognized, over the years, a lack of excellent, simple tools available on the market. Therefore, in 2013 Simbla was founded, for the purpose of providing a smart and easy website building solution for all types of businesses. Simbla's founders have more than 15 years of experience with web-based platforms and website building. We are helping SMB's to create a web presence and to evolve easily into a highly competitive market.

In our vision Simbla creates a new environment where websites are meant for everybody!

Social

all rights reserved to simbla inc

2016