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 execute
  • id - Optional identifier

Example

GET /drv/openProfile/123

G GraphQL Schema

Overview of the GraphQL schema structure and types.

Queries

  • device(deviceId: String!): Device
  • session(sessionId: String!): Session
  • requestLogs(limit: Int, offset: Int): [RequestLog]
  • statistics: Statistics
  • networkAnalysis(ipAddress: String!): NetworkAnalysis
  • securityCheck(metadata: SecurityInput!): SecurityCheck

Mutations

  • logApiCall(metadata: MetadataInput!, response: ResponseInput!): RequestLog
  • createSession(userId: String!, deviceId: String!): Session
  • updateDevice(deviceId: String!, deviceData: DeviceInput!): Device
  • endSession(sessionId: String!): Session

Object Types

  • Device - Device information
  • Session - Session data
  • RequestLog - API call logs
  • NetworkMetadata - Network information
  • SecurityAnalysis - Security data
  • Statistics - API statistics

Input Types

  • MetadataInput - Metadata structure
  • ResponseInput - Response data
  • DeviceInput - Device update data
  • SecurityInput - 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" }