Skip to content

Saving Single Object

Saving Data Object

Method

POST

Endpoint URL

The xxxx.backendless.app is a subdomain assigned to your application. For more information see the Client-side Setup section of this documentation.

https://xxxx.backendless.app/api/data/<table-name> 

where:

Argument                Description
<table-name> name of the table where the object needs to be saved. If the table does not exist and Dynamic Schema Definition is enabled (it is turned on by default), Backendless creates the table and configures its schema to match the object structure (properties).

Request Headers

Content-Type:application/json  
user-token: value-of-the-user-token-header-from-login

where:

Argument                Description
Content-Type Must be set to application/json. This header is mandatory.
user-token Optional header. Contains a value returned by Backendless in a preceding user Login API call. If user-token is set in the request, the currently logged in user will be assigned to the ownerId property of the objects which are being saved.  Additionally, the operation will be executed with the security policy associated currently logged in user. This means all permissions associated with the user and the roles assigned to the user will be enforced by Backendless

Request Body

A JSON object to save in the database. Object properties must match the names of the table columns. The object must not have the objectId property.

Response Body

A JSON object saved in the database. The object will be assigned a unique objectId value that is included in the returned object.

Example

Important

Make sure to replace xxxx in the domain name in the sample request below to the one assigned to your application.

curl \  
-H Content-Type:application/json \  
-X POST  \  
-d "{\"name\":\"Bob\", \"age\":20}" \  
-v https://xxxx.backendless.app/api/data/Person