C# client
In this area you'll find information on how to connect to the zkBox server using the
C# client.
Usually you'll want to use this library when you're developing applications that
are installed on your user's workstations.
Below there are all the C# zkBox client methods listed with a short call example and
with the possible return results.
The library is available in the downloads section.
Get application info
This method is returning details about the calling zkBox application.
Applications.GetApplicationInfo result = api.Applications.GetInfo();
{
error: 0,
message: "Success",
Data:
{
usersCount: "2667",
objectsCount: "58928"
}
}
{
error: 102,
message: "Invalid application",
Data: null
}
Check user
This method is check if an user exists into the system.
Users.CheckUser result = api.Users.Check(
"john");
{
error: 0,
message: "Success",
Data:
{
exists: "false"
}
}
Add user
This method is adding a new user into the system.
Users.AddUser result = api.Users.Add(
"john",
"SeCrEtP@ssw0rd");
{
error: 0,
message: "Success",
Data: {}
}
{
error: 100,
message: "The user already exists",
Data: null
}
Authenticate an user
This method is authenticating an user into the system.
Users.AuthenticateUser result = api.Users.Authenticate(
"john",
"SeCrEtP@ssw0rd");
{
error: 0,
message: "Success",
Data: {}
}
{
error: 101,
message: "Invalid username or password",
Data: null
}
Logout user
This method is logging out from the system a logged in user.
Users.LogoutUser result = api.Users.Logout();
{
error: 0,
message: "Success",
Data: {}
}
{
error: 101,
message: "Invalid username or password",
Data: null
}
Delete user
This method is deleting the calling user from the system.
Users.DeleteUser result = api.Users.Delete();
{
error: 0,
message: "Success",
Data: {}
}
{
error: 101,
message: "Invalid username or password",
Data: null
}
Add object
This method is adding an object into the system.
Objects.AddObject result = api.Objects.Add(
"expense",
new Expense { Title = "pizza at Jerry's", Amount = 32.5 });
{
error: 0,
message: "Success",
Data:
{
objectId: "A6HNCRFZMDMMC4VW"
}
}
Get object
This method is retrieving an existing object.
Objects.GetObject result = api.Objects.Get(
"A6HNCRFZMDMMC4VW");
{
error: 0,
message: "Success",
Data:
{
objectId: "A6HNCRFZMDMMC4VW",
type: "expense",
data: { Title = "pizza at Jerry's", Amount = 32.5 }
}
}
{
error: 104,
message: "The object does not exist",
Data: null
}
Update object
This method is updating an existing object into the system.
Objects.UpdateObject result = api.Objects.Update(
"A6HNCRFZMDMMC4VW",
new Expense { Title = "Pizza at Jerry's", Amount = 38.9 });
{
error: 0,
message: "Success",
Data: {}
}
{
error: 104,
message: "The object does not exist",
Data: null
}
Delete object
This method is deleting an existing object.
Objects.DeleteObject result = api.Objects.Delete(
"A6HNCRFZMDMMC4VW");
{
error: 0,
message: "Success",
Data: {}
}
{
error: 104,
message: "The object does not exist",
Data: null
}