Get Current Vote Impact | Climes API
This endpoint gets the impact metics and other meta data along with certificate for the vote done by the user for their Order.
Request Parameters
Endpoint
/v3/integrations/vote/PARTNER_ORDER_ID/impact
tip
Replace PARTNER_ORDER_ID
with the partner_order_id
that you sent while placing an order.
Method
GET
Headers
{
'x-api-key' : 'API_KEY'
}
Response Parameters
Response Schema
Name | Description | Type |
---|---|---|
partner_order_id | This is the partner_order_id send while creating the order. | string |
climes | This is the total climes that were sent while creating an order which are now allocated to the project_id | number |
kg_co2_removed | This is the Kgs CO2e equivalent of climes bought. | number |
certificate_link | This is the certificate link denoting that the climes have been allocated to the said project by the user. | string |
project_name | This is the name of the project supported by this user with their climes. | string |
project_id | This is the project_id for the project which is supported by the user. Additional details for the project are available at Get Projects API | string |
allocation_date | This is the UTC time at which the user chose the project. | UTC string |
order_date | This is the UTC time at which the order was placed. | UTC string |
equivalents | This object contains the equivalent values for the kg_co2_removed . This has individual equivalents object. | object |
Equivalents Schema
Name | Description | Type |
---|---|---|
trashbags_recycled | Its the total number of trash bags collected for recycle for the kg_co2_removed | number |
seedlings_grown | Its the total number of seedlings planted and grown for 10 years for the amount of kg_co2_removed | number |
electricity_saved | Its the total hours of electricity saved for the kg_co2_removed | number |
Status Code
200
Response Data
{
"partner_order_id" : "876287372837786837",
"climes" : 557,
"kg_co2_removed" : 557,
"certificate_link": "climes-certificate-link",
"project_name" : "Making biodiverse forests financially viable for farmers",
"project_id" : "farmers-for-forests",
"allocation_date" : "2023-06-22T06:35:22.314Z",
"order_date" : "2023-06-21T02:29:50.251Z",
"equivalents" : {
"trashbags_recycled" : 24,
"seedlings_grown" : 9,
"electricity_saved" : 256
}
}
Sample Request
- cURL
- NodeJs
- Axios
- Python
- Php
curl --location --request GET 'BASE_URL/v3/integrations/vote/876287372837786837/impact'
--header 'x-api-key: API_KEY'
const fetch = require('node-fetch');
const apiKey = 'API_KEY';
const url = 'BASE_URL/v3/integrations/vote/876287372837786837/impact';
const headers = {
'x-api-key': apiKey
};
fetch(url, { headers })
.then(response => response.json())
.then(data => {
console.log(data); // Handle the response data here
})
.catch(error => {
console.error(error); // Handle any errors that occur during the request
});
var axios = require('axios');
var config = {
method: 'get',
url: 'BASE_URL/v3/integrations/vote/876287372837786837/impact',
headers: {
'x-api-key': 'API_KEY'
}
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
import requests
url = "BASE_URL/v3/integrations/vote/876287372837786837/impact"
payload={}
headers = {
'x-api-key': 'API_KEY'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('BASE_URL/v3/integrations/vote/876287372837786837/impact');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'x-api-key' => 'API_KEY'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Sample Response
Below are sample responses for the above sample request.
Responses
- Success - 200
- Failure - 400
{
"partner_order_id": "876287372837786837",
"climes": 557,
"kg_co2_removed": 557,
"certificate_link": "climes-certificate-link",
"project_name": "Making biodiverse forests financially viable for farmers",
"project_id": "farmers-for-forests",
"allocation_date": "2023-06-22T06:35:22.314Z",
"order_date": "2023-06-21T02:29:50.251Z",
"equivalents": {
"trashbags_recycled": 24,
"seedlings_grown": 9,
"electricity_saved": 256
}
}
{
"message": "Failed to get impact data."
}