SDK
SDK C# v1.x
1

You are currently looking at the documentation of a previous version of Kuzzle. We strongly recommend that you use the latest version. You can also use the version selector in the top menu.

UpdateSelfAsync #

Updates the current user object in Kuzzle.

Arguments #

public async Task<JObject> UpdateSelfAsync(JObject content);
ArgumentTypeDescription
content
JObject
JObject representing the user content

Return #

Return a JObject with the following properties:

PropertyTypeDescription
_id
string
User's kuid
_source
JObject
Additional (and optional) user properties

Exceptions #

Throws a KuzzleException if there is an error. See how to handle error.

Usage #

try {
  await kuzzle.Auth.LoginAsync(
    "local",
    JObject.Parse("{username: 'foo', password: 'bar'}"));
  JObject updatedUser = await kuzzle.Auth.UpdateSelfAsync(
    JObject.Parse("{age: 42}"));
  Console.WriteLine(updatedUser.ToString(Formatting.None));
  /*
  {
    "_id": "foo",
    "_source": {
      "profileIds": [
        "default"
      ],
      "_kuzzle_info": {
        "author": "-1",
        "createdAt": 1564566023173,
        "updatedAt": null,
        "updater": null
      },
      "age": 42
    },
    "_meta": {
      "author": "-1",
      "createdAt": 1564566023173,
      "updatedAt": null,
      "updater": null
    }
  }
  */
} catch (KuzzleException e) {
  Console.WriteLine(e);
}