Back-end Integration APIs

This list documents the .NET APIs used for Back-end Integration.

List of APIs

Class and Method Purpose
UserIntegrationConfig in Izenda.BI.Logic.CustomConfiguration  
Hosting app hooks authorization logic for Izenda
Izenda requests hosting app to generate token based on userName/tenantId
Hosting app can add/update user in Izenda
RoleIntegrationConfig in Izenda.BI.Logic.CustomConfiguration  
Hosting app can add/update role in Izenda
Hosting app can add a role in Izenda (v2.6.16 or greater)
Hosting app can check if the specified role exists. (v2.6.16 or greater)
TenantIntegrationConfig in Izenda.BI.Logic.CustomConfiguration  
Hosting app can add/update tenant in Izenda
Hosting app can add tenant in Izenda (v2.6.16 or greater)
Hosting app can check if the specified Tenant exists (v2.6.16 or greater)

public static Func<ValidateTokenArgs, ValidateTokenResult> ValidateToken

Hosting app hooks authorization logic for Izenda.

Declaration

public static Func<ValidateTokenArgs, ValidateTokenResult> ValidateToken

Parameters

Return Value

Samples

using Izenda.BI.Logic.CustomConfiguration;
using Izenda.BI.Framework.Models.DBStructure;
using Izenda.BI.Framework.Models.UserManagement;

// ..

const string KEY = "SECRET";

UserIntegrationConfig.ValidateToken = (ValidateTokenArgs args) =>
{
   var serializedObject = Encrypt.DecryptString(args.AccessToken, KEY);
   var userInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<Models.UserInfo>(serializedObject);
   return new ValidateTokenResult { UserName = userInfo.UserName, TenantUniqueName = userInfo.TenantUniqueName };
};

public static Func<GenerateAccessTokenArgs, string> GetAccessToken

Izenda requests hosting app to generate token based on userName/tenantId.

Declaration

public static Func<GenerateAccessTokenArgs, string> GetAccessToken

Parameters

Return Value

string

Samples

using Izenda.BI.Logic.CustomConfiguration;
using Izenda.BI.Framework.Models.UserManagement;
using System.Web;

// ..

const string KEY = "SECRET";

UserIntegrationConfig.GetAccessToken = (GenerateAccessTokenArgs args) => {
   return KEY + HttpContext.Current.User.Identity.Name;
};

public static User AddOrUpdateUser(UserDetail user)

Hosting app can add/update user in Izenda.

Declaration

public static User AddOrUpdateUser(UserDetail user)

Parameters

Return Value

Samples

using Izenda.BI.Logic.CustomConfiguration;
using Izenda.BI.Framework.Models.DBStructure;

// ..

var izendaUser = new UserDetail()
{
   UserName = "admin",
   EmailAddress = "admin@acme.com",
   FirstName = "John",
   LastName = "Doe",
   TenantDisplayId = string.Empty,
   Deleted = false,
   Active = true,
   SystemAdmin = true,
   Roles = new List<Role>()
};

UserIntegrationConfig.AddOrUpdateUser(izendaUser);

public static RoleDetail AddOrUpdateRole(RoleDetail role)

Hosting app can add/update role in Izenda.

Declaration

public static RoleDetail AddOrUpdateRole(RoleDetail role)

Parameters

Return Value

Samples

using Izenda.BI.Logic.CustomConfiguration;
using Izenda.BI.Framework.Models.DBStructure;

// ..

var roleDetail = new RoleDetail()
{
   Name = "Administrator",
   Active = true
};

RoleIntegrationConfig.AddOrUpdateRole(roleDetail);

public static RoleDetail AddRole(RoleDetail role)

Hosting app add a role in Izenda.

Declaration

public static RoleDetail AddRole(RoleDetail role)

Parameters

Return Value

Samples

using Izenda.BI.Logic.CustomConfiguration;
using Izenda.BI.Framework.Models.DBStructure;

// ..
var roleDetail = new RoleDetail()
{
     Name = "Administrator",
     Active = true,
     Permission = new Izenda.BI.Framework.Models.Permissions.Permission()
     {
         Emailing = new Izenda.BI.Framework.Models.Permissions.Emailing.Emailing()
         {
             DeliveryMethod = new Izenda.BI.Framework.Models.Permissions.Emailing.DeliveryMethod()
             {
                 Attachment = true,
                 EmbeddedHTML = true,
                 Link = true
             }
         }
     }
};

 RoleIntegrationConfig.AddRole(roleDetail);

public static bool HasRole(RoleDetail role)

Hosting app can check if the specified role exists.

Declaration

public static bool HasRole(RoleDetail role)

Parameters

Return Value

bool

Samples

using Izenda.BI.Logic.CustomConfiguration;
using Izenda.BI.Framework.Models.DBStructure;

// ..

var roleDetail = new RoleDetail()
 {
     Name = "Administrator"
 };

 RoleIntegrationConfig.HasRole(roleDetail);

public static Tenants AddOrUpdateTenant(Tenants tenant)

Hosting app can add/update tenant in Izenda.

Declaration

public static Tenants AddOrUpdateTenant(Tenants tenant)

Parameters

Return Value

Samples

using Izenda.BI.Logic.CustomConfiguration;
using Izenda.BI.Framework.Models.DBStructure;

// ..

var izendaTenant = new Izenda.BI.Framework.Models.Tenants();
izendaTenant.Active = true;
izendaTenant.Deleted = false;
izendaTenant.Name = "ACME Corp";
izendaTenant.TenantID = "ACME";

TenantIntegrationConfig.AddOrUpdateTenant(izendaTenant);

public static Tenants AddTenant(Tenants tenant)

Hosting app can add tenant in Izenda.

Declaration

public static Tenants AddTenant(Tenants tenant)

Parameters

Return Value

Samples

using Izenda.BI.Logic.CustomConfiguration;
using Izenda.BI.Framework.Models.DBStructure;

// ..

var izendaTenant = new Izenda.BI.Framework.Models.Tenants();
izendaTenant.Active = true;
izendaTenant.Deleted = false;
izendaTenant.Name = "ACME Corp";
izendaTenant.TenantID = "ACME";

TenantIntegrationConfig.AddTenant(izendaTenant);

public static bool HasTenant(Tenants tenant)

Hosting app can check if the specified Tenant exists.

Declaration

public static bool HasTenant(Tenants tenant)

Parameters

Return Value

bool

Samples

using Izenda.BI.Logic.CustomConfiguration;
using Izenda.BI.Framework.Models.DBStructure;

// ..

var acmeTenant = new Izenda.BI.Framework.Models.Tenants()
{
   TenantID = "ACME"
};

TenantIntegrationConfig.HasTenant(acmeTenant);

DLL References

  • Izenda.BI.Logic.dll for the methods
  • Izenda.BI.Framework.dll for the object models