API Documentation
Base URL
- Production:
https://stats.api.datagram.network
- Staging:
https://stats-staging.api.datagram.network
General Information
- All endpoints are versioned under
/api/v1
. - Requests and responses use JSON format unless otherwise specified.
Endpoints
1. Uptime
GET /api/v1/uptime
Retrieves uptime details for a specific identifier within a given time range.
Parameters:
- Query Parameters:
process_manager_id
(string, optional): Unique identifier of the process manager.partner_node_id
(string, optional): Identifier of the partner node (external ID).public_id
(string, optional): Public identifier.started_at
(integer): Start time in Unix timestamp (milliseconds).ended_at
(integer): End time in Unix timestamp (milliseconds).
NOTE
At least one of process_manager_id
, partner_node_id
, or public_id
is required.
The maximum allowed time range for queries is 7 days.
Response:
- Response Code:
- 200 OK: Uptime duration in milliseconds.
- 400 Bad request: Invalid parameters.
- 401 Unauthorized: Invalid token.
- Response Value:
uptime
(integer): Uptime unix timestamp in millisecond.
Authentication:
- Use a valid organization token in the
Authorization
header. - Example:
Authorization: <token, optional>
.
Example Request:
http
GET /api/v1/uptime?partner_node_id=dg-node-12&started_at=1741251728393&ended_at=1741252994872 HTTP/1.1
Host: stats.api.datagram.network
Authorization: <organization token>
Example Response:
json
{
"data": {
"uptime": 866222,
}
}
2. Uptimes
GET /api/v1/uptimes
Retrieves uptime details for a specific identifier within a given time range.
Parameters:
- Query Parameters:
partner_node_id
(string, optional): Identifier of the partner node (external ID).partner_node_id[]
(string, optional): Multiple identifiers for partner nodes (external IDs).started_at
(integer): Start time in Unix timestamp (milliseconds).ended_at
(integer): End time in Unix timestamp (milliseconds).after
(string, optional): The cursor parameters.
NOTE
The maximum allowed time range for queries is 7 days.
Response:
- Response Code:
- 200 OK: Uptime duration in milliseconds.
- 400 Bad request: Invalid parameters.
- 401 Unauthorized: Invalid token.
- Response Value:
uptime
(integer): Uptime unix timestamp in millisecond.
Authentication:
- Use a valid organization token in the
Authorization
header. - Example:
Authorization: <token, optional>
.
Example Request:
http
GET /api/v1/uptimes&partner_node_id[]=dg-node-1&partner_node_id[]=dg-node-2&started_at=1741251728393&ended_at=1741252994872 HTTP/1.1
Host: stats.api.datagram.network
Authorization: <organization token>
Example Response:
json
{
"data": {
"metadata": {
"after": "g20A=="
},
"entries": [
{
"uptime": 1808012,
"public_id": "1sbFU"
}
]
}
}
3. Partner detail
GET /api/v1/partner/detail
Retrieves partner detail for a specific identifier.
Parameters:
- Query Parameters:
secret
(string): Unique identifier of partner.partner_node_id
(string, optional): Identifier of the partner node (external ID).
Response:
- Response Code:
- 200 OK: partner detail.
- 400 Bad request: Invalid parameters.
- 401 Unauthorized: Invalid token.
- Response Value:
node_count
(integer): Number of nodes.time_connected
(integer): Connected duration time in millisecond.unit_shared
(string): Shared unit.usd_earned
(string): Estimated earned usd.
Authentication:
- Use a valid organization token in the
Authorization
header. - Example:
Authorization: <token, optional>
.
Example Request:
http
GET /api/v1/partner/detail?secret=<partner-secret> HTTP/1.1
Host: stats.api.datagram.network
Authorization: <organization token>
Example Response:
json
{
"data": {
"node_count": 4,
"time_connected": 27266,
"unit_shared": 12,
"usd_earned": 0.024
}
}
4. Partner nodes
GET /api/v1/partner/nodes
Retrieves nodes details for a specific identifier partner.
Parameters:
- Query Parameters:
secret
(string): Unique identifier of partner.partner_node_id
(string, optional): Identifier of the partner node (external ID).after
(string, optional): The cursor parameters.
Response:
- Response Code:
- 200 OK: nodes details.
- 400 Bad request: Invalid parameters.
- 401 Unauthorized: Invalid token.
- Response Value:
entries
(list): List of node details.metadata
(paginate metadata): Includeafter
(cursor parameters),total_count
(count parameters).
Authentication:
- Use a valid organization token in the
Authorization
header. - Example:
Authorization: <token, optional>
.
Example Request:
http
GET /api/v1/partner/nodes?secret=<partner-secret> HTTP/1.1
Host: stats.api.datagram.network
Authorization: <organization token>
Example Response:
json
{
"data": {
"metadata": {
"after": null,
"total_count": 1
},
"entries": [
{
"ip": "192.158.226.25",
"external_id": "external_id",
"time_connected": 5971237,
"unit_shared": "223",
"usd_earned": "9.9",
"public_id": "DTsXQgia6JistxIzbUVZrcWZokVIcZp/379qcP5MmSQ=",
"public_name": "Moaning-Katheryn-541",
"connection_status": "connected"
}
]
}
}