LightMesh API
Prerequisites
To connect with the LightMesh API, you need to be a registered user on next.lightmesh.com.
Generate an API Key
- Log in to next.lightmesh.com.
- Navigate to Admin > API Keys.
- Click Add an API Key.
- Before hitting Submit, copy the API Key. After submission, it will be encrypted and cannot be retrieved again.
For a detailed tutorial on how to generate an API Key, refer to our API Key generation guide.
Connecting LightMesh API via Postman
Setting Up Postman
Once you have the API Key, follow these steps to connect to LightMesh API using Postman.
- Open Postman and create a new request.
- Set the request type to POST.
- In the URL field, enter:
http://next.lightmesh.com/graphql
Adding Headers
Navigate to the Headers section and add the following key-value pairs:
Content-Type: application/json
token: <api-key-you-copied-from-above>
Configuring the Request Body
Go to the Body section and select raw as the data type.
Example Query (Fetching Subnet Details)
{
"query": "query ($id: Int!) { subnet(id: $id) { id name networkAddress } }",
"variables": {
"id": 21
}
}
Finding the Subnet ID
To retrieve a subnet’s ID:
- Go to your LightMesh dashboard.
- Navigate to the Subnets section.
- Locate the desired subnet and note its ID.
Sending the Request
Once the headers and body are set up:
- Click Send.
- Postman will return the subnet details in JSON format.
For detailed API documentation, including all types, queries, mutations and inputs, please visit LightMesh API Documentation.
This guide provides a basic workflow for interacting with the LightMesh API.