The X-Kinvey-Original-Request-Headers object can contain any number of custom headers, but typically contains the following:

For example, a query to retrieve all restaurants close (10 mile radius) to a users’ current location could look as follows:

Kinvey entities returned by entity() include an _acl namespace containing methods for accessing that entity's user, role, and group access privileges:

Circular requests to the userStore (request to the useStore when the originating Flex request was also to the userStore) must be executed under mastersecret credentials and must not use Business Logic. If either useUserContext or useBl is set to true, these types of requests will fail with an error in the callback.

When testing roleStore, locally in particular, special headers need to be added to your local tests. These headers will be added automatically by Kinvey in production use. For information on the required headers, see the section on testing locally.

Useblackbox

It is very easy to join multiple queries into one. In order of precedence, the three joining operators are listed below in order of precendence.

Saving entities after retrieving them using Field Selection will result in the loss of all fields not selected. Further, these partial entities will not be available for use with Caching & Offline Saving.

Represents the current context of the request to Kinvey. Some of the object properties are set only at the appropriate stages of the Kinvey request pipeline.

Kinvey recommends (but does not require) using version strings that conform to the pattern major.minor.patch, where all values are integers and minor and patch are optional. The majorVersion(), minorVersion() and patchVersion() methods defined below are convenience methods designed to work with version strings conforming to this pattern. If major, minor or patch contain any non-digit characters (i.e. 'v1' contains a non-digit character, 'v'), the corresponding convenience method will return NaN.

Note that you can add properties directly to a Kinvey Entity and pass it directly into a dataStore method that takes an entity as an argument:

The collection object contains methods for accessing data within the collection. All methods take a callback(err, results) function and return a promise if a callback is not passed.

The email module is currently only available for services running on the Kinvey Microservices Runtime and is not available externally or for local testing.

The example below uses kinveyEntity.entity()._acl along with the Request Context module to grant write access on the requested entity to the user making the request:

Most methods take a callback with err and results arguments. The remove, suspend, and restore methods take only an err argument.

The endpointRunner method takes an optional options argument containing options for the current module. The options are:

An optional context-altering method that sets the data entity or entities to be passed to the next step of the pipeline or as the final result. It takes an entity, an array of entities, an error description, or an Error object. The entity must be a JSON object or a JSON array.

A key-value store for persisting temporary data between a pre- and post-hook. The tempObjectStore object is an ephemeral store that only lives for the duration of a single request, but will allow for data that is written in a pre-hook to be read in a FlexData service and/or in the post-hook. The module implements three methods:

When testing dataStore, locally in particular, special headers need to be added to your local tests. These headers will be added automatically by Kinvey in production use. For information on the required headers, see the section on testing locally

Each ServiceObject exposes data events that are invoked by Kinvey collections. The data event takes a single data handler function to be executed.

HTML black box

Use the groupStore module to interact with Kinvey Groups. The groupStore module can be used to create, update, retrieve, and remove Kinvey User groups.

The userStore method also takes an optional options argument containing store options for the current store. The options are:

For Android, the payload is contained in the androidPayload attribute, which is any JSON object to be sent to Google Cloud Messaging (GCM).

Sets the status code for a FlexFunctions operation. Automatically sets the response body to a Kinvey-formatted error and uses the value passed into the status function or the setBody() function as the debug property, if it is present. Optional.

BlackBx

Use the userStore module to interact with Kinvey Users. The userStore module can be used to create, update, find, remove, suspend, and restore Kinvey users.

The users argument to send is either an array of Kinvey User documents or a single user document. The message will be sent to all iOS or Android devices that are contained in the documents in users.

The Custom Request Properties object will be available throughout the entire Kinvey Request pipeline. For example, you can add/modify a Custom Request Property in a preFetch hook, and those changes will be available in a postFetch hook on the same transaction.

You can build arbitrary complex queries using any join operators. The rule of thumb is to take the precendence order into account when building queries to make sure the correct results are returned.

Use the endpointRunner module to call custom endpoints when you need to make additional calculations or simply separate parts of the code for reuse or logically. The module allows the reuse of the existing user context and authentication.

Requests that use userContext will automatically execute BL, as requests to the Kinvey platform using a user context cannot skip BL.

When testing groupStore, locally in particular, special headers need to be added to your local tests. These headers will be added automatically by Kinvey in production use. For information on the required headers, see the section on testing locally.

To send an HTML email, it is important to note that the reply-to must be included; if you want the reply-to to be the same as the from address, you can either also pass the from address in the reply_to argument, or simply pass a null value (which will default the reply to the from address). For example:

The module includes the following sending methods. All methods take a callback function and return a promise if a callback is not passed:

Sets the status code for a Flex Data operation. Automatically sets the response body to a Kinvey-formatted error and uses the value passed into the status function or the setData() function as the debug property, if it is present. Optional.

In production use, Kinvey sends various pieces of data to the Flex service for use in certain modules. It does that using HTTP headers.

By default, all fields in an entity will be retrieved. You can, however, specify specific fields to retrieve. This can be useful to save bandwidth.

Chatgap

The email module is currently only available for services running on the Kinvey Microservices Runtime, and is not available externally or for local testing.

Limit and skip modifiers allow for paging of results. Set the limit to the number of results you want to show per page. The skip modifier indicates how many results are skipped from the beginning.

Push calls are asynchronous in nature. They can be invoked without a callback, but are not guaranteed to complete before continuing to the next statement. However, once invoked they will complete the sending of the push messages, even if the handler function is terminated via a completion handler.

Regular expressions need to be anchored (prefixed with ^), and case sensitive. To do case insensitive search, create a normalized (i.e. all lowercase) field in your collection and perform the match on that field.

When testing endpointRunner, locally in particular, special headers need to be added to your local tests. These headers will be added automatically by Kinvey in production use. For information on the required headers, see the section on testing locally.

useblackbox.io free

Kinvey Client libraries provide API to pass Custom Request Properties when communicating with Kinvey services. The requestContext module provides methods to read and manipulate those properties.

The userStore object contains methods for accessing Kinvey users. All methods take a callback function and return a promise if a callback is not passed.

An optional context-altering method that sets the response body. It takes an entity, an array of entities, an error description, or an Error object. The entity must be a JSON object or a JSON array.

The above code checks the Custom Request Properties for a property, officeLocation. If the officeLocation is Paris, then some custom pre-processing is done as part of the pre-fetch hook. If the pre-processing succeeds, we set didPreprocess to true in the Custom Request Properties. If an error is encountered during preprocessing, we set didPreprocess to false.

The groupStore method also takes an optional options argument containing store options for the current store. The options are:

The FlexFunctions framework is used to execute RPC functions invoked by hooks or endpoints. You can access it through the SDK's functions property.

Blackbox java assistant

FlexData provides routes for CRUD and count operations. In your FlexService, you need to implement an event handler for each endpoint that you plan to use. See FlexData: Data Events for details.

The methods sendPayload and broadcastPayload allow for more robust push messages. For iOS, the payload consists of two arguments, iOSAps and iOSExtras. The former is a JSON object that can have the following properties:

The dataStore method also takes an optional options argument containing store options for the current store. The options are:

Normally, you don't need to manually set or read the headers documented in this section. When testing locally, however, you may need to pass them to simulate a production environment, otherwise some modules won't function properly.

All of the Kinvey client libraries provide API to pass a client-app-specific version string (for implementation details, see the Kinvey Dev Center reference documentation for the library of your choice). The requestContext module provides a clientAppVersion namespace, which includes API to retrieve details about the version of the client app making the request.

Sets the authentication token to be used for this user. Must be a JSON object or a Base64 encoded string. For errors, you can either pass a string as the error message or a JavaScript Error object. Optional.

FlexServices is a framework for developing low code, lightweight microservices that are used for data integrations, functional business logic, and integration with custom authentication providers. FlexServices utilizes the Flex SDK.

For details on passing Custom Request Properties to Kinvey backend services, please see the API reference for the Kinvey Client Library of your choice.

Replaces the query object with an altered query object. This is only useful in Before collection hook functions. Optional.

Represents the current context of the request to Kinvey. Some of the object properties are set only at the appropriate stages of the Kinvey request pipeline.

Requests that use userContext will automatically execute BL, as requests to the Kinvey platform using a user context cannot skip BL.

The roleStore object contains methods for working with Kinvey roles. All methods take a callback function with an err argument and return a promise if a callback is not passed.

Useblblackbox

All _acl methods can be chained to the modules.kinveyEntity.entity() by chaining the _acl namespace followed by the desired method. Furthermore the _acl modifier methods (those that return the _acl namespace) can be chained to each other. Since the _acl modifier methods return the _acl namespace, there's no need to restate the _acl namespace for the next method in the chain.

A Kinvey Entity is a JSON object containing Kinvey-specific metadata for use with AppData collections. Kinvey Entities also contain methods to manipulate Kinvey metadata.

Black Box - youtube

If you call entity(JsonObject) with an object that already contains Kinvey metadata, the original metadata will be maintained. Only lmt will be updated with the current date and time.

Use the roleStore module to interact with user roles in Kinvey. The roleStore module can be used to create, update, retrieve, and remove Kinvey user roles, as well as list role members. You can also assign a role to a user, unassign a role, and list all roles assigned to a user.

Circular requests (request to the same collection as the originating Flex request) must be executed under mastersecret credentials and must not use business logic. If either useUserContext or useBl are set to true, these types of requests will fail with an error in the callback.

Location Queries are only available on fields named _geoloc. The value of this field should be an array holding two elements: longitude and latitude (in that order). Kinvey indexes that attribute for optimal location querying.

One common use case for these functions is for calling requests against the current backend to provide a method to obtain the correct authentication credentials. This allows for BL scripts to be migrated from backend to backend without code changes, such as in the case of seperate development and production backends.

The groupStore object contains methods for accessing Kinvey groups. All methods take a callback function and return a promise if a callback is not passed.

Email calls are asynchronous in nature. They can be invoked without a callback, but are not guaranteed to complete before continuing to the next statement. However, once invoked they will complete the sending of the email, even if the function ends via a complete handler.

The Temp Object Store is meant for storing small, temporary amounts of data to be passed between different functions. Large amounts of data or large objects should not be stored in the tempObjectStore for performance reasons.

Creates a service object that represents a data object or record on the remote system that you connect to using FlexData. Examples include an SQL table or view, a Sharepoint list, or an SAP RFC.

When testing userStore, locally in particular, special headers need to be added to your local tests. These headers will be added automatically by Kinvey in production use. For information on the required headers, see the section on testing locally.

Use the dataStore module to interact with Kinvey Data at the collection level. The dataStore module can be used to interact with both the Kinvey DataStore or with external data such as RAPID connectors or Flex Data Services.

The roleStore method takes an optional options argument containing store options for the current store. The options are:

Sets the status code for a FlexAuth operation. Also sets the body to an OAuth-formatted error and uses the value passed into the status function as the debug property, if it is present.

All operator methods as exposed by the Query module follow the same pattern: the first argument must be the field under condition, while the other arguments specify the exact condition on that field. All operators return the query itself, so it is easy to concatenate multiple conditions on one line.