Core (User & Tenants)
Provides centralized multi-tenancy and multi-product registration and management. Provides full APIs for managing Tenants, Users, Products and Features providing GDPR compliance.
- class ClientSDK.Core
Enterprise Core manages:
Users
Tenants
Products
Features
User Methods
CreateUserAsync
Creates a new user and associates it to a tenant. The user will automatically be sent an email for creating their username and password, finishing the user creation.
Required Role(s): Admin, Support Admin, Super Admin
- ClientSDK.Core.CreateUserAsync(string firstName, string lastName, string email, string tenantId)
- Parameters
firstName (string) – The first name of the user.
lastName (string) – The last name of the user.
email (string) – The email address of the user. The invitation email will be sent to this address automatically.
tenantId (string) – The GUID of the tenant that will own the user.
- Returns
User Object that matches the User Protocol Buffer.
- Return type
Task<User>
User user = await _clientSDK.Core.CreateUserAsync(
"Fred",
"Flinstone",
"fred@flinstone.me",
"38c00913-55c6-4635-8f68-c86acc27c419");
UpdateUserAsync
Updates a User’s information.
Required Role(s): Admin, Support Admin, Super Admin
- ClientSDK.Core.UpdateUserAsync(User user)
- Parameters
user (User) – The User Object.
- Return type
Task<bool>
GetUsersAsync
Gets all available users including those of sub-tenants.
Required Role(s): Any
- ClientSDK.Core.GetUsersAsync(EnumUserExpand userExpand = EnumUserExpand.none)
- Parameters
userExpand (EnumUserExpand) – Additional information to retrieve with the user.
- Return type
Task<List<User>>
Hint
EnumUserExpand
none: No Expansion
role: Expands with user’s roles
tenant: Expands with user’s tenant
feature: Expands with user’s features unioned from all production offerings the user’s tenant owns
userprofile: Expands with the user’s profile
role_tenant: Expands with both the user’s role and tenant
role_feature: Expands with both the user’s role and features
role_userprofile: Expands with both the user’s role and profile
tenant_feature: Expands with both the user’s role and profile
tenant_userprofile: Expands with both the user’s role and profile
tenant_feature_userprofile: Expands with the user’s tenant, feature and profile
role_tenant_feature_userProvile: Expands all
GetUserAsync
Gets a single user from its unique (GUID) identifier.
Required Role(s): Any
- ClientSDK.Core.GetUserAsync(string userId, EnumUserExpand userExpand = EnumUserExpand.none)
- Parameters
userId (string) – The GUID for the user.
userExpand (EnumUserExpand) – Additional information to retrieve with the user.
- Return type
Task<User>
DeleteUserAsync
Deletes a single user from its unique (GUID) identifier.
Required Role(s): Any
Required Role(s): Admin, Support Admin, Super Admin
- ClientSDK.Core.DeleteUserAsync(string userId)
- Parameters
userId (string) – The GUID for the user.
- Return type
Task<bool>
Extended User Methods
ActivateUserAsync
Completes the user creation process by setting the userName and password. The user token is sent to the user via email.
Required Role(s): Any
Authentication: Not Required
- ClientSDK.Core.ActivateUserAsync(string userName, string password, string userToken)
- Parameters
userName (string) – The new username for the user to be created.
password (string) – The password for the user to be created.
userToken (string) – The token sent to the user via email.
- Returns
Whether the user was successfully activated.
- Return type
Task<bool>
GetUserFeaturesAsync
Retrieves Features for the user associated with the provided userId.
Required Role(s): Admin, Support Admin, Super Admin
- ClientSDK.Core.GetUserFeaturesAsync(string userId)
- Parameters
userId (string) – The GUID for the user.
- Returns
A list of features available to the user.
- Return type
Task<List<Feature>>
ResendInvitationAsync
Resend the invitation email to a user who did not complete the registration process in time.
Required Role(s): Admin, Support Admin, Super Admin
- ClientSDK.Core.ResendInvitationAsync(string userId)
- Parameters
userId (string) – The GUID for the user.
- Returns
Whether the invitation email was successfully sent.
- Return type
Task<bool>
SendUserNameToEmailAsync
Sends an email to the provided email address with a list of userNames associated to users with the provided email address.
Required Role(s): Admin, Support Admin, Super Admin
- ClientSDK.Core.SendUserNameToEmailAsync(string email)
- Parameters
email (string) – The email for the user.
- Returns
Whether the email was successfully sent.
- Return type
Task<bool>
UnlockUserAsync
Used to unlock a user account that has been locked due to too many failed login attempts.
Required Role(s): Admin, Support Admin, Super Admin
- ClientSDK.Core.UnlockUserAsync(string id)
- Parameters
id (string) – The GUID for the user.
- Returns
Whether the user was successfully unlocked.
- Return type
Task<bool>
UserCreateRoleRefAsync
Assigns a role to a user.
Required Role(s): Admin, Support Admin, Super Admin
- ClientSDK.Core.UserCreateRoleRefAsync(string userId, string roleId)
- Parameters
userId (string) – The GUID for the user.
roleId (string) – The GUID for the role.
- Returns
Whether the role was successfully added to the user.
- Return type
Task<bool>
UserDeleteRoleRefAsync
Removes a role from a user.
Required Role(s): Admin, Support Admin, Super Admin
- ClientSDK.Core.UserDeleteRoleRefAsync(string userId, string roleId)
- Parameters
userId (string) – The GUID for the user.
roleId (string) – The GUID for the role.
- Returns
Whether the role was successfully removed from the user.
- Return type
Task<bool>
UserRequestPasswordResetAsync
Sends a password reset email to the email address of the user associated with the provided userName.
Required Role(s): Admin, Support Admin, Super Admin
- ClientSDK.Core.UserRequestPasswordResetAsync(string userName)
- Parameters
userName (string) – The username for the user requesting an email to reset their password.
- Returns
Whether the password reset email was successfully sent.
- Return type
Task<bool>
UserPasswordUpdateAsync
Updates the password for the user associated with the provided userId.
Required Role(s): Admin, Support Admin, Super Admin
- ClientSDK.Core.UserPasswordUpdateAsync(string userId, string existingPassword, string newPassword)
- Parameters
userId (string) – The GUID for the user.
existingPassword (string) – The current user password.
newPassword (string) – The new user password.
- Returns
Whether the password was successfully updated.
- Return type
Task<bool>
Role Methods
GetRolesAsync
Retrieves all roles.
Required Role(s): Any
GetRolesAsync
Retrieve a role by id.
Required Role(s): Any
Tenant Methods
CreateTenantAsync
Creates a tenant (customer).
Required Role(s): Admin, Support Admin, Super Admin
- ClientSDK.Core.CreateTenantAsync(string name, string culture)
- Parameters
name (string) – The name of the tenant.
culture (string) – The culture code for the tenant. See Global Library
- Return type
Task<Tenant>
GetTenantsAsync
Retrieves all tenants the user has rights to see.
Required Role(s): Admin, Support Admin, Super Admin
- ClientSDK.Core.GetTenantsAsync()
- Return type
Task<List<Tenant>>
GetTenantAsync
Retrieves an existing Tenant based on the id provided.
Required Role(s): Admin, Support Admin, Super Admin
- ClientSDK.Core.GetTenantAsync(string tenantId)
- Parameters
tenantId (string) – The GUID for the tenant.
- Return type
Task<Tenant>
UpdateTenantAsync
Updates an existing tenant based on the provided id.
Required Role(s): Admin, Support Admin, Super Admin
- ClientSDK.Core.UpdateTenantAsync(Tenant tenant)
- Parameters
tenant (Tenant) – The tenant object.
- Return type
Task<bool>
DeleteTenantAsync
Deletes an existing tenant based on the provided id.
Required Role(s): Admin, Support Admin, Super Admin
- ClientSDK.Core.DeleteTenantAsync(string id)
- Parameters
id (string) – The GUID for the tenant.
- Return type
Task<bool>
AddTenantProductOfferingAsync
Creates a relationship between a Tenant and a Product Offering. Note that for a user to assign a Product Offering to a tenant, the user must currently have that Product Offering in their Product claims. If no Tenant-Product Offering relationship is present, it will be created. If one is present, it will be updated. Authorization - Role and Twin Policy. The user must have a valid token, must be an admin, and must have access to the related tenant digital twin.
Required Role(s): Admin, Support Admin, Super Admin
Resouce Authorization: Must have access to the related tenant digital twin
- ClientSDK.Core.AddTenantProductOfferingAsync(string tenantId, string productOfferingId)
- Parameters
tenantId (string) – The GUID for the tenant.
productOfferingId (string) – The GUID for the product offering.
- Return type
Task<bool>
RemoveTenantProductOfferingAsync
Deletes a relationship between a tenant and a product offering.
Required Role(s): Admin, Support Admin, Super Admin
Resouce Authorization: Must have access to the related tenant digital twin
- ClientSDK.Core.RemoveTenantProductOfferingAsync(string tenantId, string productOfferingId)
- Parameters
tenantId (string) – The GUID for the tenant.
productOfferingId (string) – The GUID for the product offering.
- Return type
Task<bool>
Product Offering Methods
CreateProductOfferingAsync
Creates a ProductOffering that customers can purchase. ProductOfferings contain a set of features that can be used to determine what ui components to display or to control access to certain endpoints.
Required Role(s): Super Admin
- ClientSDK.Core.CreateProductOfferingAsync(ProductOffering productOffering)
- Parameters
productOffering (ProductOffering) – The ProductOffering object.
- Return type
Task<ProductOffering>
GetProductOfferingAsync
Retrieves an existing ProductOffering based on the id provided.
Required Role(s): Any
- ClientSDK.Core.GetProductOfferingAsync(string productOfferingId, EnumProductOfferingExpand productOfferingExpand = EnumProductOfferingExpand.None)
- ClientSDK.Core.GetProductOfferingsAsync(EnumProductOfferingExpand productOfferingExpand = EnumProductOfferingExpand.None)
- Parameters
productOfferingId (string) – The GUID for the product offering.
productOfferingExpand (EnumProductOfferingExpand) – The additional information to retrieve with the product offering.
- Return type
Task<List<ProductOffering>>
UpdateProductOfferingAsync
Updates an existing ProductOffering that customers can purchase. ProductOfferings contain a set of features that can be used to determine what ui components to display or to control access to certain endpoints.
Required Role(s): Super Admin
- ClientSDK.Core.UpdateProductOfferingAsync(ProductOffering productOffering)
- Parameters
productOfferingId (string) – The GUID for the product offering.
- Return type
Task<ProductOffering>
DeleteProductOfferingAsync
Deletes a product offering.
Required Role(s): Super Admin
- ClientSDK.Core.DeleteProductOfferingAsync(string id)
- Parameters
id (ProductOffering) – The GUID for the product offering.
- Return type
Task<bool>
Feature Methods
Features are used to determine what ui components to display or to control which users have access to certain endpoints so this can cause components or endpoints to be inaccessable.
CreateFeatureAsync
Creates a new Feature
Required Role(s): Super Admin
- ClientSDK.Core.CreateFeatureAsync(Feature feature)
- Parameters
feature (Feature) – The Feature object.
- Return type
Task<Feature>
UpdateFeatureAsync
Updates an existing Feature.
Required Role(s): Super Admin
- ClientSDK.Core.UpdateFeatureAsync(Feature feature)
- Parameters
feature (Feature) – The Feature object.
- Return type
Task<Feature>
GetFeaturesAsync
Retrieves all available Features.
Required Role(s): Super Admin
- ClientSDK.Core.GetFeaturesAsync()
- Return type
Task<List<Feature>>
GetFeatureAsync
Retrieves an existing Feature based on the id provided.
Required Role(s): Super Admin
- ClientSDK.Core.GetFeatureAsync(string id)
- Parameters
id (string) – The unique identifier of the feature to delete
- Return type
Task<Feature>
DeleteFeatureAsync
Deletes an existing Feature.
Required Role(s): Super Admin
- ClientSDK.Core.DeleteFeatureAsync(string id)
- Parameters
id (string) – The unique identifier of the feature to delete
- Return type
Task<bool>
CreateFeatureReferenceAsync
Creates a reference to a Feature from another entity.
Required Role(s): Super Admin
- ClientSDK.Core.CreateFeatureReferenceAsync(string featureId, EnumNavigationProperty enumNavigationProperty, string referenceId)
- Parameters
featureId (string) – The unique identifier of the feature
enumNavigationProperty (EnumNavigationProperty) – The unique identifier of the feature
referenceId (string) – The unique identifier of the item to be referenced
- Return type
Task<bool>
DeleteFeatureReferenceAsync
Deletes a reference to a Feature from another entity.
Required Role(s): Super Admin
- ClientSDK.Core.DeleteFeatureReferenceAsync(string featureId, EnumNavigationProperty enumNavigationProperty, string referenceId)
- Parameters
featureId (string) – The unique identifier of the feature
enumNavigationProperty (EnumNavigationProperty) – The unique identifier of the feature
referenceId (string) – The unique identifier of the item to be referenced
- Return type
Task<bool>