# API Server Setup

### Configure API Server <a href="#sapj2eesystem-howtoconfigureremotemonitoringofsapj2ee" id="sapj2eesystem-howtoconfigureremotemonitoringofsapj2ee"></a>

API Server enables on-premises local access to the IT-Conductor API interface. The Gateway(s) must be configured to act as an API Server.

1. In the IT-Conductor main menu, navigate to **Dashboards → Administrator.**

![Figure 1: IT-Conductor Dashboard Menu](https://377464071-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXhp08OmU8050PePmMgDt%2Fuploads%2Fgit-blob-12d02aa50587ef8070962eba2947b8d6f3f593f1%2Fdashboard.png?alt=media)

2. Click the **Gateway** you want to configure to show the metric object menu. Then, click **Modify.**

![Figure 2: Sample Gateway to Modify](https://377464071-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXhp08OmU8050PePmMgDt%2Fuploads%2FC9CatMrQc20eHwjz9y5i%2FAPI.png?alt=media\&token=18b46cff-2784-4bf8-8ab1-f18655d8bbca)

![Figure 3: Modify Option](https://377464071-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXhp08OmU8050PePmMgDt%2Fuploads%2FwRWwFeaFRHV7QkydJOA4%2Fapi2.png?alt=media\&token=002277f7-5c39-46c6-8120-c834b6fdd723)

3. Check the **API Server** checkbox and specify the API Server Port value. Then, click the **Save** icon.

{% hint style="info" %}
**Note:** Ensure the port is available for listening and is not blocked by the local firewall.
{% endhint %}

![Figure 4: API Server and API Server Port Modification](https://377464071-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXhp08OmU8050PePmMgDt%2Fuploads%2Fwgh0r3iHoc1UhY06g2QQ%2Fapi3.png?alt=media\&token=643386e9-7437-49dd-b887-cdc8fa77d0b4)

Within several minutes, the Gateway will start the API server.

### Usage <a href="#apiserversetup-usage" id="apiserversetup-usage"></a>

The IT-Conductor Gateway on Windows includes a client program that can interact with the API server.

The "ITCAPIClient.exe" program can be in the Gateway installation folder "C:\Program Files\IT-Conductor\Agent\bin" and copied to another folder or another Windows computer. There are no external dependencies except Windows .Net Framework 4.5.

The program usages are as follows:

```
C:\Program Files\IT-Conductor\Agent\bin>ITCAPIClient.exe
Usage: -server <host>:<port> -class <Class> <options>
        Options:
        When -class Notify specified:
                [-ACTIVITY_QueueId <Person ID>|<Group ID>|<Role ID>]
                [-NOTIFY_TargetClass Person|Group|Role|Customer] : ignored if ACTIVITY_QueueId is specified
                [-NOTIFY_TargetAttrName PERSON_LoginName|OBJECT_Name] : ignored if ACTIVITY_QueueId is specified
                [-NOTIFY_TargetAttrValue <Person Login>|<Group Name>|<Role Name>] : ignored if ACTIVITY_QueueId is specified
                -NOTIFY_Subject <subject>
                -NOTIFY_MessageLong <message>
        When -class <other> specified:
                Not documented
```

The sample below will create an IT-Conductor Notification for the IT-Conductor user identified by e-mail "<admin@itconductor.com>". The Notification will send e-mail(s) based on the person's notification schedule.

```
ITCAPIClient ozraid01:8881 -class Notify -NOTIFY_TargetClass Person -NOTIFY_TargetAttrName PERSON_LoginName -NOTIFY_TargetAttrValue admin@itconductor.com -NOTIFY_Subject "Test Message" -NOTIFY_MessageLong "This is a test message sent via API Server"
```

The sample below will create an IT-Conductor notification for the IT-Conductor group BasisAdmins. The Notification will send e-mail(s) to all group members based on their notification schedules.

```
ITCAPIClient ozraid01:8881 -class Notify -NOTIFY_TargetClass Group -NOTIFY_TargetAttrName OBJECT_Name -NOTIFY_TargetAttrValue BasisAdmins -NOTIFY_Subject "Test Message" -NOTIFY_MessageLong "This is a test message sent via API Server"
```

The IT-Conductor Gateway on Linux does not include a client program however, it is possible to use wget similarly:

```
wget http://<host>:<port>/<Class>?<options>
Options:
        When Class Notify specified:
                [ACTIVITY_QueueId=<Person ID>|<Group ID>|<Role ID>&]
                [NOTIFY_TargetClass=Person|Group|Role|Customer&] : ignored if ACTIVITY_QueueId is specified
                [NOTIFY_TargetAttrName=PERSON_LoginName|OBJECT_Name&] : ignored if ACTIVITY_QueueId is specified
                [NOTIFY_TargetAttrValue=<Person Login>|<Group Name>|<Role Name>&] : ignored if ACTIVITY_QueueId is specified
                NOTIFY_Subject=<subject>&
                NOTIFY_MessageLong=<message>&
        When other classes specified:
                Not documented
```

For example:

```
wget http://ozraid01:8881/Notify?NOTIFY_TargetClass=Person&NOTIFY_TargetAttrName=PERSON_LoginName&NOTIFY_TargetAttrValue=admin@itconductor.com&NOTIFY_Subject=Test Message&NOTIFY_MessageLong=This is a test message sent via API Server
```

This notation can also be used from any web browser for testing purposes.
