Prepared for ICROA. Api Integration Spec. Draft in review.
This document specifies the API integration requirements between DaedArch Corporation and the International Carbon Reduction and Offset Alliance (ICROA) for the purpose of facilitating data exchange related to carbon offset projects. The integration aims to support the ICROA Code of Best Practice for carbon offset providers and ensure compliance with the accreditation program for offset project developers and retailers. This specification delineates the necessary technical standards, data formats, and operational protocols to promote quality assurance in the voluntary carbon market.
DaedArch shall implement OAuth 2.0 as the authentication mechanism to ensure secure access to the API. The API consumer (DaedArch) must obtain an access token to access protected resources.
To obtain an access token, the following POST request shall be made to the token endpoint:
` POST /oauth/token HTTP/1.1 Host: api.icroa.org Content-Type: application/x-www-form-urlencoded
grant_type=client_credentials&client_id={client_id}&client_secret={client_secret} `
Parameters:
grant_type: This shall always be client_credentials.client_id: The unique identifier for DaedArch assigned by ICROA.client_secret: The secret key provided to DaedArch by ICROA.Upon successful authentication, the response will include the access token:
`json { "access_token": "eyJz93a...k4laUW", "token_type": "Bearer", "expires_in": 3600 } `
Fields:
access_token: The token to be used for subsequent API requests.token_type: The type of token, which shall be Bearer.expires_in: The validity period of the token in seconds.All subsequent API requests shall include the following Authorization header:
` Authorization: Bearer {access_token} `
The base URL for the ICROA API shall be:
` https://api.icroa.org/v1/ `
Endpoint:
` POST /offsets/data `
Description:
This endpoint shall be utilized to submit carbon offset data collected by DaedArch's MRV platform.
Request Body:
`json { "project_id": "string", "sensor_data": [ { "sensor_id": "string", "timestamp": "ISO8601", "value": "number" } ], "verification_report": { "report_id": "string", "report_url": "string" } } `
Fields:
project_id: The unique identifier for the carbon offset project (string).sensor_data: An array of sensor data objects.sensor_id: The unique identifier for the sensor (string).timestamp: The timestamp of the data point in ISO 8601 format (string).value: The measured value from the sensor (number).verification_report: An object containing the verification report details.report_id: The unique identifier for the verification report (string).report_url: The URL where the verification report can be accessed (string).Response:
Upon successful submission, the API shall return:
`json { "status": "success", "message": "Data submitted successfully", "submission_id": "string" } `
Fields:
status: The status of the submission (string).message: A detailed message regarding the submission (string).submission_id: The unique identifier for the submission (string).Endpoint:
` GET /offsets/data/{project_id} `
Description:
This endpoint shall be used to retrieve carbon offset data for a specific project.
Parameters:
project_id: The unique identifier for the carbon offset project (path parameter).Response:
The API shall return the following structure upon retrieval:
`json { "project_id": "string", "sensor_data": [ { "sensor_id": "string", "timestamp": "ISO8601", "value": "number" } ], "verification_report": { "report_id": "string", "report_url": "string" } } `
Fields:
project_id: The unique identifier for the carbon offset project (string).sensor_data: An array of sensor data objects.verification_report: An object containing the verification report details.Additional endpoints may be defined as necessary to accommodate the evolving needs of the ICROA standards and the DaedArch platform. These shall include but are not limited to endpoints for querying verification statuses, updating project details, and retrieving accreditation statuses.
The carbon offset data model shall adhere to the following structure:
`json { "project_id": "string", "sensor_data": [ { "sensor_id": "string", "timestamp": "ISO8601", "value": "number" } ], "verification_report": { "report_id": "string", "report_url": "string" } } `
The verification report model shall be defined as follows:
`json { "report_id": "string", "report_url": "string", "created_at": "ISO8601", "updated_at": "ISO8601", "status": "string" } `
Fields:
report_id: Unique identifier for the verification report (string).report_url: URL to access the verification report (string).created_at: Timestamp of report creation (ISO 8601).updated_at: Timestamp of last report update (ISO 8601).status: Current status of the verification report (string).In the event of an error, the API shall return a standardized error response format:
`json { "status": "error", "error_code": "string", "message": "string" } `
Fields:
status: The status of the response (string).error_code: A unique error code representing the type of error (string).message: A human-readable message providing additional details about the error (string).400: Bad Request - The request was invalid or cannot be otherwise served.401: Unauthorized - Authentication credentials were missing or incorrect.403: Forbidden - The request is understood, but it has been refused or access is not allowed.404: Not Found - The requested resource could not be found.500: Internal Server Error - An error occurred on the server side.To ensure fair usage and maintain the integrity of the ICROA API, DaedArch shall adhere to the following rate limits:
When the rate limit is exceeded, the API shall return a response with the following structure:
`json { "status": "error", "error_code": "429", "message": "Rate limit exceeded. Please try again later." } `
DaedArch shall undergo regular audits to verify compliance with the ICROA API Integration Specification. The following procedures shall be established:
In the event that DaedArch is found to be non-compliant with the specifications, the following steps shall be taken:
This API Integration Specification outlines the requirements and protocols necessary for the successful integration between DaedArch Corporation and ICROA. Adherence to these specifications shall ensure that both parties can effectively collaborate in advancing quality assurance in the voluntary carbon market, in alignment with the ICROA Code of Best Practice for carbon offset providers.
All parties involved are expected to maintain the highest standards of compliance and operational integrity to foster trust and transparency within the carbon offset industry.