Prepared for DNV. Api Integration Spec. Draft in review.
This document provides a comprehensive specification for the API-based data exchange between DaedArch Corporation (hereinafter referred to as "DaedArch") and DNV. The API facilitates the integration of DaedArch’s sensor-based Monitoring, Reporting, and Verification (MRV) platform with DNV's verification systems. This integration is essential for ensuring that the environmental data captured by DaedArch’s IoT sensors is processed, verified, and reported in accordance with DNV's standards and requirements for third-party verification and assurance.
The purpose of this specification is to outline the requirements for API integration, including authentication methods, endpoint definitions, data models, error handling procedures, and rate limits. This document serves as a normative guide for technical reviewers and developers involved in the integration process.
All API requests to DNV’s systems shall be authenticated using OAuth 2.0 protocol. The following steps outline the authentication process:
` POST /oauth/token Host: api.dnv.com Content-Type: application/x-www-form-urlencoded
grant_type=client_credentials&client_id={CLIENT_ID}&client_secret={CLIENT_SECRET} `
`json { "access_token": "eyJz93a...k4laUWw", "token_type": "Bearer", "expires_in": 3600 } `
` Authorization: Bearer {access_token} `
The following endpoints are defined for data exchange between DaedArch and DNV. Each endpoint includes the HTTP method, URL, description, request parameters, and response formats.
/api/v1/environmental-dataPOST`json { "sensor_id": "string", "timestamp": "string (ISO 8601)", "data": { "temperature": "number", "humidity": "number", "co2_levels": "number", "other_metrics": { "metric_name": "value" } }, "chain_of_custody": { "source": "string", "transit": [ { "from": "string", "to": "string", "timestamp": "string (ISO 8601)" } ] } } `
`json { "status": "success", "message": "Data submitted successfully", "verification_id": "string" } `
`json { "status": "error", "message": "Invalid data format" } `
/api/v1/verification-status/{verification_id}GETverification_id: The unique identifier for the verification request.`json { "verification_id": "string", "status": "string", "timestamp": "string (ISO 8601)", "results": { "verified": true, "comments": "string" } } `
`json { "status": "error", "message": "Verification ID not found" } `
/api/v1/error-reportPOST`json { "verification_id": "string", "error_message": "string", "timestamp": "string (ISO 8601)" } `
`json { "status": "success", "message": "Error reported successfully" } `
`json { "status": "error", "message": "Invalid error report format" } `
The data models used for the API requests and responses are defined as follows:
| Field Name | Type | Description | Required | |----------------------|----------|---------------------------------------------------|----------| | sensor_id | string | Unique identifier for the sensor | Yes | | timestamp | string | Timestamp of the data capture (ISO 8601 format) | Yes | | data | object | Environmental metrics captured | Yes | | data.temperature | number | Temperature reading | Yes | | data.humidity | number | Humidity reading | Yes | | data.co2_levels | number | CO2 levels reading | Yes | | data.other_metrics | object | Additional metrics captured | No | | chain_of_custody | object | Chain of custody details | Yes | | chain_of_custody.source | string | Source of the data | Yes | | chain_of_custody.transit | array | List of transit records | Yes |
| Field Name | Type | Description | Required | |----------------------|----------|---------------------------------------------------|----------| | verification_id | string | Unique identifier for the verification request | Yes | | status | string | Current status of the verification process | Yes | | timestamp | string | Timestamp of the status retrieval (ISO 8601 format)| Yes | | results | object | Verification results | Yes | | results.verified | boolean | Indicates if the data has been verified | Yes | | results.comments | string | Comments or notes regarding the verification | No |
The API shall provide clear and descriptive error messages to facilitate troubleshooting. The following error codes and messages are defined:
| HTTP Status Code | Error Message | Description | |------------------|-----------------------------------------|--------------------------------------------------| | 400 | Invalid data format | The request body does not conform to the expected format. | | 401 | Unauthorized | Authentication failed; invalid access token. | | 404 | Not found | The requested resource could not be found. | | 500 | Internal server error | An unexpected error occurred on the server side. |
All error responses shall conform to the following JSON format: `json { "status": "error", "message": "Descriptive error message" } `
To ensure fair usage and availability of the API, the following rate limits shall apply:
When the rate limit is exceeded, the API shall respond with a 429 Too Many Requests status code and the following JSON format: `json { "status": "error", "message": "Rate limit exceeded. Please try again later." } `
The following procedures shall be followed to ensure compliance with DNV's standards:
This API Integration Specification outlines the necessary requirements for the data exchange between DaedArch and DNV. Adherence to the specifications set forth in this document is crucial for maintaining compliance with DNV's verification and assurance standards. All parties involved in the integration process shall ensure that they are fully familiar with these requirements and implement them accordingly.
For further inquiries or clarifications, please contact the technical support team at DNV.