Get API Dependency Graph (Reserved)


Overview

Retrieve the dependency graph for a specific API in an application. This endpoint returns a graph structure containing nodes (APIs and their dependencies) and edges (relationships between them). The graph helps visualize the call hierarchy and relationships of the specified API.

URI

GET /rest/applications/{name}/api-inventory/{id}/graph

Path parameters

name (string)

This parameter identifies the analyzed application. The application name must be properly encoded if required. Character back-quote is not allowed.

id (string)

required The unique identifier of the API for which to retrieve the dependency graph.

Responses

application/json

The response contains a graph structure with nodes and edges representing the API and its dependencies. Example:

{
    "nodes": [
        {
            "id": "4:2970fb0e-c0ea-47e3-9507-c4f50880db84:518655",
            "data": {
                "AipId": "462488",
                "FullName": "org.openmrs.module.web.OpenmrsJspServlet.service/*.jsp/ANY",
                "Name": "*.jsp/",
                "StartPoint": "start",
                "Type": "Servlet Any Operation"
            }
        },
        {
            "id": "4:2970fb0e-c0ea-47e3-9507-c4f50880db84:523540",
            "data": {
                "AipId": "465131",
                "FullName": "org.openmrs.module.web.OpenmrsJspServlet.service",
                "Name": "service",
                "Type": "Java Method"
            }
        }
    ],
    "edges": [
        {
            "id": "5:2970fb0e-c0ea-47e3-9507-c4f50880db84:6038215",
            "source": "4:2970fb0e-c0ea-47e3-9507-c4f50880db84:523540",
            "target": "4:2970fb0e-c0ea-47e3-9507-c4f50880db84:517187",
            "type": "OVERRIDE"
        },
        {
            "id": "5:2970fb0e-c0ea-47e3-9507-c4f50880db84:6038214",
            "source": "4:2970fb0e-c0ea-47e3-9507-c4f50880db84:523540",
            "target": "4:2970fb0e-c0ea-47e3-9507-c4f50880db84:517187",
            "type": "CALL"
        }
    ]
}

JSON representation

PropertyTypeDescription
nodesarrayAn array of node objects representing APIs and dependencies in the graph.
edgesarrayAn array of edge objects representing relationships between nodes.

Node Object

Each node in the nodes array contains:

PropertyTypeDescription
idstringThe unique identifier of the node in the graph.
dataobjectContains detailed information about the node.

Node Data Object

The data object within each node contains:

PropertyTypeDescription
AipIdstringThe AIP identifier.
FullNamestringThe full name of the API or method.
NamestringThe short name of the API or method.
TypestringThe type of the node (e.g., “Servlet Any Operation”, “Java Method”).
StartPointstringOptional. Indicates if this node is the starting point of the graph (value: “start”).

Edge Object

Each edge in the edges array contains:

PropertyTypeDescription
idstringThe unique identifier of the edge in the graph.
sourcestringThe node id from which the edge originates.
targetstringThe node id to which the edge points.
typestringThe type of relationship (e.g., “CALL”, “OVERRIDE”).