Yes, it is technically possible to use a MID Server hosted in one closed network to call or execute an API in another closed network, provided that the necessary network connectivity, routing, and necessary permissions are configured correctly. However, there are important considerations to keep in mind:
Using a MID Server for API Calls
-
MID Server Functionality:
- A MID Server acts as a lightweight Java application that runs on a server within your network. It facilitates communication between the ServiceNow instance (in the cloud or another network) and your on-premises data or services.
- The MID Server can execute scripts or calls to external APIs using the credentials it has, including accessing resources that are behind firewalls or within isolated networks, as long as it has the correct routing to reach those services.
-
Network Configuration:
- Ensure that the MID Server has the necessary network routes and access permissions to reach the target API in the other closed network. You may need firewall rules or routing updates to allow communication from the MID Server to the API's endpoint.
-
Service Account Permissions:
- The service account that the MID Server uses to authenticate and make calls to the external API may need specific permissions or roles assigned to allow it to execute those API requests successfully.
- Ensure that the API you're trying to call does not impose strict access controls that could block requests coming from the MID Server’s IP or authentication context.
-
Response Handling:
- When the MID Server successfully makes the API call, it should also be able to handle the response. Ensure that the integration script or workflow in ServiceNow is set up to appropriately deal with the API response.
Installing Another MID Server
- Considerations for Installing Another MID Server:
- If the API in question is frequently used or has performance considerations due to latency, installing another MID Server directly in the other closed network might be a more effective solution. This reduces reliance on one MID Server and improves responsiveness.
- Additional MID Servers can help balance loads and are often considered best practice for larger or more complex environments.
Permissions Check
- Service Accounts:
- Make sure the Service Account that the MID Server uses for authentication has permissions to perform the intended actions. This includes access to call the API and any necessary permissions to read or update data based on the API responses.
- The permissions may involve both the ServiceNow instance configuration and the security settings of the API you are calling.
Conclusion
While you can technically call an API in another closed network through a MID Server in one network, it’s crucial to ensure that you have the correct configurations and permissions in place. In some scenarios, having an additional MID Server in the target network may be advisable, especially for performance and reliability considerations.