Subscribe rss
Blog categories

As data objects are being saved or updated with the API requests some properties of the objects may not have a value assigned to them. It may be necessary that for those properties a default value is assigned. This is identical to how relational databases may have a default value for a column.

Configuring a default value for a column is very easy. You can set it when you declare a column or after a column is already created.

The popup window for creating a new column includes a field where the default value can be set:

Alternatively, when a column already exists in a table schema, there is a field which displays and lets you edit the default value:
default-field-existing-columnOnce a default value is assigned to a column, it becomes immediately effective. When an object is saved or updated does not have a value for a property corresponding to the column, Backendless inserts the default value.

Backendless provides an easy to use API to introspect data tables. Given a table name, the API provides information about table columns, their names, data types, default values, etc. If a column represents a relationship, it is properly denoted as such in the provided information.

Consider the following data table. The table name is Person as it is indicated in the upper right corner:

Continue reading

The logout API is a logical counterpart for the User Login API. The logout step is not required for most apps – user session will expire automatically. However, some apps provide the functionality, especially those with a special multiple login policy. The logout API is very simple – a single line of code terminates the current session:

Continue reading

In my previous post I described how to adjust object’s access control list (ACL) using Backendless console. As I mentioned, in addition to console, object’s permissions can be controlled using API. In fact, for any persisted object, Backendless supports the following capabilities:

granting/rejecting permission to execute find/save/update/delete operation on an object to:

  • a user
  • a role
  • all users
  • all roles

The general API usage pattern is:

Where <OPERATION> can be FIND , UPDATE , REMOVE. There are many more methods available on the <OPERATION> class supporting all the combinations listed above.
Continue reading

Every data objects saved in Backendless has its own access control list (ACL). Object’s ACL includes permissions for users and roles for all Data service operations. Using ACL an application may be configured to allow users (and/or roles they belong to) to be able to execute Data Service API calls. For example, in a shopping app you may have the Customer and SupportRep roles. Users in the Customer role may have the permission to create and update objects in the Incident table, but may not delete them. A user in the SupportRep role may have the permission to delete those objects.

Object ACL configuration can be done via API or Backendless console. This post review the latter. To get to the ACL screen for a specific object:

  1. Login to Backendless console, select your app and click the Data icon.
  2. Select the table to get to the data object you need to modify the ACL of.
  3. Click the “key” icon in the ACL column:
  4. Select Users Permissions or Roles Permissions In the ACL screen.
  5. Adjust the permissions for the roles and/or users as you see fit. A permission can be adjusted by clicking an icon at the intersection of a row representing user or role and a column which represents an operation. For example the following screenshot restricts access to an object for any not-authenticated user and does not allow users in the Customer role to delete the object:

Previously I wrote about how to store and retrieve objects to and from server-side in-memory cache. Quite often when working with cache, it is required to check if an object already exists in cache. Backendless provides an API for that function. The code below checks if an object exists in cache, if not, it places it in there and then runs the existence check again:

Continue reading
Posted in Feature-a-Day

This may apply only to some apps, especially if your license agreement explicitly prohibits users from specific countries, or if perhaps you want to allow users only from a specific country. The feature lets you select the countries where users would not be allowed to consume the backend of your app. The feature relies on geo-decoding user’s IP address and we do our best to maintain the mapping between the IP addresses and the countries they are assigned to. If a country is selected as one where the APIs for your app should not be allowed, then any request a user from that country makes would be rejected. To configure geography-based restrictions:

Continue reading

Previously I wrote about enabling email address confirmation for the app users after they register and before the login. The feature sends out an email with a link a user must click in order to confirm his/her email address. The text of the email can be easily customized:

  1. Login to Backendless console, select your app and click the Users icon.
  2. Click the Email Templates menu and select Confirmation template from the drop-down menu.
  3. The console displays email text editor:
  4. Continue reading

Once a user of a Backendless-powered app logs in, a session is established. The session has an inactivity timeout that is reset with every new API call made within the session. The default timeout value is 3600 seconds (1 hour). It means Backendless will keep a session alive 1 hour after the most recent API request. The inactivity timeout value is configurable in Backendless console:

The Enable Session Timeout configuration is located under Users > Login. The default setting if the configuration property is OFF. In that case, the inactivity timeout is set to 3600 as described above. To change the setting, enter a timeout value in the inactivity timeout textbox and click the toggle to set it to the ON state. The maximum allowed value is 30 days, which is 2592000 seconds.

In addition to the app development APIs, we also make available a very rich set of administrative and management functions. Every single feature available in Backendless console, is also available via specialized REST API. Whether it is performing a data import/export, setting up database schema or retrieving application’s analytics – all of these can be done with a REST call. These APIs are available for any customer who upgrades to Backendless Plus or the Cloud Enterprise plans. When you decide to upgrade, contact us and request your Admin API manual.

Continue reading

Posted in Feature-a-Day