Creation of Custom APIs

Hi,

Following the documentation: 

https://support.oneidentity.com/technical-documents/identity-manager/9.1/api-development-guide/7#TOPIC-1874743 

 

  1. Create an API plugin 

Only discrepancy with the documentation in point two, after opening visual studio, 

we created the project as a Class Library (.NET Framework) based on the guide to the guide to version 4.8, there is no direct .NET Framework 4.8 project as indicated by the guide 

 

We called our project: 

CCC.Test.CompositionApi.Server.Plugin 

 

Wrote the following api, as shown in the installation file examples 

 

using QBM.CompositionApi.Crud; 
using QBM.CompositionApi.Definition; 
using System; 
using System.Collections.Generic; 
using System.Linq; 
using System.Text; 
using System.Threading.Tasks; 

  

namespace CCC.Test.CompositionApi.Server.Plugin 
{ 
    public class ViewPersonPersonNoIag : IApiProvider 
    { 
        public void Build(IApiBuilder builder) { 
            builder.AddMethod(Method 

  

                // Set the method URL. 
                .Define("viewallperson") 
                // Set the database table 
                .FromTable("CCC_View_PersonIAGSI_IAGNO") 
                .EnableRead() 

  

                // This will include all enabled columns in the result 
                .WithAllColumns()); 
        } 

  

  

    } 
} 

Proceeding, still following the documentation, to build and obtain the dll, which we imported via Software Loader into OneIdentity. However, when we restart the server we cannot find the installed file. What are we doing wrong?

Parents Reply Children
  • Hello Gaetano,

    The signature IApiProviderFor<QER.CompositionApi.Portal.PortalApiProject> is correct to add the API to the "portal" API project.

    The selected .NET Framework version is also correct.

    Please try adding the solution from this post:

    www.oneidentity.com/.../83292

  • Hello Hanno,

    I've added [assembly: QBM.CompositionApi.PlugIns.Module("CCC")] in AssemblyInfo file and I compile a new dll named "CCCcustomapi.CompositionApi.Server.PlugIn.dll".

    I put this file in folder C:\inetpub\wwwroot\ApiServer\bin\imxweb\custom and I import it into database via Software Loader selecting Business API Server machine role.

    Then I copy this file in C:\Program Files\One Identity\One Identity Manager\bin and I import it into database via Software Loader selecting DevelopmentAndTesting machine role.

    Then I launch "iisreset" command for Api Server Reset but I can't see my file CCCcustomapi.CompositionApi.Server.PlugIn.dll in the bin folder of ApiServer. From "Api Development Guide": 

    "Restart the API Server and ensure that the <project name>.CompositionApi.Server.Plugin file exists in the bin folder of the API Server install directory."

    There is something wrong?

    If I launch command imxclient compile-api /copyapi imx-api-ccc.tgz /packagename imx-api-ccc I can't see my method in result package imx-api-ccc.tgz

    What do you suggest?

  • The bin folder referred to is the bin folder of the API server installation (C:\inetpub\wwwroot\ApiServer\bin\), see your web server. Check in the table QBMFileRevision if the value of the column FileName@QBMFileRevision is equal to bin\CCC.Test.CompositionApi.Server.Plugin.dll. You can load the same file from your directory C:\Program Files\One Identity\One Identity Manager\ with the Development and Testing machine role. If software update is enabled is IISReset not needed because the application pool will be recycled automatically (note that IISReset is deprecated, recycling the application pool is faster and can be done without downtime). See https://www.leansentry.com/guide/reset-restart-recycle-iis for some guidance about the use of IIReset.