To create integrations, retrieve/ingest data and automate workflows use Interlynk's GraphQL api. Interlynk's GraphQL api offers precise and flexible queries to match your integration needs.
Last updated
API Details
Authentication
The primary method of authenticating your API is via Security Tokens. You can obtain your security token by logging into the dashboard and following the steps below.
Login to the
Click on settings on the left-hand bar
Click on "Personal" on the top right.
Click on "Security Tokens"
Click on "+" to generate a new token.
You can name your security token at this stage and set its expiration date. Depending on the type of integration being done, its recommended to choose the appropriate expiration date. Interlynk's security token looks like lynk_live_CgzGW2qLk5C73o7SgsKyBT3wVcm*********
Please remember to copy the token once generated, you will not be able to retrieve it once you close the window.
The security token assumes the role of the user who created it. If a user with admin role creates the token it will have admin privileges.
Endpoint
Interlynk's GraphQL has a single endpoint. The same endpoint supports both queries and mutations.
https://api.interlynk.io/lynkapi
Requests
The curl command below demonstrates a simple call to the endpoint to retrieve your organizations name.
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
class Program
{
static async Task Main(string[] args)
{
var url = "https://api.interlynk.io/lynkapi";
var securityToken = "lynk_live_<SECURITY_TOKEN>"; // Replace with your actual token
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Add("Authorization", $"Bearer {securityToken}");
client.DefaultRequestHeaders.Add("Content-Type", "application/json");
var jsonBody = new
{
operationName = "GetOrgName",
variables = new { },
query = "query GetOrgName { organization { name } }"
};
var content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(jsonBody), Encoding.UTF8, "application/json");
var response = await client.PostAsync(url, content);
string responseString = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseString);
}
}
}
Pagination
For most of the queries we support cursor based pagination. Cursor-based pagination is an efficient method for traversing large datasets in GraphQL. It uses a unique identifier (cursor) to determine the starting point for each subsequent query, allowing for consistent and performant data retrieval.
For all queries we always provide the total number of records for each query. If the number of entries to be returned is not provided it always defaults to 25.
The below example provides an example of a pagination request.
After an sbom is uploaded to a version, various post-processing tasks are run. Tasks like vulnerability detection, automation and policies. All of these tasks have statuses associated with them, which can help determine if its the right time to download the SBOM.
STARTED and FINISHED are the only two statuses that are displayed.