List Products and Versions

Most API calls need IDs: a product ID, an environment ID, or a version ID. This guide shows how to find them.

List your products

This returns every product, its environments, and the versions in each environment.

curl https://api.interlynk.io/lynkapi \
  -H "Authorization: Bearer $INTERLYNK_SECURITY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "query ListProducts($first: Int) { organization { projectGroups(first: $first, enabled: true, orderBy: { field: PROJECT_GROUPS_UPDATED_AT, direction: DESC }) { totalCount nodes { id name projects { nodes { id name sboms { id projectVersion vulnRunStatus primaryComponent { name version } } } } } } } }",
    "variables": { "first": 25 }
  }'

Response:

{
  "data": {
    "organization": {
      "projectGroups": {
        "totalCount": 3,
        "nodes": [
          {
            "id": "26ae44b7-2f68-4cf4-a405-d5ee0177bb11",
            "name": "payments-service",
            "projects": {
              "nodes": [
                {
                  "id": "1fade833-0603-4139-8ca0-26592264a4c9",
                  "name": "default",
                  "sboms": [
                    {
                      "id": "4e423fe0-d089-4025-b1e4-8fe9608138d6",
                      "projectVersion": "3.0.2",
                      "vulnRunStatus": "FINISHED",
                      "primaryComponent": { "name": "payments-service", "version": "3.0.2" }
                    }
                  ]
                },
                { "id": "d845527f-f794-4120-97e3-ee350ee6638f", "name": "development", "sboms": [] },
                { "id": "0554ca34-ae9c-48f4-bc94-d14269214a43", "name": "production", "sboms": [] }
              ]
            }
          }
        ]
      }
    }
  }
}

Read the IDs from the response:

  • Product ID is projectGroups.nodes[].id.

  • Environment ID is projects.nodes[].id.

  • Version ID is sboms[].id. This is the sbomId other calls ask for.

Find one product by name

If you know the product name, search for it instead of listing everything.

search matches partially, so confirm the name in the response is the exact product you want.

Pagination

List queries return 25 items by default. They use cursor-based pagination. Request totalCount and pageInfo to page through larger result sets:

  • Pass first and after to move forward. first is the page size, after is the endCursor from the previous page.

  • Pass last and before to move backward.

  • When hasNextPage is false, you have reached the end.

See Conventions for more on pagination, ordering, and search.

Next steps

With the IDs in hand, you can upload, download, or edit an SBOM.

Last updated