Overview

Classes

 
 

API Reference

The CloudBoost API is organized around REST. Our API is designed to have predictable, resource-oriented URLs and to use HTTP response codes to indicate API errors. We use built-in HTTP features, like HTTP authentication and HTTP verbs, which can be understood by off-the-shelf HTTP clients, and we support cross-origin resource sharing to allow you to interact securely with our API from a client-side web application/mobile application (though you should remember that you should never expose your secret API master key in any public website's client-side code, Client Key can be exposed). JSON will be returned in all responses from the API, including errors (though if you're using API bindings/SDK, we will convert the response to the appropriate language-specific object).

Endpoint

https://api.cloudboost.io
 

Dependencies

These calls require few external dependencies.

 

Apps

In Cloudboost, you create an app each of which has its own AppID, Java Client Key and the Master Key that you apply to your web app. You master key is a secret which should not be shared in your client apps. Your account on CloudBoost can accommodate multiple apps. This is useful even if you have one application, since you can deploy different versions for test and production.

 

CloudObject.save(callback)

Saves the CloudObject object to CloudBoost.

Argument
callback
Callback interface object Override the done.
Error Handling

It throws CloudBoostException

curl -X PUT --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ "key": ${client_key}, "document": { "_type": "custom", "expires": null, ${column_name}: ${column_value}, "_modifiedColumns": ["createdAt", "updatedAt", "ACL", "expires", ${column_name}], "_tableName": "data", "ACL": { "write": { "allow": { "role": [], "user": ["all"] }, "deny": { "role": [], "user": [] } }, "read": { "allow": { "role": [], "user": ["all"] }, "deny": { "role": [], "user": [] } } }, "_isModified": true} }' 'http://api.cloudboost.io/data/${app_id}/${table_name}'
 

CloudObject.fetch()

Refreshes a CloudObject object to by fetching its values from the database.

Error Handling

It throws CloudBoostException

curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ "key": ${client_key}, "limit": 1, "sort": { }, "select": { }, "query": { "$includeList": [], "$include": [], "_id": ${id_of_object_to_fetch} }, "skip": 0, }' 'http://api.cloudboost.io/data/${app_id}/${table_name}/find'
 

CloudObject.delete()

Delete a CloudObject object, if it is saved in the database.

Error Handling

It throws CloudBoostException

curl -X PUT --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ "key": ${client_key}, "document": { "updatedAt": "2016-03-15T09:22:10.446Z", "_type": "custom", "_version": 0, "expires": null, "_id": ${id_of_object_to_delete}, "createdAt": "2016-03-15T09:22:10.446Z", "_tableName": "data", "ACL": { "write": { "allow": { "role": [], "user": ["all"] }, "deny": { "role": [], "user": [] } }, "read": { "allow": { "role": [], "user": ["all"] }, "deny": { "role": [], "user": [] } } } }, "method": "DELETE", }' 'http://api.cloudboost.io/data/${app_id}/${table_name}'
 

CloudObject.isSearchable

Indexes CloudObject for search using CloudSearch.

curl -X PUT --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ "key": ${client_key}, "document": { "_type": "custom", "expires": null, ${column_name}: ${column_value}, "_modifiedColumns": ["createdAt", "updatedAt", "ACL", "expires", ${column_name}], "_tableName": "data", "ACL": { "write": { "allow": { "role": [], "user": ["all"] }, "deny": { "role": [], "user": [] } }, "read": { "allow": { "role": [], "user": ["all"] }, "deny": { "role": [], "user": [] } } }, "_isModified": true, "isSearchable":true } }' 'http://api.cloudboost.io/data/${app_id}/${table_name}'
 

CloudObject.expires

Sets the expiration time for CloudObject. Expiration time is to be given as number of milliseconds from 1 Jan 1970.

curl -X PUT --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ "key": ${client_key}, "document": { "updatedAt": "2016-03-15T09:22:10.446Z", "_type": "custom", "_version": 0, "expires": "2016-04-15T09:22:10.446Z", "_id": ${id_of_object_to_delete}, "createdAt": "2016-03-15T09:22:10.446Z", "_tableName": "data", "ACL": { "write": { "allow": { "role": [], "user": ["all"] }, "deny": { "role": [], "user": [] } }, "read": { "allow": { "role": [], "user": ["all"] }, "deny": { "role": [], "user": [] } } } } }' 'http://api.cloudboost.io/data/${app_id}/${table_name}'
 

Relationships

This section is dedicated to modelling relationships with CloudBoost.

There are usually three types of relationships.

  • One-to-One Relationship
  • One-to-many Relationship
  • Many-to-many Relationship

 

One-to-One Relationship

If you want to model one-to-one relationship. Then you need to create a new column of type Relation pointed to a table which you want it to be related to and set that column Unique property to true.

curl -X PUT --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ "key": ${client_key}, "document": { "_type": "custom", "expires": null, "address": { "_type": "custom", "expires": null, "StreetName": "Manhattan", "_modifiedColumns": ["createdAt", "updatedAt", "ACL", "expires", "StreetName", "Country"], "_tableName": "table", "ACL": { "write": { "allow": { "role": [], "user": ["all"] }, "deny": { "role": [], "user": [] } }, "read": { "allow": { "role": [], "user": ["all"] }, "deny": { "role": [], "user": [] } } }, "Country": "United States", "_isModified": true }, "name": "John Smith", "_modifiedColumns": ["createdAt", "updatedAt", "ACL", "expires", "name", "address"], "_tableName": "Student", "ACL": { "write": { "allow": { "role": [], "user": ["all"] }, "deny": { "role": [], "user": [] } }, "read": { "allow": { "role": [], "user": ["all"] }, "deny": { "role": [], "user": [] } } }, "_isModified": true } }' 'http://api.cloudboost.io/data/${app_id}/${table_name}'
 

One-to-Many Relationship

If you want to model one-to-many relationship. Then you need to create a new column of type Relation pointed to a table which you want it to be related to and set that column Unique property to false.

curl -X PUT --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ "key": ${client_key}, "document": { "_type": "custom", "expires": null, "address": { "_type": "custom", "expires": null, "StreetName": "Manhattan", "_modifiedColumns": ["createdAt", "updatedAt", "ACL", "expires", "StreetName", "Country"], "_tableName": "Address", "ACL": { "write": { "allow": { "role": [], "user": ["all"] }, "deny": { "role": [], "user": [] } }, "read": { "allow": { "role": [], "user": ["all"] }, "deny": { "role": [], "user": [] } } }, "Country": "United States", "_isModified": true }, "name": "John Smith", "_modifiedColumns": ["createdAt", "updatedAt", "ACL", "expires", "name", "address"], "_tableName": "Student", "ACL": { "write": { "allow": { "role": [], "user": ["all"] }, "deny": { "role": [], "user": [] } }, "read": { "allow": { "role": [], "user": ["all"] }, "deny": { "role": [], "user": [] } } }, "_isModified": true } }' 'http://api.cloudboost.io/data/${app_id}/${table_name}'
 

Many-to-Many Relationship

If you want to model many-to-many relationship. Then you have two options

  1. #1 - Relation Option
  2. #2 - List Option
We will discuss both of these options below.


Relation Option

This option is recommended only if you have huge number of relationships assigned to any one object.

This relationship can be created by creating a third table and having two columns that are relatied to tables you want to have many to many relationships on.









List Option

This option is recommended only if you have small number of relationships assigned to any one object.

This relationship can be created by creating an array and having related objects pushed to that array and having that array saved in any column of the table.

curl -X PUT --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ "key": ${client_key}, "document": { "course": { "_type": "custom", "expires": null, "name": "Java", "_modifiedColumns": ["createdAt", "updatedAt", "ACL", "expires", "name"], "_tableName": "Course", "ACL": { "write": { "allow": { "role": [], "user": ["all"] }, "deny": { "role": [], "user": [] } }, "read": { "allow": { "role": [], "user": ["all"] }, "deny": { "role": [], "user": [] } } }, "_isModified": true }, "_type": "custom", "expires": null, "student": { "_type": "custom", "expires": null, "name": "John Smith", "_modifiedColumns": ["createdAt", "updatedAt", "ACL", "expires", "name"], "_tableName": "Student", "ACL": { "write": { "allow": { "role": [], "user": ["all"] }, "deny": { "role": [], "user": [] } }, "read": { "allow": { "role": [], "user": ["all"] }, "deny": { "role": [], "user": [] } } }, "_isModified": true }, "_modifiedColumns": ["createdAt", "updatedAt", "ACL", "expires", "student", "course"], "_tableName": "StudentCourses", "ACL": { "write": { "allow": { "role": [], "user": ["all"] }, "deny": { "role": [], "user": [] } }, "read": { "allow": { "role": [], "user": ["all"] }, "deny": { "role": [], "user": [] } } }, "_isModified": true } }' 'http://api.cloudboost.io/data/${app_id}/${table_name}'
 

CloudQuery.equalTo( columnName, data )

It adds a contriant for finding the subset of the data in which columnName is equal to data.

Arguments
columnName
string The column on which the contraint is to be applied
data
AnythingThe value of the equals contraint
Returns

Same query object, which can be helpful in chaining query functions.

curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ "key": ${client_key}, "limit": 10, "sort": { }, "select": { }, "query": { "$includeList": [], "$include": [], "name": "john" }, "skip": 0 }' 'http://api.cloudboost.io/data/${app_id}/${table_name}/find'
 

CloudQuery.containedIn( columnName, data )

If you want to retrieve objects matching several different values, you can use containedIn, providing an array of acceptable values. This is often useful to replace multiple queries with a single query.

Arguments
columnName
string The name of the column whose value is to be checked
data
String, Integer, Double, String Array, Integer Array, Double Array The value(s) that are to be matched with.
Returns

Same query object, which can be helpful in chaining query functions.

curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ "key": ${client_key}, "limit": 10, "sort": { }, "select": { }, "query": { "$includeList": [], "name": { "$nin": [], "$in": ["adam", "bengi"] }, "$include": [] }, "skip": 0 }' 'http://api.cloudboost.io/data/${app_id}/${table_name}/find'
 

CloudQuery.containsAll( columnName, data )

Find objects where the array data in columnName contains all of the elements of data.

Arguments
columnName
string The name of the column whose value is to be checked
data
String, Integer, Double, String Array, Integer Array, Double Array The value(s) that are to be matched with.
Returns

Same query object, which can be helpful in chaining query functions.

curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ "key": ${client_key}, "limit": 10, "sort": { }, "select": { }, "query": { "$includeList": [], "name": { "$all": ["adam","bengi"] }, "$include": [] }, "skip": 0 }' 'http://api.cloudboost.io/data/${app_id}/${table_name}/find'
 

CloudQuery.startsWith( columnName, data )

It adds a contriant to find the data in which value of columnName of each data is starts with data.

Arguments
columnName
string The name of the column whose value is to be checked
data
string The value that is to be checked with.
Returns

Same query object, which can be helpful in chaining query functions.

//starts with b curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ "key": ${client_key}, "limit": 10, "sort": { }, "select": { }, "query": { "$includeList": [], "$include": [], "name": { "$options": "im", "$regex": "^b" } }, "skip": 0 }' 'http://api.cloudboost.io/data/${app_id}/${table_name}/find'
 

CloudQuery.notEqualTo( columnName, data )

It adds a contriant for finding the subset of the data in which columnName does not has the value data.

Arguments
columnName
string The attribute on which the contraint is to be applied
data
AnythingThe value of the equals contraint
Returns

Same query object, which can be helpful in chaining query functions.

//name not equal to adam curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ "key": ${client_key}, "limit": 10, "sort": { }, "select": { }, "query": { "$includeList": [], "$include": [], "name": { "$ne": "adam" } }, "skip": 0 }' 'http://api.cloudboost.io/data/${app_id}/${table_name}/find'
 

CloudQuery.notContainedIn( columnName, data )

If you want to retrieve objects which doesnot include several different values, you can use notContainedIn, providing an array of acceptable values. This is often useful to replace multiple queries with a single query.

Arguments
columnName
string The name of the column whose value is to be checked
data
Array The value(s) that are to be matched with.
Returns

Same query object, which can be helpful in chaining query functions.

//name "ben" should not be contained in returned results curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ "key": ${client_key}, "limit": 10, "sort": { }, "select": { }, "query": { "$includeList": [], "$include": [], "name": { "$nin": ["ben"] } }, "skip": 0 }' 'http://api.cloudboost.io/data/${app_id}/${table_name}/find'
 

CloudQuery.greaterThan( columnName, data )

It adds a contriant for finding the subset of the data in which columnName has the value greater than data.

Arguments
columnName
string The attribute on which the contraint is to be applied
data
string / numberThe value of the equals contraint
Returns

Same query object, which can be helpful in chaining query functions.

//age column should be greater than 30 in all returned results curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ "key": ${client_key}, "limit": 10, "sort": { }, "select": { }, "query": { "$includeList": [], "$include": [], "name": "bengi", "age": { "$gt": 30 } }, "skip": 0 }' 'http://api.cloudboost.io/data/${app_id}/${table_name}/find'
 

CloudQuery.greaterThanEqualTo( columnName, data )

It adds a contriant for finding the subset of the data in which columnName has the value greater than or equals to data.

Arguments
columnName
string The attribute on which the contraint is to be applied
data
string / numberThe value of the equals contraint
Returns

Same query object, which can be helpful in chaining query functions.

//age should be equal to or greater than 30 in all returned records curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ "key": ${client_key}, "limit": 10, "sort": { }, "select": { }, "query": { "$includeList": [], "$include": [], "age": { "$gte": 30 } }, "skip": 0 }' 'http://api.cloudboost.io/data/${app_id}/${table_name}/find'
 

CloudQuery.lessThan( columnName, data )

It adds a contriant for finding the subset of the data in which columnName has the value less than data.

Arguments
columnName
string The attribute on which the contraint is to be applied
data
string/numberThe value of the equals contraint
Returns

Same query object, which can be helpful in chaining query functions.

curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ "key": ${client_key}, "limit": 10, "sort": { }, "select": { }, "query": { "$includeList": [], "$include": [], "age": { "$lt": 30 } }, "skip": 0 }' 'http://api.cloudboost.io/data/${app_id}/${table_name}/find'
 

CloudQuery.lessThanEqualTo( columnName, data )

It adds a contriant for finding the subset of the data in which columnName has the value less than or equals to data.

Arguments
columnName
string The attribute on which the contraint is to be applied
data
string/numberThe value of the equals contraint
Returns

Same query object, which can be helpful in chaining query functions.

curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ "key": ${client_key}, "limit": 10, "sort": { }, "select": { }, "query": { "$includeList": [], "$include": [], "age": { "$lte": 30 } }, "skip": 0 }' 'http://api.cloudboost.io/data/${app_id}/${table_name}/find'
 

CloudQuery.or( query1, query2 )

It adds a logical OR contriant between 2 CloudQuery objects for finding the set of the data satisfying conditions of both query1 and query2.

Both of the CloudQuery objects should be of the same collection otherwise it throws an error.

Arguments
query1
CloudQuery object
query2
CloudQuery object
Returns

It returns a CloudQuery object which contains OR'ed query of both of the CloudQuery objects.

//find all Student such that 30<age<60 curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ "key": ${client_key}, "limit": 10, "sort": { }, "select": { }, "query": { "$includeList": [], "$include": [], "$or": [{ "$includeList": [], "$include": [], "age": { "$gt": 30 } }, { "$includeList": [], "$include": [], "age": { "$lt": 60 } }] }, "skip": 0 }' 'http://api.cloudboost.io/data/${app_id}/${table_name}/find'
 

CloudQuery.orderByAsc( columnName )

It adds a contriant for arranging the subset of the data in ascending order.

Argument
columnName
string The attribute on which the contraint is to be applied
Returns

Same query object, which can be helpful in chaining query functions.

//order by ascending curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ "key": ${client_key}, "limit": 10, "sort": { "age": 1 }, "select": { }, "query": { "$includeList": [], "$include": [] }, "skip": 0 }' 'http://api.cloudboost.io/data/${app_id}/${table_name}/find'
 

CloudQuery.orderByDesc( columnName )

It adds a contriant for arranging the subset of the data in descending order.

Argument
columnName
string The attribute on which the contraint is to be applied
Returns

Same query object, which can be helpful in chaining query functions.

//order by desscending curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ "key": ${client_key}, "limit": 10, "sort": { "age": -1 }, "select": { }, "query": { "$includeList": [], "$include": [] }, "skip": 0 }' 'http://api.cloudboost.io/data/${app_id}/${table_name}/find'
 

CloudQuery.setLimit( data )

It adds a contriant to limit no. of the data to be fetched from the database.

If it is not set explicitly, database returns 20 results by default.

Argument
data
number No. of data to be shown
Returns

Same query object, which can be helpful in chaining query functions.

//limit curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ "key": ${client_key}, "limit": 5, "sort": { }, "select": { }, "query": { "$includeList": [], "$include": [] }, "skip": 0 }' 'http://api.cloudboost.io/data/${app_id}/${table_name}/find'
 

CloudQuery.setSkip( data )

It adds a constraint to skip data no. of data matching satisfying the query contraints and fetching from the database.

It requires a sort contriant and if none of it is provided by the user then the documents are sorted according to the createdAt attribute associated with the data.

Argument
data
number No. of data to be skipped
Returns

Same query object, which can be helpful in chaining query functions.

//skip curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ "key": ${client_key}, "limit": 10, "sort": { }, "select": { }, "query": { "$includeList": [], "$include": [] }, "skip": 5 }' 'http://api.cloudboost.io/data/${app_id}/${table_name}/find'
 

CloudQuery.selectColumn( columnNames )

It adds a contriant limiting the columns that are to fetched for each of the data from the database.

id, createdAt, updatedAt and ACL are always returned unless explicitly provided by the user to discard it using doNotSelectColumn()

Argument
columnNames
string/Object/Array The name of the column(s) that are to be returned
Returns

Same query object, which can be helpful in chaining query functions.

//select curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ "key": ${client_key}, "limit": 10, "sort": { }, "select": { "updatedAt": 1, "_type": 1, "_id": 1, "createdAt": 1, "age": 1, "name": 1, "_tableName": 1, "ACL": 1 }, "query": { "$includeList": [], "$include": [] }, "skip": 0 }' 'http://api.cloudboost.io/data/${app_id}/${table_name}/find'
 

CloudQuery.doNotSelectColumn( columnNames )

It adds a contriant restricting the columns given in columnNames to be fetched for each of the data from the database.

Argument
columnNames
string/Object/Array The name of the column(s) that are not to be returned
Returns

Same query object, which can be helpful in chaining query functions.

//do not select curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ "key": ${client_key}, "limit": 10, "sort": { }, "select": { "name": 0 }, "query": { "$includeList": [], "$include": [] }, "skip": 0 }' 'http://api.cloudboost.io/data/${app_id}/${table_name}/find'
 

CloudQuery.exists( columnName )

It adds a contriant for finding the subset of the data in which columnName exists irrespective of what its value is.

Argument
columnName
string The column name which is to be checked for existence
Returns

Same query object, which can be helpful in chaining query functions.

curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ "key": ${client_key}, "sort": { }, "select": {}, "query": { "$includeList": [], "$include": [], "ben": { "$exists": true } }, "skip": 0 }' 'http://api.cloudboost.io/data/${app_id}/${table_name}/find'
 

CloudQuery.doesNotExists( columnName )

It adds a contriant for finding the subset of the data in which columnName does not exists.

Argument
columnName
string The column name which is to be checked for non-existence
Returns

Same query object, which can be helpful in chaining query functions.

curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ "key": ${client_key}, "sort": { }, "select": {}, "query": { "$includeList": [], "$include": [], "ben": { "$exists": false } }, "skip": 0 }' 'http://api.cloudboost.io/data/${app_id}/${table_name}/findOne'
 

CloudQuery.find( )

Queries the database on the constraints provided by the CloudQuery object and gets the result as an array of CloudObject objects.

If no. of documents to be returned is not specified using limit() then at max 20 documents are returned in each query by default.

If no. of documents to be skipped is specified using skip() without sorting parameter then the documents matching the query provided in CloudQuery object are sorted in ascending order of createdAt field.

Returns

It returns an array of CloudObject objects.

Error Handling
It throws CloudBoostException, MalformedURLException, IOException
curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ "key": ${client_key}, "limit": 10, "sort": { }, "select": { }, "query": { "$includeList": [], "$include": [], }, "skip": 0 }' 'http://api.cloudboost.io/data/${app_id}/${table_name}/find'
 

CloudQuery.findOne( )

Queries the database on the constraints provided by the CloudQuery object and gets a single CloudObject object satisfying the constraint.

If no. of documents to be skipped is specified using skip() without sorting parameter then the documents matching the query provided in CloudQuery object are sorted in ascending order of createdAt field.

Returns

It returns a CloudObject object or an error object if the opertion is successful.It throws an error too if sufficient data is not available to query the database.

Error Handling
It throws CloudBoostException, MalformedURLException, IOException
curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ "key": ${client_key}, "limit": 1, "sort": { }, "select": { }, "query": { "$includeList": [], "$include": [], }, "skip": 0 }' 'http://api.cloudboost.io/data/${app_id}/${table_name}/findOne'
 

CloudQuery.get( id )

Queries the database gets a CloudObject object whose id field matches id.

Arguments
id
string The ID of the data which is to be matched with _id field in the database.
Returns

It returns a CloudObject object or an error object if the operation is successful. It throws an error too if sufficient data is not available to query the database.

//retrieve a Student detail by his unique ID curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ "key": ${client_key}, "limit": 10, "sort": { }, "select": {}, "query": { "$includeList": [], "$include": [], "_id": "id" }, "skip": 0 }' 'http://api.cloudboost.io/data/${app_id}/${table_name}/find'
 

CloudQuery.count( )

It adds a contriant to find the data in which value of columnName of each data is at least equal to all of the value(s) provided in data.

Returns

It returns an Integer which is the number of documents matching the constraints given in the CloudQuery.

//fetch how many Students are there, satisfying any criteria defined in query curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ "key": ${client_key}, "limit": 10, "sort": { }, "select": {}, "query": { "$includeList": [], "$include": [] }, "skip": 0 }' 'http://api.cloudboost.io/data/${app_id}/${table_name}/count'
 

CloudQuery.distinct( columnName )

It returns distinct objects which have columnName

Sort parameter is required and if not provided by the user ascending order sorting on createdAt field is applied by default.

Argument
columnName
String The column name which should have distinct values in the returned data set.
Returns

It returns an array of CloudObject objects which are documents matching the given query in the CloudQuery object having distinct values of ColumnName

curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ "key": ${client_key}, "limit": 10, "sort": { }, "select": {}, "query": { "$includeList": [], "$include": [], "name": "name" }, "skip": 0 }' 'http://api.cloudboost.io/data/${app_id}/${table_name}/distinct'
 

CloudQuery.paginate( pageNo,totalItemsPerPage,callback )

Paginate returns only the specified number of objects from the database. It takes in the current page number and total items in page as parameters and returns list of objects,count,total number of pages.

Argument
pageNo
The page from which to count records to return
totalItemsPerPage
How many items will appear on each page whenever we paginate
Returns

Paginate returns only the specified number of objects from the database

//paginate curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ "key": ${client_key}, "limit": ${total_items_per_page}, "sort": { }, "select": { }, "query": { "$includeList": [], "$include": [] }, "skip": ${(page_no*total_items_per_page)-total_items_per_page} }' 'http://api.cloudboost.io/data/${app_id}/${table_name}/find'
 

CloudSearch.searchOn( columnName, query )

Used to perform a search query.

Arguments
columnName
string / Array The column on which the contraint is to be applied
data
queryA text query
Returns

Same CloudSearch object, which can be helpful in chaining search functions.

curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ "key": ${client_key}, "limit": 10, "sort": [], "query": { "filtered": { "query": { "bool": { "must_not": [], "should": [{ "match": { "name": { "query": "[\"egima\",\"bengi\"]" } } }], "must": [] } }, "filter": { } } }, "skip": 0, "collectionName": ${table_name} }' 'http://api.cloudboost.io/data/${app_id}/${table_name}/search'
 

CloudSearch.equalTo( columnName, data )

It adds a contriant for finding the subset of the data in which columnName is equal to data.

Arguments
columnName
string The column on which the contraint is to be applied
data
AnythingThe value of the equals contraint
Returns

Same CloudSearch object, which can be helpful in chaining search functions.

curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ "key": ${client_key}, "limit": 10, "sort": [], "query": { "filtered": { "query": { }, "filter": { "bool": { "must_not": [], "should": [], "must": [{ "term": { "name": "John" } }] } } } }, "skip": 0, "collectionName": ${table_name} }' 'http://api.cloudboost.io/data/${app_id}/${table_name}/search'
 

CloudSearch.notEqualTo( columnName, data )

It adds a contriant for finding the subset of the data in which columnName does not has the value data.

Arguments
columnName
string The attribute on which the contraint is to be applied
data
AnythingThe value of the equals contraint
Returns

Same CloudSearch object, which can be helpful in chaining query functions.

curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ "key": ${client_key}, "limit": 10, "sort": [], "query": { "filtered": { "query": { }, "filter": { "bool": { "must_not": [{ "term": { "name": "bengi" } }], "should": [], "must": [] } } } }, "skip": 0, "collectionName": ${table_name} }' 'http://api.cloudboost.io/data/${app_id}/${table_name}/search'
 

CloudSearch.greaterThan( columnName, data )

It adds a contriant for finding the subset of the data in which columnName has the value greater than data.

Arguments
columnName
string The attribute on which the contraint is to be applied
data
string / numberThe value of the equals contraint
Returns

Same CloudSearch object, which can be helpful in chaining search functions.

curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ "key": ${client_key}, "limit": 10, "sort": [], "query": { "filtered": { "query": { }, "filter": { "bool": { "must_not": [], "should": [], "must": [{ "range": { "age": { "gt": 10 } } }] } } } }, "skip": 0, "collectionName": ${table_name} }' 'http://api.cloudboost.io/data/${app_id}/${table_name}/search'
 

CloudSearch.greaterThanEqualTo( columnName, data )

It adds a contriant for finding the subset of the data in which columnName has the value greater than or equals to data.

Arguments
columnName
string The attribute on which the contraint is to be applied
data
string / numberThe value of the equals contraint
Returns

Same CloudSearch object, which can be helpful in chaining search functions.

curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ "key": ${client_key}, "limit": 10, "sort": [], "query": { "filtered": { "query": { }, "filter": { "bool": { "must_not": [], "should": [], "must": [{ "range": { "age": { "gte": 10 } } }] } } } }, "skip": 0, "collectionName": ${table_name} }' 'http://api.cloudboost.io/data/${app_id}/${table_name}/search'
 

CloudSearch.lessThan( columnName, data )

It adds a contriant for finding the subset of the data in which columnName has the value less than data.

Arguments
columnName
string The attribute on which the contraint is to be applied
data
string/numberThe value of the equals contraint
Returns

Same CloudSearch object, which can be helpful in chaining search functions.

curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ "key": ${client_key}, "limit": 10, "sort": [], "query": { "filtered": { "query": { }, "filter": { "bool": { "must_not": [], "should": [], "must": [{ "range": { "age": { "lt": 10 } } }] } } } }, "skip": 0, "collectionName": ${table_name} }' 'http://api.cloudboost.io/data/${app_id}/${table_name}/search'
 

CloudSearch.lessThanEqualTo( columnName, data )

It adds a contriant for finding the subset of the data in which columnName has the value less than or equals to data.

Arguments
columnName
string The attribute on which the contraint is to be applied
data
string/numberThe value of the equals contraint
Returns

Same CloudSearch object, which can be helpful in chaining search functions.

curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ "key": ${client_key}, "limit": 10, "sort": [], "query": { "filtered": { "query": { }, "filter": { "bool": { "must_not": [], "should": [], "must": [{ "range": { "age": { "lte": 10 } } }] } } } }, "skip": 0, "collectionName": ${table_name} }' 'http://api.cloudboost.io/data/${app_id}/${table_name}/search'
 

CloudSearch.or( cloudSearch1, cloudSearch2 )

It adds a logical OR contriant between 2 CloudSearch objects for finding the set of the data satisfying conditions of both cloudSearch1 and cloudSearch2.

Arguments
cloudSearch1
CloudSearch object
cloudSearch2
CloudSearch object
Returns

It returns a CloudSearch object which contains OR'ed query of both of the CloudSearch objects.

//search for Students either called Adam or smith curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ "key": ${client_key}, "limit": 10, "sort": [], "query": { "filtered": { "query": { }, "filter": { "bool": { "must_not": [], "should": [], "must": [{ "term": { "name": "Adam" } }, { "term": { "name": "smith" } }] } } } }, "skip": 0, "collectionName": ${table_name} }' 'http://api.cloudboost.io/data/${app_id}/${table_name}/search'
 

CloudSearch.orderByAsc( columnName )

It adds a contriant for arranging the subset of the data in ascending order.

Argument
columnName
string The attribute on which the contraint is to be applied
Returns

Same CloudSearch object, which can be helpful in chaining search functions.

curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ "key": ${client_key}, "limit": 10, "sort": [{ "name": { "order": "asc" } }], "query": { "filtered": { "query": { }, "filter": { } } }, "skip": 0, "collectionName": ${table_name} }' 'http://api.cloudboost.io/data/${app_id}/${table_name}/search'
 

CloudSearch.orderByDesc( columnName )

It adds a contriant for arranging the subset of the data in descending order.

Argument
columnName
string The attribute on which the contraint is to be applied
Returns

Same search object, which can be helpful in chaining search functions.

curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ "key": ${client_key}, "limit": 10, "sort": [{ "name": { "order": "desc" } }], "query": { "filtered": { "query": { }, "filter": { } } }, "skip": 0, "collectionName": ${table_name} }' 'http://api.cloudboost.io/data/${app_id}/${table_name}/search'
 

CloudSearch.setLimit( data )

It adds a contriant to limit no. of the data to be fetched from the database.

If it is not set explicitly, database returns 20 results by default.

Argument
data
number No. of data to be shown
Returns

Same CloudSearch object, which can be helpful in chaining search functions.

//default limit is 10 curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ "key": ${client_key}, "limit": 5, "sort": [], "query": { "filtered": { "query": { }, "filter": { } } }, "skip": 0, "collectionName": ${table_name} }' 'http://api.cloudboost.io/data/${app_id}/${table_name}/search'
 

CloudSearch.setSkip( data )

It adds a constraint to skip data no. of data matching satisfying the query contraints and fetching from the database.

Argument
data
number No. of data to be skipped
Returns

Same CloudSearch object, which can be helpful in chaining search functions.

//default skip is 0 curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ "key": ${client_key}, "limit": 10, "sort": [], "query": { "filtered": { "query": { }, "filter": { } } }, "skip": 5, "collectionName": ${table_name} }' 'http://api.cloudboost.io/data/${app_id}/${table_name}/search'
 

CloudSearch.exists( columnName )

It adds a contriant for finding the subset of the data in which columnName exists irrespective of what its value is.

Argument
columnName
string The column name which is to be checked for existence
Returns

Same CloudSearch object, which can be helpful in chaining search functions.

curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ "key": ${client_key}, "limit": 10, "sort": [], "query": { "filtered": { "query": { }, "filter": { "bool": { "must_not": [], "should": [], "must": [{ "exists": { "field": "name" } }] } } } }, "skip": 0, "collectionName": ${table_name} }' 'http://api.cloudboost.io/data/${app_id}/${table_name}/search'
 

CloudSearch.doesNotExists( columnName )

It adds a contriant for finding the subset of the data in which columnName does not exists.

Argument
columnName
string The column name which is to be checked for non-existence
Returns

Same CloudSearch object, which can be helpful in chaining search functions.

curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ "key": ${client_key}, "limit": 10, "sort": [], "query": { "filtered": { "query": { }, "filter": { "bool": { "must_not": [{ "exists": { "field": "name" } }], "should": [], "must": [] } } } }, "skip": 0, "collectionName": ${table_name} }' 'http://api.cloudboost.io/data/${app_id}/${table_name}/search'
 

CloudSearch.search([callback] )

Searches the database on the constraints provided by the CloudSearch object and gets the result as an array of CloudObject objects.

If no. of documents to be returned is not specified using limit() then at max 20 documents are returned in each query by default.

Argument
callback
CloudSearchCallback interface object must override success(Map<String, Object >) method and error method
Returns

It returns an array of CloudObject objects.

Error Handling
It throws CloudBoostException, MalformedURLException, IOException
curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ "key": ${client_key}, "limit": 10, "sort": [], "query": { "filtered": { "query": { "bool": { "must_not": [], "should": [{ "match": { "name": { "query": "[\"egima\",\"bengi\"]" } } }], "must": [] } }, "filter": { } } }, "skip": 0, "collectionName": ${table_name} }' 'http://api.cloudboost.io/data/${app_id}/${table_name}/search'
 

ACL

Each CloudObject namespace has security option by default. By default every object can be read and modified by anyone so for each object change the security option as desidred. For any object, you can specify which users/roles are allowed to read the object, and which users/roles are allowed to modify an object. To support this type of security, each object has an access control list, implemented by the ACL class.

For each object ACL object is a property in CloudObject.ACL class.

All the modifications in the ACL can be reflected only after the object is saved after the changes.

 

ACL.setPublicWriteAccess( value )

To allow/disallow public to write on a particular CloudObject

Argument
value
boolean
Returns

void

curl -X PUT --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ "key": ${client_key}, "document": { "_type": "custom", "expires": null, ${column_name}: ${column_value}, "_modifiedColumns": ["createdAt", "updatedAt", "ACL", "expires", "name"], "_tableName": "data", "ACL": { "write": { "allow": { "role": [], "user": ["all"] }, "deny": { "role": [], "user": [] } }, "read": { "allow": { "role": [], "user": ["all"] }, "deny": { "role": [], "user": [] } } }, "_isModified": true} }' 'http://api.cloudboost.io/data/${app_id}/${table_name}'
 

ACL.setPublicReadAccess( value )

To allow/disallow public to read a particular object

Argument
value
boolean
Returns

void

curl -X PUT --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ "key": ${client_key}, "document": { "_type": "custom", "expires": null, ${column_name}: ${column_value}, "_modifiedColumns": ["createdAt", "updatedAt", "ACL", "expires", "name"], "_tableName": "data", "ACL": { "write": { "allow": { "role": [], "user": ["all"] }, "deny": { "role": [], "user": [] } }, "read": { "allow": { "role": [], "user": ["all"] }, "deny": { "role": [], "user": [] } } }, "_isModified": true} }' 'http://api.cloudboost.io/data/${app_id}/${table_name}'
 

ACL.setUserWriteAccess( userId, value )

To allow/disallow user having to write on a particular object.

Argument
userId
string The User ID of the user you want to set the access for
value
boolean
Returns

void

curl -X PUT --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ "key": ${client_key}, "document": { "_type": "custom", "expires": null, ${column_name}: ${column_value}, "_modifiedColumns": ["createdAt", "updatedAt", "ACL", "expires", "name"], "_tableName": "data", "ACL": { "write": { "allow": { "role": [], "user": ["userId"] }, "deny": { "role": [], "user": [] } }, "read": { "allow": { "role": [], "user": ["all"] }, "deny": { "role": [], "user": [] } } }, "_isModified": true} }' 'http://api.cloudboost.io/data/${app_id}/${table_name}'
 

ACL.setUserReadAccess( userId, value )

To allow/disallow user having _id userId to read a particular object.

Argument
userId
string The user ID of the user you want to set the access for
value
boolean
Returns

It returns nothing.

curl -X PUT --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ "key": ${client_key}, "document": { "_type": "custom", "expires": null, ${column_name}: ${column_value}, "_modifiedColumns": ["createdAt", "updatedAt", "ACL", "expires", "name"], "_tableName": "data", "ACL": { "write": { "allow": { "role": [], "user": ["all"] }, "deny": { "role": [], "user": [] } }, "read": { "allow": { "role": [], "user": ["userId"] }, "deny": { "role": [], "user": [] } } }, "_isModified": true} }' 'http://api.cloudboost.io/data/${app_id}/${table_name}'
 

ACL.setRoleWriteAccess( roleId, value )

To allow/disallow users of roles roleId to write on a particular object

Argument
roleId
string The role ID of the Role you want to set the access for
value
boolean
Returns

void

curl -X PUT --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ "key": ${client_key}, "document": { "_type": "custom", "expires": null, ${column_name}: ${column_value}, "_modifiedColumns": ["createdAt", "updatedAt", "ACL", "expires", "name"], "_tableName": "data", "ACL": { "write": { "allow": { "role": ["rolename"], "user": [] }, "deny": { "role": [], "user": [] } }, "read": { "allow": { "role": [], "user": ["all"] }, "deny": { "role": [], "user": [] } } }, "_isModified": true} }' 'http://api.cloudboost.io/data/${app_id}/${table_name}'
 

ACL.setRoleReadAccess( roleId, value )

To allow/disallow users of roles roleId to read a particular object

Argument
roleId
string The role ID of the Role you want to set the access for
value
boolean
Returns

void

curl -X PUT --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ "key": ${client_key}, "document": { "_type": "custom", "expires": null, ${column_name}: ${column_value}, "_modifiedColumns": ["createdAt", "updatedAt", "ACL", "expires", "name"], "_tableName": "data", "ACL": { "write": { "allow": { "role": [], "user": ["all"] }, "deny": { "role": [], "user": [] } }, "read": { "allow": { "role": ["rolename"], "user": [] }, "deny": { "role": [], "user": [] } } }, "_isModified": true} }' 'http://api.cloudboost.io/data/${app_id}/${table_name}'
 

CloudUser.signUp( )

It registers new user given its username, email and password. Registration is successful if the given email is not already registered to an existing user.

It sets the attributes of CloudUser.current object with the CloudUser object recieved.

Returns

It returns a CloudUser object which has the user information if registration is successful.

Error Handling
It throws CloudBoostException
curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ "key": ${client_key}, "document": { "_type": "user", "username": ${user_name}, "expires": null, "email": "${usr_email}, "_modifiedColumns": ["createdAt", "updatedAt", "ACL", "expires", "username", "password", "email"], "_tableName": "User", "ACL": { "write": { "allow": { "role": [], "user": ["all"] }, "deny": { "role": [], "user": [] } }, "read": { "allow": { "role": [], "user": ["all"] }, "deny": { "role": [], "user": [] } } }, "password": ${password}, "_isModified": true } }' 'http://api.cloudboost.io/user/${app_id}/signup'
 

CloudUser.logIn( )

It logs in user given its username and password. Login is successful if the given username and password pair is already present in the database.

It sets the attributes of CloudUser.current object with the CloudUser object recieved.

Returns

It returns a CloudUser object which has the user information if registration is successful.

Error Handling
It throws CloudBoostException
curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ "key": ${client_key}, "document": { "_type": "user", "username": ${user_name}, "expires": null, "_modifiedColumns": ["createdAt", "updatedAt", "ACL", "expires", "username", "password"], "_tableName": "User", "ACL": { "write": { "allow": { "role": [], "user": ["all"] }, "deny": { "role": [], "user": [] } }, "read": { "allow": { "role": [], "user": ["all"] }, "deny": { "role": [], "user": [] } } }, "password": ${password}, "_isModified": true } }' 'http://api.cloudboost.io/user/${app_id}/login'
 

CloudUser.logOut( )

It logs the user out.

It sets the CloudUser.current object to null.

Returns

It returns a CloudUser object having the user information of the user who was logged in.

Error Handling
It throws CloudBoostException
curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ "key": ${client_key}, "document": { "_id": "M6gLT9DI", "_type": "user", "username": "momo", "expires": null, "email": "[email protected]", "_tableName": "User", "ACL": { "write": { "allow": { "role": [], "user": ["all"] }, "deny": { "role": [], "user": [] } }, "read": { "allow": { "role": [], "user": ["all"] }, "deny": { "role": [], "user": [] } } }, "password": ${encrypted_password}, "createdAt": "2016-03-15T09:44:28.978Z", "updatedAt": "2016-03-15T09:44:28.978Z", "_version": 0 } }' 'http://api.cloudboost.io/user/${app_id}/logout'
 

CloudUser.addToRole( role )

A user can be a part of many roles, like in real world. For this functionality user should get added to a Role.

For this purpose addToRole() of CloudUser comes in handy.

Arguments
role
CloudRole Object The CloudRole object of the role you want to add the user to.
Returns

It returns a CloudUser object having the user information of the user who was logged in.

Error Handling
It throws CloudBoostExceptionn
//role is an instance of CloudRole Object. curl -X PUT --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ "key": ${app_key}, "role": { "_type": "role", "expires": null, "name": "admin", "_modifiedColumns": ["createdAt", "updatedAt", "ACL", "expires", "name"], "_tableName": "Role", "ACL": { "write": { "allow": { "role": [], "user": ["all"] }, "deny": { "role": [], "user": [] } }, "read": { "allow": { "role": [], "user": ["all"] }, "deny": { "role": [], "user": [] } } }, "_isModified": true}, "user": { "updatedAt": "2016-03-15T09:44:28.978Z", "_type": "user", "_version": 0, "username": "momo", "expires": null, "_id": "M6gLT9DI", "email": "[email protected]", "createdAt": "2016-03-15T09:44:28.978Z", "_tableName": "User", "ACL": { "write": { "allow": { "role": [], "user": ["all"] }, "deny": { "role": [], "user": [] } }, "read": { "allow": { "role": [], "user": ["all"] }, "deny": { "role": [], "user": [] } } }, "password": ${encrypted password}} }' 'http://api.cloudboost.io/user/cpnbzclvxjts/addToRole'

Given getRole() is discussed later

 

CloudUser.removeFromRole( role )

Removes the user from the given role provided in role object.

Argument
role
CloudRole Object The CloudRole object of the role you want to remove the user from.
Returns

It returns a CloudUser object having the user information of the user who was logged in.

Error Handling
It throws CloudBoostException
curl -X PUT --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ { "role": { "_type": "role", "expires": null, "name": "admin", "_modifiedColumns": ["createdAt", "updatedAt", "ACL", "expires", "name"], "_tableName": "Role", "ACL": { "write": { "allow": { "role": [], "user": ["all"] }, "deny": { "role": [], "user": [] } }, "read": { "allow": { "role": [], "user": ["all"] }, "deny": { "role": [], "user": [] } } }, "_isModified": true }, "user": { "updatedAt": "2016-03-15T09:44:28.978Z", "_type": "user", "_version": 0, "username": "momo", "expires": null, "_id": "M6gLT9DI", "email": "[email protected]", "createdAt": "2016-03-15T09:44:28.978Z", "_tableName": "User", "ACL": { "write": { "allow": { "role": [], "user": ["all"] }, "deny": { "role": [], "user": [] } }, "read": { "allow": { "role": [], "user": ["all"] }, "deny": { "role": [], "user": [] } } }, "password": ${encrypted_password} }, "key":${app_key} } }' 'http://api.cloudboost.io/user/${app_id}/removeFromRole'

Given getRole() is discussed later

 

CloudUser.changePassword( )

To change the password of a user you need to call the changePassword function of the CB.CloudUser instance. Before you call the changePassword function make sure the current user is loggedIn and the current session is valid. Please note : Calling change password will not log the user out of its current session.

curl -X PUT --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ { "newPassword": ${old_pass}, "oldPassword": ${new_pass}, "key":${app_key} } }' 'http://api.cloudboost.io/user/${app_id}/changePassword'
 

CloudUser.resetPassword( )

To reset the password of a user you need to call the resetPassword function of the CB.CloudUser class. Reset Password takes in an email of the user as first parameter and callback as second parameter. CloudBoost automatically takes care of emailing the user with password reset link. Please note : If you want to change the format the email which CloudBoost sends by default. You can head over to your CloudBoost App Dashboard and change the email settings of an app.

curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ { "email": ${email_address}, "key":${app_key} } }' 'http://api.cloudboost.io/user/${app_id}/resetPassword'
 

CloudRole.getRole( role )

Gets a CloudRole object for a given role object with name field only.

Argument
role
CloudRole object The name of the role you want to deal with
Returns
It returns a CloudRole object having the role information of the role whose name was provided in the object of role argument.
curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ "key": ${client_key}, "limit": 10, "sort": { }, "select": { }, "query": { "$includeList": [], "$include": [], "name": "role_name" }, "skip": 0 }' 'http://api.cloudboost.io/data/${app_id}/Role/find'
 

CloudFile

CloudFile lets you store application files in the cloud that would otherwise be too large or cumbersome to fit into a regular CloudObject. The most common use case is storing images, but you can also use it for documents, videos, music, and any other binary data.

 

CloudFile.save( )

Saves the CloudFile object.

Returns

It returns a CloudFile object having url attribute set to the URL of the blob uploaded to the server if the operation is successful.

Error Handling
It throws CloudBoostException, MalformedURLException, IOException
curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ "key": ${app_key}, "data": "this data will be written to the new file", "fileObj": { "_id": "string", "_type": "file", "ACL": { "read": { "allow": { "user": [ "all" ], "role": [] }, "deny": { "user": [], "role": [] } }, "write": { "allow": { "user": [ "all" ], "role": [] }, "deny": { "user": [], "role": [] } } }, "name": "string", "size": 0, "url": "string", "expires": "2016-03-16T13:31:41.151Z", "contentType": "application/octet-stream" } }' 'https://api.cloudboost.io/file/${app_id}'
 

CloudFile.delete( )

Deletes the CloudFile object.

Returns

It returns a CloudFile object having url attribute set to null if the operation is successful.

Error Handling
It throws CloudBoostException, MalformedURLException, IOException
curl -X PUT --header 'Content-Type: application/json' --header 'Accept: text/html' -d '{ "key": ${app_key}, "method": "DELETE" }' 'http://api.cloudboost.io/file/${app_id}/${file_id}'
 

Contribute

Our documentation is open source

Documentation : GitHub Repository

01001101 01100001 01100100 01100101 01110111 01101001 01110100 01101000 00111100 00110011 01001101 01100001 01100100 01100101 01110111 01101001 01110100 01101000 00111100 00110011