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.

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.

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.

ClientSDK.Core.GetUsersAsync(EnumUserExpand userExpand = EnumUserExpand.none)
Parameters

userExpand (EnumUserExpand) – Additional information to retrieve with the user.

Return type

Task<List<User>>

Hint

EnumUserExpand

  1. none: No Expansion

  2. role: Expands with user’s roles

  3. tenant: Expands with user’s tenant

  4. feature: Expands with user’s features unioned from all production offerings the user’s tenant owns

  5. userprofile: Expands with the user’s profile

  6. role_tenant: Expands with both the user’s role and tenant

  7. role_feature: Expands with both the user’s role and features

  8. role_userprofile: Expands with both the user’s role and profile

  9. tenant_feature: Expands with both the user’s role and profile

  10. tenant_userprofile: Expands with both the user’s role and profile

  11. tenant_feature_userprofile: Expands with the user’s tenant, feature and profile

  12. role_tenant_feature_userProvile: Expands all

GetUserAsync

Gets a single user from its unique (GUID) identifier.

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): 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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

ClientSDK.Core.GetRolesAsync(bool expandFeature = false)
Parameters

expandFeature (bool) – Whether to expand to all features available to the role.

Return type

Task<List<Role>>

GetRolesAsync

Retrieve a role by id.

ClientSDK.Core.GetRoleAsync(string id, bool expandFeature = false)
Parameters
  • id (string) – Unique identifier (GUID) for the role.

  • expandFeature (bool) – Whether to expand to all features available to the role.

Return type

Task<Role>

Tenant Methods

CreateTenantAsync

Creates a tenant (customer).

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.

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.

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.

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.

  • RESTful API Documentation

  • 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.

  • RESTful API Documentation

    • 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.

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.

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.

ClientSDK.Core.UpdateProductOfferingAsync(ProductOffering productOffering)
Parameters

productOfferingId (string) – The GUID for the product offering.

Return type

Task<ProductOffering>

DeleteProductOfferingAsync

Deletes a product offering.

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

ClientSDK.Core.CreateFeatureAsync(Feature feature)
Parameters

feature (Feature) – The Feature object.

Return type

Task<Feature>

UpdateFeatureAsync

Updates an existing Feature.

ClientSDK.Core.UpdateFeatureAsync(Feature feature)
Parameters

feature (Feature) – The Feature object.

Return type

Task<Feature>

GetFeaturesAsync

Retrieves all available Features.

ClientSDK.Core.GetFeaturesAsync()
Return type

Task<List<Feature>>

GetFeatureAsync

Retrieves an existing Feature based on the id provided.

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.

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.

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.

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>