Skip to content

Find User By

Description

This operation finds a specific user by objectId or by identity in the Users data table. The search by identity is only available in Codeless.

Method

GET

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>/<objectId>

where:

Argument                Description
<table-name> Name of the data table where to search for the user object.
<objectId> Unique identifier of a user record to retrieve from the data table.

Request Headers

user-token:value-of-the-user-token-header-from-login

where:

Argument                Description
user-token Optional header. Contains a value returned by Backendless in a preceding user Login API call. If user-tokenis set in the request, the operation will be executed with the security policy associated with the currently logged in user. This means all permissions associated with the user and roles assigned to the user will be enforced by Backendless.

Request Body

None.

Response Body

The user object containing user data.

Example

The example below obtains the user object associated with the following objectId: "4D584E4D-05A3-4AC4-90C7-B80D1584E7AD"

curl --location --request GET 'https://xxxx.backendless.app/api/data/4D584E4D-05A3-4AC4-90C7-B80D1584E7AD' \  
--header 'user-token: 270A5E05-ECE0-41EC-B388-DB590F9D3FAA'

Codeless Reference

user_service_codeless_find_user_by

where:

Argument                Description
objectId Unique identifier of the user object which is used to obtain the user data from the Users data table.
identity A value for a column in the Users table marked as identity. By default the column marked as identity isemail, however, it can be changed to another column in Backendless Console.

Returns the user object containing user data. The object has the values for all the properties stored in Users data table.

Consider the following record in the Users data table:
user_service_codeless_example_remove_user_3

The example below finds the user by "alice@yourmail.com" identity and returns the user object containing user data.

user_service_codeless_example_find_user_by_2

The output will look as shown below after the Codeless logic runs:

user_service_codeless_example_find_user_by_4

The example below finds the user by objectId: "4D584E4D-05A3-4AC4-90C7-B80D1584E7AD" and returns the user object containing user data.

user_service_codeless_example_find_user_by_1

The output will look as shown below after the Codeless logic runs:

user_service_codeless_example_find_user_by_3