SearchingΒΆ

Filter User data based on query parameters.

var client = MeshyClient.Initialize(accountName, publicKey);
var connection = await client.LoginAnonymouslyAsync(username);

await connection.Users.SearchAsync(name, roleId, orderBy, activeOnly, page, pageSize);

Parameters

accountName : string, required
Indicates which account you are connecting to.
publicKey : string, required
Public identifier of connecting service.
username : string, required
Unique identifier for user or device.
name : string
Case-insensitive partial name search.
roleId : string
Filters users with defined role identifier.
orderBy : string
Defines which fields need to be ordered and direction in a MongoDB format.
activeOnly : boolean, default: true
Filters users that are not active. Setting to false will include all users regardless of active status.
page : integer, default: 1
Page number of results to bring back.
pageSize : integer, max: 200, default: 25
Number of results to bring back per page.
var client = MeshyClient.initialize(accountName, publicKey);

var anonymousUser = await client.registerAnonymousUser();

var meshyConnection = await client.loginAnonymously(anonymousUser.username);

await meshyConnection.usersService.search({
                                           name: name,
                                           roleId: roleId,
                                           orderBy: orderBy,
                                           activeOnly: activeOnly,
                                           page: page,
                                           pageSize: pageSize
                                         });

Parameters

accountName : string, required
Indicates which account you are connecting to.
publicKey : string, required
Public identifier of connecting service.
username : string, required
Unique identifier for user or device.
name : string
Case-insensitive partial name search.
roleId : string
Filters users with defined role identifier.
orderBy : string
Defines which fields need to be ordered and direction in a MongoDB format.
activeOnly : boolean, default: true
Filters users that are not active. Setting to false will include all users regardless of active status.
page : integer, default: 1
Page number of results to bring back.
pageSize : integer, max: 200, default: 25
Number of results to bring back per page.
 GET https://api.meshydb.com/{accountName}/users?name={name}&
                                                 roleId={roleId}&
                                                 orderBy={orderBy}&
                                                 activeOnly={activeOnly}&
                                                 page={page}&
                                                 pageSize={pageSize} HTTP/1.1
 Authentication: Bearer {access_token}

(Line breaks added for readability)

Parameters

accountName : string, required
Indicates which account you are connecting to.
access_token : string, required
Token identifying authorization with MeshyDB requested during Generating Token.
name : string
Case-insensitive partial name search.
roleId : string
Filters users with defined role identifier.
orderBy : string
Defines which fields need to be ordered and direction in a MongoDB format.
activeOnly : boolean, default: true
Filters users that are not active. Setting to false will include all users regardless of active status.
page : integer, default: 1
Page number of results to bring back.
pageSize : integer, max: 200, default: 25
Number of results to bring back per page.

Responses

200 : OK
  • Identifies if users were found.

Example Result

{
    "results":[
        {
            "username":"test",
            "firstName":null,
            "lastName":null,
            "verified":true,
            "isActive":true,
            "phoneNumber":null,
            "emailAddress":null,
            "roles":[
                {
                "name":"meshy.user",
                "addedDate":"2019-10-18T15:11:55.2413015-05:00"
                }
            ],
            "securityQuestions":[
                {
                "question":"Test 1",
                "answerHash":"..."
                }
            ],
            "anonymous":false,
            "lastAccessed":null,
            "id":"5d4..."
        }
    ],
    "page":1,
    "pageSize":25,
    "totalRecords":1
}
400 : Bad request
  • User is not able to delete self.
401 : Unauthorized
  • User is not authorized to make call.
403 : Forbidden
  • User has insufficent permission to read users.
429 : Too many request
  • You have either hit your API or Database limit. Please review your account.