Compiling TypeScript API clients
After you create an API plug-in, you need to compile a corresponding TypeScript API client.
To compile a TypeScript API client
-
Open a command line interface (for example, Windows Powershell).
-
In the command line program, go to the One Identity Manager installation directory.
-
Run the ImxClient's start-update command (see start-update).
Example
imxclient start-update
-
Run the ImxClient's compile-api command (see compile-api).
Example
imxclient compile-api /copyapi imx-api-ccc.tgz /packagename imx-api-ccc
The dialog to select the database connection is opened.
-
In the dialog, perform one of the following actions:
-
to use an existing connection to the One Identity Manager database, select it in the Select a database connection menu.
- OR -
-
to create a new connection to the One Identity Manager database, click Add new connection and enter a new connection.
-
Select the authentication method and, under Authentication method, enter the login data for the database.
-
Click Log in.
-
Import the imx-api-ccc npm package into your TypeScript application.
TIP: (Optional) If you want to use another name for the imx-api-ccc packet, extend the remove-local-packages.js by adding a line for the packet in the list. This ensures that your package is not included in package locking and is always updated from the local source.
-
Copy the imx-api-ccc.tgz to the bin\imxweb subfolder of your IIS installation.
-
Import the TGZ file into your One Identity Manager database using the Software Loader and assign it to the Business API Server machine role. For more information on importing files using the Software Loader, see the One Identity Manager Operational Guide.
-
Restart the API Server and ensure that the imx-api-ccc.tgz file is in the bin\imxweb folder of your IIS installation.
Related topics
Adding APIs to One Identity API projects
You can add your own APIs to One Identity API projects to add customized functionality to One Identity HTML applications. To do this, create an API plug-in, define the API in it and assign the corresponding One Identity API project to the API plug-in.
To add an API to a One Identity API project
-
Create or edit an API plug-in (see Creating API plug-ins or Editing API plug-ins) and proceed as follows:
-
Create a new class in the API plug-in project. This class represents the so-called API provider.
-
Declare the class with the interface that belongs to the API project you want to add your API to.
The following One Identity API projects can be added:
Table 1: Supplied API project
Web Portal |
portal |
IApiProviderFor<QER.CompositionApi.Portal.PortalApiProject> |
Operations Support Web Portal |
opsupport |
IApiProviderFor<QBM.CompositionApi.Operations.OperationsApiProject> |
Administration portal |
admin |
IApiProviderFor<QBM.CompositionApi.AdminApi.AdminApiProject> |
Password Reset Portal |
passwordreset |
IApiProviderFor<QER.CompositionApi.Password.PasswordPortalApiProject> |
-
Implement the Build method of the IApiProviderFor interface with the desired API functionality.
Example
1 |
public class ExampleApi : IApiProviderFor<QER.CompositionApi.Portal.PortalApiProject> |
2 |
|
3 |
{ |
4 |
public void Build(IApiBuilder builder) |
5 |
{ |
6 |
builder.AddMethod(Method.Define("example") |
7 |
.AllowUnauthenticated() |
8 |
.HandleGet(qr => new DataObject { Message = "Hello world!" })); |
9 |
} |
10 |
} |
Creating API projects
You can create your own API projects to add customized functionality to One Identity HTML applications. To do this, copy the CustomApiProject sample API project (see Examples and help – Software Development Kit), customize it as required, and assign it to an API plug-in.
To create your own API project
-
Copy the CustomApiProject sample API project.
-
Make changes to the copied API project as required.
-
Create an API plug-in (see Creating API plug-ins) and proceed as follows:
Adding APIs to your own API projects
You can add more APIs to your own API projects.
To add an API to your API project
-
Edit the API plug-in (see Editing API plug-ins) associated with the API project and proceed as follows: