Retrieving

Retrieving information about a user.

Self

Retrieve details about the authenticated user.

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

await connection.Users.GetSelfAsync();

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.
var client = MeshyClient.initialize(accountName, publicKey);

var anonymousUser = await client.registerAnonymousUser();

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

var self = await meshyConnection.usersService.getSelf();

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.
GET https://api.meshydb.com/{accountName}/users/me HTTP/1.1
Authentication: Bearer {access_token}

Parameters

accountName : string, required
Indicates which account you are connecting to.
access_token : string, required
Token identifying authorization with MeshyDB requested during Generating Token.

Responses

200 : OK
  • Retrieves information about the authorized user.

Example Result

{
  "id": "5c78cc81dd870827a8e7b6c4",
  "username": "username_testermctesterson",
  "firstName": "Tester",
  "lastName": "McTesterton",
  "verified": true,
  "isActive": true,
  "phoneNumber": "5555555555",
  "roles" : [
             {
                "name":"admin",
                "addedDate":"2019-01-01T00:00:00.0000000+00:00"
             },
             {
                "name":"test",
                "addedDate":"2019-01-01T00:00:00.0000000+00:00"
             }
          ],
  "securityQuestions": [
                          {
                             "question": "What would you say to this question?",
                             "answer": "..."
                          }
                       ],
  "anonymous": true,
  "lastAccessed":"2019-01-01T00:00:00.0000+00:00"
}
401 : Unauthorized
  • User is not authorized to make call.
429 : Too many request
  • You have either hit your API or Database limit. Please review your account.

Existing

Retrieve details about an existing user by id.

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

await connection.Users.GetAsync(id);

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.
id : string, required
Identifies id of user.
var client = MeshyClient.initialize(accountName, publicKey);

var anonymousUser = await client.registerAnonymousUser();

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

var user = await meshyConnection.usersService.get(id);

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.
id : string, required
Identifies id of user.
GET https://api.meshydb.com/{accountName}/users/{id} HTTP/1.1
Authentication: Bearer {access_token}

Parameters

accountName : string, required
Indicates which account you are connecting to.
access_token : string, required
Token identifying authorization with MeshyDB requested during Generating Token.
id : string, required
Identifies id of user.

Responses

200 : OK
  • Retrieves information about the existing user.

Example Result

{
  "id": "5c78cc81dd870827a8e7b6c4",
  "username": "username_testermctesterson",
  "firstName": "Tester",
  "lastName": "McTesterton",
  "verified": true,
  "isActive": true,
  "phoneNumber": "5555555555",
  "roles" : [
             {
                "name":"admin",
                "addedDate":"2019-01-01T00:00:00.0000000+00:00"
             },
             {
                "name":"test",
                "addedDate":"2019-01-01T00:00:00.0000000+00:00"
             }
          ],
  "securityQuestions": [
                          {
                             "question": "What would you say to this question?",
                             "answer": "..."
                          }
                       ],
  "anonymous": true,
  "lastAccessed":"2019-01-01T00:00:00.0000+00:00"
}
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.