API Endpoints
Documentation for all GraphQL queries, mutations, and their expected responses.
API Overview
REST
Traditional REST endpoints
GraphQL
Modern GraphQL API
Real-time
WebSocket support planned
R REST Endpoints
Traditional REST API endpoints for common operations.
POST
/log-default
Description
Log API call with default metadata collection.
Request Body
{
"device_id": "string (required)",
"user_id": "string (required)",
"endpoint": "string (required)",
"method": "string (required)",
"metadata": {
// Additional metadata fields
}
}
Response
{
"success": true,
"message": "API call logged successfully",
"request_id": "req_abc123",
"logged_at": "2025-01-15T10:30:00Z"
}
GET
/api/logs/latest
Description
Get the latest 10 API call logs.
Response
[
{
"id": 1,
"device_id": "device_abc123",
"user_id": "user_xyz789",
"endpoint": "/api/endpoint",
"method": "POST",
"http_code": 200,
"response_time_ms": 150,
"created_at": "2025-01-15T10:30:00Z"
}
]
GET
/drv/{function}/{id?}
Description
Handle deep links for mobile application routing.
Parameters
function- The function to executeid- Optional identifier
Example
GET /drv/openProfile/123
G GraphQL Schema
Overview of the GraphQL schema structure and types.
Queries
device(deviceId: String!): Devicesession(sessionId: String!): SessionrequestLogs(limit: Int, offset: Int): [RequestLog]statistics: StatisticsnetworkAnalysis(ipAddress: String!): NetworkAnalysissecurityCheck(metadata: SecurityInput!): SecurityCheck
Mutations
logApiCall(metadata: MetadataInput!, response: ResponseInput!): RequestLogcreateSession(userId: String!, deviceId: String!): SessionupdateDevice(deviceId: String!, deviceData: DeviceInput!): DeviceendSession(sessionId: String!): Session
Object Types
Device- Device informationSession- Session dataRequestLog- API call logsNetworkMetadata- Network informationSecurityAnalysis- Security dataStatistics- API statistics
Input Types
MetadataInput- Metadata structureResponseInput- Response dataDeviceInput- Device update dataSecurityInput- Security check data
Error Handling
400 Bad Request
Invalid request parameters or malformed data.
{
"error": "Bad Request",
"message": "Invalid metadata format",
"details": {
"field": "device_id",
"issue": "Required field missing"
}
}
401 Unauthorized
Missing or invalid authentication token.
{
"error": "Unauthorized",
"message": "Invalid or missing authentication token"
}
429 Too Many Requests
Rate limit exceeded.
{
"error": "Too Many Requests",
"message": "Rate limit exceeded",
"retry_after": 60,
"limit": 1000,
"remaining": 0
}
500 Internal Server Error
Server error during request processing.
{
"error": "Internal Server Error",
"message": "An unexpected error occurred",
"request_id": "req_abc123"
}